DDMAL / Pixel.js

🖌 A web-based pixel classification and correction platform
MIT License
9 stars 2 forks source link

Check and disable create/destroy layer functions and buttons #247

Closed EricHanLiu closed 6 years ago

EricHanLiu commented 6 years ago

This check was recommended to be put in the standalone Pixel.js (it doesn't remove any compatibility with the standalone, and is cleaner to implement here than in the wrapper).

Only disable the buttons if either in standalone Pixel.js, or if the number of input layers is 0. This check is short-circuited if in the standalone Pixel.js and numberInputLayers doesn't exist.

Functions are disabled if the submitToRodan button exists (!== null), so it will function normally in the standalone Pixel.js.

Function disables are required because layers can be created/deleted with hotkeys as well.