From 7f1f4d4cf2b526a103bbed4f647593181fae0641 Mon Sep 17 00:00:00 2001 From: phasefx Date: Tue, 12 Oct 2010 19:34:39 +0000 Subject: [PATCH] allow util.deck to be instantiated with either a xul deck object or a xul deck id git-svn-id: svn://svn.open-ils.org/ILS/trunk@18287 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/xul/staff_client/chrome/content/util/deck.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Open-ILS/xul/staff_client/chrome/content/util/deck.js b/Open-ILS/xul/staff_client/chrome/content/util/deck.js index 8f6ff090c..6b3aaadd2 100644 --- a/Open-ILS/xul/staff_client/chrome/content/util/deck.js +++ b/Open-ILS/xul/staff_client/chrome/content/util/deck.js @@ -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); } -- 2.11.0