From d8f976150a155d588b1a7b825de98cf8ee6aabc2 Mon Sep 17 00:00:00 2001 From: bryndivey Date: Fri, 28 Jul 2006 11:56:41 +0000 Subject: [PATCH] Fixed the permissions screen --- resources/js/jsonlookup.js | 37 ++++++++++++++++++++++--------------- resources/js/permissions.js | 2 +- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/resources/js/jsonlookup.js b/resources/js/jsonlookup.js index 748d446..567147e 100644 --- a/resources/js/jsonlookup.js +++ b/resources/js/jsonlookup.js @@ -44,7 +44,7 @@ JSONLookupWidget.prototype = { this.triggers['add'] = null; this.triggers['remove'] = null; - this.initialValuesLoaded = false + this.initialValuesLoaded = false; this.getValues(); }, @@ -74,7 +74,7 @@ JSONLookupWidget.prototype = { 'errGetValues' : function(res) { alert('There was an error retrieving data. Please check connectivity and try again.'); - this.oValues = {'off':'-- Error fetching values --'} + this.oValues = {'off':'-- Error fetching values --'}; this.renderValues(); }, @@ -94,7 +94,7 @@ JSONLookupWidget.prototype = { } } - if(found) continue; + if(found) { continue; } var aParam = {'value':k}; @@ -103,22 +103,21 @@ JSONLookupWidget.prototype = { } var val = this.oValues[k]; + var sDisp = val; if(!isUndefinedOrNull(val['display'])) { var sDisp = val['display']; - if(!isUndefinedOrNull(val['selected']) && val['selected'] == true) { + if(!isUndefinedOrNull(val['selected']) && val['selected'] === true) { val['selected'] = undefined; - aParam['selected'] = 'selected'; + aParam['selected'] = true; bSelFound = true; } - } else { - var sDisp = val; } var oO = OPTION(aParam, sDisp); aOptions.push(oO); } replaceChildNodes(this.oSelectAvail, aOptions); - if(bSelFound) this.onclickAdd(); + if(bSelFound) { this.onclickAdd(); } }, 'modItems' : function(type, value) { @@ -128,7 +127,8 @@ JSONLookupWidget.prototype = { // check against other - if other has value, remove it from other, skip next bit var aNewOther = []; var exists = false; - for(var i=0; i