mirror of
https://github.com/kkapsner/CanvasBlocker
synced 2025-07-04 20:46:39 +02:00
parent
040acb311f
commit
f73a4ee619
5 changed files with 77 additions and 5 deletions
|
@ -212,7 +212,7 @@
|
|||
};
|
||||
addSection();
|
||||
|
||||
const {hide: hideContainer} = settings.getContainers();
|
||||
const {hide: hideContainer, expand: expandContainer} = settings.getContainers();
|
||||
settingsDisplay.forEach(function(display){
|
||||
if (typeof display === "string"){
|
||||
addSection(display);
|
||||
|
@ -248,6 +248,7 @@
|
|||
}
|
||||
if (setting){
|
||||
setting.display = display;
|
||||
|
||||
let hideChangeListeners = [];
|
||||
setting.setHide = function setHide(value){
|
||||
if (hideContainer){
|
||||
|
@ -279,6 +280,31 @@
|
|||
});
|
||||
}
|
||||
|
||||
let expandChangeListeners = [];
|
||||
setting.setExpand = function setExpand(value){
|
||||
if (expandContainer){
|
||||
expandContainer.setExpandByName(display.name, value);
|
||||
}
|
||||
};
|
||||
setting.onExpandChange = function(listener){
|
||||
expandChangeListeners.push(listener);
|
||||
};
|
||||
setting.getExpand = function getExpand(){
|
||||
if (expandContainer){
|
||||
return expandContainer.getExpandByName(display.name);
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
if (expandContainer){
|
||||
expandContainer.onExpandChange(display.name, function(value){
|
||||
expandChangeListeners.forEach(function(listener){
|
||||
listener(value);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
var row = optionsGui.createSettingRow(setting);
|
||||
let section = lastSection;
|
||||
section.addRow(row);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue