Skip to content

Commit c16853f

Browse files
committed
Merge pull request #13 from caseman72/master
Adding an extra check for abbreviations allows for tabbing out of tinyMCE
2 parents 593bb1a + bc53e4e commit c16853f

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

common/content/editor.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -310,11 +310,11 @@ const Editor = Module("editor", {
310310
nsEditor instanceof Ci.nsIHTMLEditor;
311311
}
312312
else {
313-
if (field !== undefined) {
314-
textBox = field; // if I reply 'yes', textBox.value == 'yes', so get the real value
315-
} else {
316-
textBox = liberator.focus;
317-
}
313+
if (field !== undefined) {
314+
textBox = field; // if I reply 'yes', textBox.value == 'yes', so get the real value
315+
} else {
316+
textBox = liberator.focus;
317+
}
318318
}
319319

320320
if (!forceEditing && textBox && textBox.type == "password") {
@@ -446,6 +446,9 @@ const Editor = Module("editor", {
446446
if (!textbox)
447447
return false;
448448
let text = textbox.value;
449+
if (typeof text !== "string")
450+
return false;
451+
449452
let currStart = textbox.selectionStart;
450453
let currEnd = textbox.selectionEnd;
451454
let foundWord = text.substring(0, currStart).replace(/.*[\s\n]/gm, '').match(RegExp('(' + abbreviations._match + ')$'));

0 commit comments

Comments
 (0)