1
0
mirror of https://github.com/kkapsner/CanvasBlocker synced 2024-12-22 12:50:36 +01:00

Computed default value

Default values for settings can now be functions to be computed.
This commit is contained in:
kkapsner 2018-06-21 00:03:17 +02:00
parent c5882a30aa
commit 4f18dc3ab6

View File

@ -229,6 +229,9 @@
var name = settingDefinition.name;
definitionsByName[name] = settingDefinition;
if (typeof settingDefinition.defaultValue === "function"){
settingDefinition.defaultValue = settingDefinition.defaultValue();
}
settings[name] = settingDefinition.defaultValue;
eventHandler[name] = {};