From: phasefx Date: Mon, 29 Dec 2008 19:52:54 +0000 (+0000) Subject: slight refactor, and image for remove button X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=1f7fd8af2a2bcb6d0c6f5391f289005f0f4e1397;p=Evergreen.git slight refactor, and image for remove button git-svn-id: svn://svn.open-ils.org/ILS/trunk@11700 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/patron/summary.js b/Open-ILS/xul/staff_client/server/patron/summary.js index d7e0426f82..153c36791b 100644 --- a/Open-ILS/xul/staff_client/server/patron/summary.js +++ b/Open-ILS/xul/staff_client/server/patron/summary.js @@ -93,20 +93,12 @@ patron.summary.prototype = { }; } ], - 'patron_standing' : [ + 'patron_standing_penalties' : [ ['render'], function(e) { return function() { - /* - e.setAttribute('value', - obj.OpenILS.data.hash.cst[ - obj.patron.standing() - ].value() - ); - */ - var e2 = document.getElementById('patron_standing_penalties'); JSAN.use('util.widgets'); - util.widgets.remove_children(e2); + util.widgets.remove_children(e); var penalties = obj.patron.standing_penalties(); for (var i = 0; i < penalties.length; i++) { @@ -119,11 +111,13 @@ patron.summary.prototype = { var button = document.createElement('button'); button.setAttribute('label', $("patronStrings").getString('staff.patron.summary.standing_penalty.remove')); + button.setAttribute('image','/xul/server/skin/media/images/icon_delete.gif'); button.setAttribute('disabled','true'); row.appendChild(button); // XXX check a permission here? How to fire the remove action ??? XXX if (penalties[i].standing_penalty().id() > 100) { + button.setAttribute('disabled','false'); } if (penalties[i].standing_penalty().block_list()) { @@ -132,8 +126,8 @@ patron.summary.prototype = { if (penalties[i].standing_penalty().block_list().match(/CIRC/)) addCSSClass(label,'PENALTY_CIRC'); } - e2.appendChild(row); - e2.parentNode.parentNode.hidden = false; + e.appendChild(row); + e.parentNode.parentNode.hidden = false; } }; }