details: https://code.openbravo.com/erp/devel/pi/rev/20934ef12e27
changeset: 19667:20934ef12e27
user: Augusto Mauch <augusto.mauch <at> openbravo.com>
date: Wed Feb 13 16:55:42 2013 +0100
summary: Fixes issue 23052: New windows opened from param windows open in
next position
When from the result of executing a process in a parameter window a new window
is opened, this new window should be placed at the right side of the parameter w
indow.
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-action-def.js
| 16 +++++-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
| 22 +++++++++-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js
| 2 +-
3 files changed, 33 insertions(+), 7 deletions(-)
diffs (86 lines):
diff -r 616685f33ea2 -r 20934ef12e27
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-action-def.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-action-def.js
Wed Feb 13 14:44:20 2013 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities-action-def.js
Wed Feb 13 16:55:42 2013 +0100
@@ -73,13 +73,21 @@
// * {{{command}}}: The command with which the view to be opened
// * {{{wait}}}: If true, the thread in which this action was called (if there
is any) will be paused until the view be opened.
OB.Utilities.Action.set('openDirectTab', function (paramObj) {
+ var processIndex;
+ if (!paramObj.newTabPosition) {
+ processIndex =
OB.Utilities.getProcessTabBarPosition(paramObj._processView);
+ if (processIndex === -1) {
+ // If the process is not found in the main tab bar, add the new window
in the last position
+ paramObj.newTabPosition =
OB.MainView.TabSet.paneContainer.members.length;
+ } else {
+ // If the process is foudn in the main tab bar, add the new window in
its next position
+ paramObj.newTabPosition = processIndex + 1;
+ }
+ }
if (!paramObj.isOpening) {
- OB.Utilities.openDirectTab(paramObj.tabId, paramObj.recordId,
paramObj.command);
+ OB.Utilities.openDirectTab(paramObj.tabId, paramObj.recordId,
paramObj.command, paramObj.newTabPosition);
}
if ((paramObj.wait === true || paramObj.wait === 'true') &&
paramObj.threadId) {
- if (!paramObj.newTabPosition) {
- paramObj.newTabPosition =
OB.MainView.TabSet.paneContainer.members.length;
- }
if (!OB.MainView.TabSet.getTabObject(paramObj.newTabPosition) ||
OB.MainView.TabSet.getTabObject(paramObj.newTabPosition).pane.isLoadingTab ===
true) {
OB.Utilities.Action.pauseThread(paramObj.threadId);
paramObj.isOpening = true;
diff -r 616685f33ea2 -r 20934ef12e27
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
Wed Feb 13 14:44:20 2013 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
Wed Feb 13 16:55:42 2013 +0100
@@ -339,7 +339,7 @@
// Open a view using a tab id and record id. The tab can be a child tab. If
the record id
// is not set then the tab is opened in grid mode. If command is not set then
default is
// used.
-OB.Utilities.openDirectTab = function (tabId, recordId, command) {
+OB.Utilities.openDirectTab = function (tabId, recordId, command, position) {
tabId = OB.Utilities.removeFragment(tabId);
recordId = OB.Utilities.removeFragment(recordId);
@@ -356,7 +356,8 @@
tabTitle: data.tabTitle,
windowId: data.windowId,
tabId: data.tabId,
- command: command
+ command: command,
+ tabPosition: position
};
// new is only supported for the top tab
if (command !== 'NEW') {
@@ -1152,4 +1153,21 @@
obcolor += a;
return obcolor;
+};
+
+//** {{{ OB.Utilities.getProcessTabBarPosition }}} **
+//
+// Returns the position of a process window in the main tab bar
+// Parameters:
+// * {{{processView}}} The process view
+OB.Utilities.getProcessTabBarPosition = function (processView) {
+ var len = OB.MainView.TabSet.paneContainer.members.length,
+ i;
+ for (i = 0; i < len; i++) {
+ if (processView.ID === OB.MainView.TabSet.paneContainer.members[i].ID) {
+ return i;
+ }
+ }
+ return -1;
+
};
\ No newline at end of file
diff -r 616685f33ea2 -r 20934ef12e27
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js
Wed Feb 13 14:44:20 2013 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-view-manager.js
Wed Feb 13 16:55:42 2013 +0100
@@ -182,7 +182,7 @@
}
// Adding to the MainView tabSet
- OB.MainView.TabSet.addTab(tabDef);
+ OB.MainView.TabSet.addTab(tabDef, params.tabPosition);
if (params.i18nTabTitle) {
tabTitle = '';
------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits