generic event dispatch
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 18 Feb 2006 10:18:33 +0000 (10:18 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Sat, 18 Feb 2006 10:18:33 +0000 (10:18 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@3115 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/util/widgets.js

index 295966c..4c96ab4 100644 (file)
@@ -14,6 +14,7 @@ util.widgets.EXPORT_OK        = [
        'apply_vertical_tab_on_enter_handler',
        'vertical_tab',
        'click',
+       'dispatch',
 ];
 util.widgets.EXPORT_TAGS       = { ':all' : util.widgets.EXPORT_OK };
 
@@ -23,6 +24,12 @@ util.widgets.click = function(e) {
        e.dispatchEvent(evt);
 }
 
+util.widgets.dispatch = function(ev,el) {
+       var evt = document.createEvent("Events");
+       evt.initEvent( ev, true, true );
+       el.dispatchEvent(evt);
+}
+
 util.widgets.make_menulist = function( items ) {
        var menulist = document.createElement('menulist');
        var menupopup = document.createElement('menupopup'); menulist.appendChild(menupopup);