details: https://code.openbravo.com/erp/devel/pi/rev/11ee89985b04 changeset: 30068:11ee89985b04 user: Naroa Iriarte <naroa.iriarte <at> openbravo.com> date: Wed Sep 14 16:23:43 2016 +0200 summary: Related with issue 33799: The OB.PropertyStore.get method is now invoked once
Before, there were two invocations to the OB.PropertyStore.get method, now, a new variable has been created which contains the value obtained from the OB.PropertyStore.get method and now that variable is used instead of invoking twice the method. diffstat: modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diffs (25 lines): diff -r 2baddd2da048 -r 11ee89985b04 modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js --- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js Wed Sep 14 12:39:16 2016 +0000 +++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js Wed Sep 14 16:23:43 2016 +0200 @@ -197,7 +197,7 @@ initWidget: function (properties) { var length, rightMemberButtons = [], leftMemberButtons = [], - i, actionButton; + i, actionButton, preferenceValue; if (this.isRootView) { this.buildStructure(); @@ -230,9 +230,10 @@ // to the form, so they will be retrieved when getContextInfo() is called for the form if (this.sessionAttributesNames) { this.preferenceValues = {}; + preferenceValue = OB.PropertyStore.get(this.sessionAttributesNames[i], this.standardWindow.windowId); for (i = 0; i < this.sessionAttributesNames.length; i++) { - if (OB.PropertyStore.get(this.sessionAttributesNames[i], this.standardWindow.windowId) !== null) { - this.preferenceValues[this.sessionAttributesNames[i]] = OB.PropertyStore.get(this.sessionAttributesNames[i], this.standardWindow.windowId); + if (preferenceValue !== null) { + this.preferenceValues[this.sessionAttributesNames[i]] = preferenceValue; } } } ------------------------------------------------------------------------------ _______________________________________________ Openbravo-commits mailing list Openbravo-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openbravo-commits