details:   /erp/devel/pi/rev/ba863d26907f
changeset: 11483:ba863d26907f
user:      Iván Perdomo <ivan.perdomo <at> openbravo.com>
date:      Tue Apr 05 12:36:49 2011 +0200
summary:   Fixes issue 16619: Updates form item alwaysTakeSpace when 
collapsing/expanding
- The alwaysTakeSpace flag controls if the item will always take space even if
        is not displayed. When set to true, and you collapse a section, the 
space is
        still occupied by the item(s)

diffstat:

 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
 |  22 ++++++---
 1 files changed, 15 insertions(+), 7 deletions(-)

diffs (46 lines):

diff -r 6fd7146adf40 -r ba863d26907f 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
   Tue Apr 05 11:32:45 2011 +0200
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-formitem-widgets.js
   Tue Apr 05 12:36:49 2011 +0200
@@ -415,27 +415,35 @@
   // visual state of disabled or non-disabled stays the same now
   showDisabled: false,
   
-  initWidget: function(){
-    var ret = this.Super('initWidget', arguments);
-    return ret;
-  },
-  
   // never disable a section item
   isDisabled: function(){
     return false;
   },
+
+  // Update the property alwaysTakeSpace when collapsing/expanding a section 
+  updateAlwaysTakeSpace: function(flag) {
+    var i, f = this.form;
+
+    for(i = 0; i < this.itemIds.length; i++) {
+      f.getItem(this.itemIds[i]).alwaysTakeSpace = flag;
+    }
+  },
   
-  collapseSection: function(){
+  collapseSection: function() {
     // when collapsing set the focus to the header
+    this.updateAlwaysTakeSpace(false);
     this.form.setFocusItem(this);
     var ret = this.Super('collapseSection', arguments);
     return ret;
   },
   
-  expandSection: function(){
+  expandSection: function() {
+    this.updateAlwaysTakeSpace(true);
+
     if (this.form.getFocusItem()) {
       this.form.getFocusItem().blurItem();
     }
+
     var ret = this.Super('expandSection', arguments);
     
     if (!this.form._preventFocusChanges) {

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to