Remember the state of cba per user in their owned pads

pull/1/head
yflory 5 years ago
parent 87fc1f8daf
commit 94c9e47d32

@ -395,6 +395,13 @@ define([
//console.log("%s => %s", CodeMirror.highlightMode, CodeMirror.$language.val()); //console.log("%s => %s", CodeMirror.highlightMode, CodeMirror.$language.val());
} }
if (newPad && Util.find(privateData, ['settings', 'code', 'enableColors'])) {
var metadataMgr = common.getMetadataMgr();
var md = Util.clone(metadataMgr.getMetadata());
md.enableColors = true;
metadataMgr.updateMetadata(md);
}
markers.ready(); markers.ready();
var fmConfig = { var fmConfig = {

@ -73,6 +73,7 @@ define([
$button.remove(); $button.remove();
var md = Util.clone(metadataMgr.getMetadata()); var md = Util.clone(metadataMgr.getMetadata());
md.enableColors = true; md.enableColors = true;
common.setAttribute(['code', 'enableColors'], true);
metadataMgr.updateMetadata(md); metadataMgr.updateMetadata(md);
setButton(false); setButton(false);
}); });
@ -86,6 +87,7 @@ define([
$button.remove(); $button.remove();
var md = Util.clone(metadataMgr.getMetadata()); var md = Util.clone(metadataMgr.getMetadata());
md.enableColors = false; md.enableColors = false;
common.setAttribute(['code', 'enableColors'], false);
metadataMgr.updateMetadata(md); metadataMgr.updateMetadata(md);
setButton(true); setButton(true);
}); });

Loading…
Cancel
Save