Related to issue 16872: Open in new tab: performance improvement
authorMartin Taal <martin.taal@openbravo.com>
Wed, 04 May 2011 17:01:59 +0200
changeset 11939 211cf49219b3
parent 11938 02f4b39d20c1
child 11940 bdce76b21daf
Related to issue 16872: Open in new tab: performance improvement
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js	Wed May 04 16:49:08 2011 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-standard-view.js	Wed May 04 17:01:59 2011 +0200
@@ -714,7 +714,7 @@
         
     if (this.shouldOpenDefaultEditMode()) {
       this.openDefaultEditView();
-    } else if (this.isShowingForm) {
+    } else if (this.isShowingForm && !(this.allowDefaultEditMode && this.defaultEditMode)) {
       this.switchFormGridVisibility();
     }
     this.viewGrid.refreshContents();
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js	Wed May 04 16:49:08 2011 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/ob-view-grid.js	Wed May 04 17:01:59 2011 +0200
@@ -519,7 +519,11 @@
     
     // no data and the grid is not visible
     if (endRow === 0 && !this.isVisible()) {
-      this.show();
+      if (this.view.isShowingForm) {
+        this.view.switchFormGridVisibility();
+      } else {
+        this.show();
+      }
     }
     
     if (this.targetOpenNewEdit) {
@@ -534,7 +538,7 @@
     } else if (this.targetRecordId) {
       // direct link from other tab to a specific record
       this.delayedHandleTargetRecord(startRow, endRow);
-    } else if (this.view.shouldOpenDefaultEditMode() && !this.view.isShowingForm) {
+    } else if (this.view.shouldOpenDefaultEditMode()) {
       // ui-pattern: single record/edit mode
       this.view.openDefaultEditView(this.getRecord(startRow));
     } else if (this.data && this.data.getLength() === 1) {