[open-ils-commits] r18287 - trunk/Open-ILS/xul/staff_client/chrome/content/util (phasefx)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Oct 12 15:34:44 EDT 2010


Author: phasefx
Date: 2010-10-12 15:34:39 -0400 (Tue, 12 Oct 2010)
New Revision: 18287

Modified:
   trunk/Open-ILS/xul/staff_client/chrome/content/util/deck.js
Log:
allow util.deck to be instantiated with either a xul deck object or a xul deck id

Modified: trunk/Open-ILS/xul/staff_client/chrome/content/util/deck.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/chrome/content/util/deck.js	2010-10-12 19:34:35 UTC (rev 18286)
+++ trunk/Open-ILS/xul/staff_client/chrome/content/util/deck.js	2010-10-12 19:34:39 UTC (rev 18287)
@@ -1,19 +1,19 @@
 dump('entering util/deck.js\n');
 
 if (typeof util == 'undefined') util = {};
-util.deck = function (id) {
+util.deck = function (id_or_node) {
 
-    this.node = document.getElementById(id);
+    this.node = typeof id_or_node == 'object' ? id_or_node : document.getElementById(id_or_node);
 
     JSAN.use('util.error'); this.error = new util.error();
 
     if (!this.node) {
-        var error = 'util.deck: Could not find element ' + id;
+        var error = 'util.deck: Could not find element ' + id_or_node;
         this.error.sdump('D_ERROR',error);
         throw(error);
     }
     if (this.node.nodeName != 'deck') {
-        var error = 'util.deck: ' + id + 'is not a deck' + "\nIt's a " + this.node.nodeName;
+        var error = 'util.deck: ' + id_or_node + 'is not a deck' + "\nIt's a " + this.node.nodeName;
         this.error.sdump('D_ERROR',error);
         throw(error);
     }



More information about the open-ils-commits mailing list