diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-07-21 23:03:04 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-07-21 23:03:04 -0400 |
commit | 307ca9a621ef2a688e7c531d7b8457f6d41ac6cf (patch) | |
tree | 0b23771134abb212be5b4090394d81e9f2d8bfa3 /common/content/editor.js | |
parent | 9667a0d19a34dd9ba8d553009b43ef668826215a (diff) | |
download | pentadactyl-307ca9a621ef2a688e7c531d7b8457f6d41ac6cf.tar.gz |
Dispatch input event after external editing.
Diffstat (limited to 'common/content/editor.js')
-rw-r--r-- | common/content/editor.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/content/editor.js b/common/content/editor.js index 852b464a..234162c5 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -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); |