new controller works.. but still need to fix keysets
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 Dec 2005 02:46:38 +0000 (02:46 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 21 Dec 2005 02:46:38 +0000 (02:46 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@2498 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/chrome/content/evergreen/util/controller.js

index fde3612..06d9242 100644 (file)
@@ -31,11 +31,12 @@ util.controller.prototype = {
                                                        case 'render':
                                                                this.render_list.push( [i, this.control_map[i][1](cmd)] ); 
                                                        break;
-                                                       case 'on_command':
+                                                       case 'oncommand':
                                                                if (!this.window_knows_me_by) 
                                                                        throw('util.controller: on_command requires window_knows_me_by');
-                                                               var s = this.window_knows_me_by + ".cmds." + i + "()";
-                                                               cmd.setAttribute(ev_type, s);   
+                                                               var s = 'try{'+this.window_knows_me_by+".cmds."+i+"();}catch(E){alert(E);}";
+                                                               cmd.setAttribute(ev_type, s);
+                                                               this.cmds[i] = this.control_map[i][1];
                                                        break;
                                                        default: cmd.addEventListener(ev_type,this.control_map[i][1],false);
                                                }