Skip to content

Commit ddaf749

Browse files
committed
[feature] add control debug logging
1 parent 008bfd1 commit ddaf749

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

‎src/js/control.js‎

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@ var control = (function(){
22

33
varmod={};
44

5+
mod.debug={
6+
active: false,
7+
toggle: function(){
8+
if(mod.debug.active){
9+
mod.debug.active=false;
10+
}else{
11+
mod.debug.active=true;
12+
};
13+
}
14+
};
15+
516
mod.header=[{
617
element: ".control-menu-open",
718
type: "button",
@@ -5776,10 +5787,12 @@ var control = (function(){
57765787
path: object.path,
57775788
newValue: newValue
57785789
});
5779-
console.log("state set",object.path,helper.getObject({
5780-
object: state.get.current(),
5781-
path: object.path
5782-
}));
5790+
if(mod.debug.active){
5791+
console.log("state set",object.path,helper.getObject({
5792+
object: state.get.current(),
5793+
path: object.path
5794+
}));
5795+
};
57835796
};
57845797
},
57855798
get: {
@@ -7260,6 +7273,10 @@ var control = (function(){
72607273
}
72617274
};
72627275

7276+
vardebug=function(){
7277+
mod.debug.toggle();
7278+
};
7279+
72637280
varinit=function(){
72647281
bind.control.header();
72657282
bind.control.menu();
@@ -7276,7 +7293,8 @@ var control = (function(){
72767293
init: init,
72777294
mod: mod,
72787295
bind: bind,
7279-
render: render
7296+
render: render,
7297+
debug: debug
72807298
};
72817299

72827300
})();

0 commit comments

Comments
(0)