1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-23 16:02:26 +01:00

Dispatch input event after external editing.

This commit is contained in:
Kris Maglione
2011-07-21 23:03:04 -04:00
parent 9667a0d19a
commit 307ca9a621
3 changed files with 16 additions and 8 deletions

View File

@@ -1,3 +1,4 @@
// Copyright (c) 2008-2011 Kris Maglione <maglione.k at Gmail>
// Copyright (c) 2006-2009 by Martin Stubenschrott <stubenschrott@vimperator.org>
//
// This work is licensed for reuse under an MIT license. Details are
@@ -303,8 +304,14 @@ var Editor = Module("editor", {
lastUpdate = Date.now();
let val = tmpfile.read();
if (textBox)
if (textBox) {
textBox.value = val;
textBox.setAttributeNS(NS, "modifiable", true);
util.computedStyle(textBox).MozUserInput;
events.dispatch(textBox, events.create(textBox.ownerDocument, "input", {}));
textBox.removeAttributeNS(NS, "modifiable");
}
else {
while (editor_.rootElement.firstChild)
editor_.rootElement.removeChild(editor_.rootElement.firstChild);