Clear or set JS Hints based on codeAssist

On toggle of codeAssist and being false, clear all JS Hint widgets in
all tabs
If turned on though, set in current tab
Run updateHints on switching tab (helps complete above step)
This commit is contained in:
Matt Pass
2012-12-13 08:56:53 +00:00
parent 8d0de398fd
commit 01b035d7af

View File

@@ -1211,6 +1211,21 @@ var ICEcoder = {
top.ICEcoder.codeAssist = !top.ICEcoder.codeAssist;
top.ICEcoder.cssColorPreview();
cM.focus();
if (!top.ICEcoder.codeAssist) {
for (i=0;i<top.ICEcoder.cMInstances.length;i++) {
cM = top.ICEcoder.content.contentWindow['cM'+top.ICEcoder.cMInstances[i]];
cM.operation(function(){
var widgets = top.ICEcoder['cM'+top.ICEcoder.cMInstances[i]+'widgets'];
for (var j=0; j<widgets.length; ++j) {
cM.removeLineWidget(widgets[j]);
}
widgets.length = 0;
});
}
} else {
top.ICEcoder.updateHints();
}
},
// Queue items up for processing in turn
@@ -1500,6 +1515,9 @@ var ICEcoder = {
top.ICEcoder.findMode = false;
ICEcoder.findReplace('find',true,false);
// Rerun JS Hint
if (top.ICEcoder.codeAssist) {top.ICEcoder.updateHints()};
// Finally, update the cursor display
top.ICEcoder.getCaretPosition();
top.ICEcoder.updateCharDisplay();