details:   https://code.openbravo.com/erp/devel/pi/rev/4ffce30f906f
changeset: 17801:4ffce30f906f
user:      Martin Taal <martin.taal <at> openbravo.com>
date:      Wed Aug 29 13:32:34 2012 +0200
summary:   Fixes issue 21454: Click in an empty child results in an 
inconsistent toolbar behavior
Force update of the toolbar when creating a view and also when setting it as 
the active view

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 |  3 ++-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
    |  4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r d500176d7771 -r 4ffce30f906f 
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 Aug 29 13:05:11 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
 Wed Aug 29 13:32:34 2012 +0200
@@ -236,7 +236,7 @@
 
     this.Super('initWidget', arguments);
 
-    this.toolBar.updateButtonState(true);
+    this.toolBar.updateButtonState(true, false, true);
   },
 
   show: function () {
@@ -770,6 +770,7 @@
       if (this.isShowingForm && !this.viewForm.isNew) {
         this.setTargetRecordInWindow(this.viewGrid.getSelectedRecord().id);
       }
+      this.toolBar.updateButtonState(true, false, true);
     } else {
 
       // close any editors we may have
diff -r d500176d7771 -r 4ffce30f906f 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
    Wed Aug 29 13:05:11 2012 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-toolbar.js
    Wed Aug 29 13:32:34 2012 +0200
@@ -620,10 +620,10 @@
   // 
   // NOTE: new buttons should implement the updateState method.
   //
-  updateButtonState: function (noSetSession, changeEvent) {
+  updateButtonState: function (noSetSession, changeEvent, forceUpdate) {
     var me = this,
         isActiveTab = false;
-    if (this.view && this.view.isActiveView && this.view.isActiveView()) {
+    if (forceUpdate || (this.view && this.view.isActiveView && 
this.view.isActiveView())) {
       this.fireOnPause('updateButtonState', function () {
         me.pausedUpdateButtonState(noSetSession, changeEvent);
       });

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to