Skip to content

Commit

Permalink
Fix breakage up to Firefox 28 with autocomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonBarnabe committed Feb 4, 2014
1 parent 6159874 commit b51e30b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions content/edit.js
Expand Up @@ -164,9 +164,13 @@ function init2() {
wrapLinesE.checked = wrapLines;
wrapLinesE.style.display = "";
}
if (sourceEditorType == "sourceeditor" && autocompleter != null) {
sourceEditor.extend(autocompleter);
sourceEditor.setupAutoCompletion(null);
if (sourceEditorType == "sourceeditor") {
// Up to Firefox 28, sometimes "require" will return an object when something is not available instead of throwing.
// Rather than trying to detect if autocompleter is available, let's just try to use it.
try {
sourceEditor.extend(autocompleter);
sourceEditor.setupAutoCompletion(null);
} catch (ex) { }
}

initStyle();
Expand Down

0 comments on commit b51e30b

Please sign in to comment.