[feature] add control debug logging

This commit is contained in:
zombieFox 2020-02-19 17:30:27 +00:00
parent 008bfd185b
commit ddaf7494b8

View File

@ -2,6 +2,17 @@ var control = (function() {
var mod = {}; var mod = {};
mod.debug = {
active: false,
toggle: function() {
if (mod.debug.active) {
mod.debug.active = false;
} else {
mod.debug.active = true;
};
}
};
mod.header = [{ mod.header = [{
element: ".control-menu-open", element: ".control-menu-open",
type: "button", type: "button",
@ -5776,10 +5787,12 @@ var control = (function() {
path: object.path, path: object.path,
newValue: newValue newValue: newValue
}); });
console.log("state set", object.path, helper.getObject({ if (mod.debug.active) {
object: state.get.current(), console.log("state set", object.path, helper.getObject({
path: object.path object: state.get.current(),
})); path: object.path
}));
};
}; };
}, },
get: { get: {
@ -7260,6 +7273,10 @@ var control = (function() {
} }
}; };
var debug = function() {
mod.debug.toggle();
};
var init = function() { var init = function() {
bind.control.header(); bind.control.header();
bind.control.menu(); bind.control.menu();
@ -7276,7 +7293,8 @@ var control = (function() {
init: init, init: init,
mod: mod, mod: mod,
bind: bind, bind: bind,
render: render render: render,
debug: debug
}; };
})(); })();