diff options
author | alecpl <alec@alec.pl> | 2008-10-01 08:29:58 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2008-10-01 08:29:58 +0000 |
commit | f4b8681160110659f5f78b309237de6f43c32537 (patch) | |
tree | 827c92e75f9c0c11385c1924817c136dda16d733 /program/js/common.js | |
parent | ef925ffe08cf221f1415fb8405ad4fb229172139 (diff) |
- Stop spellchecking when switching to html editor (#1485362)
Diffstat (limited to 'program/js/common.js')
-rw-r--r-- | program/js/common.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/program/js/common.js b/program/js/common.js index 5049061b4..4b877bac3 100644 --- a/program/js/common.js +++ b/program/js/common.js @@ -650,3 +650,20 @@ if (bw.ie) return o; } } + + +// Fire event on specified element +function exec_event(element,event) +{ + if (document.createEventObject) { + // dispatch for IE + var evt = document.createEventObject(); + return element.fireEvent('on'+event,evt) + } + else { + // dispatch for firefox + others + var evt = document.createEvent("HTMLEvents"); + evt.initEvent(event, true, true); // event type,bubbling,cancelable + return !element.dispatchEvent(evt); + } +} |