Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Clear or set JS Hints based on codeAssist
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
mattpass committed Dec 13, 2012
1 parent 8d0de39 commit 01b035d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/ice-coder.js
Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit 01b035d

Please sign in to comment.