details: https://code.openbravo.com/erp/devel/pi/rev/c51ad47f9b16
changeset: 14113:c51ad47f9b16
user: Martin Taal <martin.taal <at> openbravo.com>
date: Wed Oct 26 18:29:31 2011 +0200
summary: Fixes issue 18760: [Processes & Pickers] Move focus back to header
after having completed a process
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
| 22 +++++++++-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
| 3 +-
web/js/utils.js
| 11 ++++-
3 files changed, 33 insertions(+), 3 deletions(-)
diffs (83 lines):
diff -r d39d2395f4a5 -r c51ad47f9b16
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
Wed Oct 26 17:32:29 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/classic/ob-classic-compatibility.js
Wed Oct 26 18:29:31 2011 +0200
@@ -337,6 +337,8 @@
// * {{{theOpener}}} type: Window Object - the window object of the
opener
// * {{{postParams}}} type: Object - parameters to be sent to the url
using POST instead of GET
// of the popup. Used in window.open to allow IE know which is the opener
+ //
+ // returns the created OBClassicPopupWindow
open: function(name, width, height, url, title, theOpener,
showMinimizeControl, showMaximizeControl, showCloseControl, postParams){
if (showMinimizeControl !== false) {
showMinimizeControl = true;
@@ -368,6 +370,7 @@
cPopup.show();
cobcomp.Popup.postOpen(cPopup, postParams);
OB.Utilities.registerClassicPopupInTestRegistry(url, cPopup);
+ return cPopup;
},
// ** {{{ Popup.postOpen(cPopup, postParams) }}} **
@@ -443,9 +446,26 @@
//
// Parameters:
// * {{{name}}} type: String - the name of the window
- close: function(name){
+ close: function(name, cancelEvent){
+ var activateView;
+
name = name + '_' + cobcomp.Popup.secString;
+ activateView = window[name].activeViewWhenClosed;
window[name].closeClick();
+
+ if (!cancelEvent && activateView) {
+ activateView.setAsActiveView();
+ }
+ },
+
+ // ** {{{ Popup.getPopup(name) }}} **
+ //
+ // Get the popup instance.
+ //
+ // Parameters:
+ // * {{{name}}} type: String - the name of the window
+ getPopup: function(name) {
+ return window[name + '_' + cobcomp.Popup.secString];
},
// ** {{{ Popup.close(name, width, height) }}} **
diff -r d39d2395f4a5 -r c51ad47f9b16
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
Wed Oct 26 17:32:29 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/toolbar/ob-action-button.js
Wed Oct 26 18:29:31 2011 +0200
@@ -78,7 +78,8 @@
if (this.modal){
allProperties.Command = this.command;
callbackFunction = function(){
- OB.Layout.ClassicOBCompatibility.Popup.open('process', 900, 600,
OB.Utilities.applicationUrl(me.obManualURL), '', null, false, false, true,
allProperties);
+ var popup = OB.Layout.ClassicOBCompatibility.Popup.open('process',
900, 600, OB.Utilities.applicationUrl(me.obManualURL), '', null, false, false,
true, allProperties);
+ popup.activeViewWhenClosed = theView;
};
} else {
var popupParams = {
diff -r d39d2395f4a5 -r c51ad47f9b16 web/js/utils.js
--- a/web/js/utils.js Wed Oct 26 17:32:29 2011 +0200
+++ b/web/js/utils.js Wed Oct 26 18:29:31 2011 +0200
@@ -5394,8 +5394,17 @@
}
function closePage() {
+ var cancelEvent, element;
if (isWindowInMDIPopup) {
-
getFrame('LayoutMDI').OB.Layout.ClassicOBCompatibility.Popup.close(MDIPopupId);
+ element = window.event.target;
+ while (element) {
+ if (element.id === 'buttonCancel') {
+ cancelEvent = true;
+ break;
+ }
+ element = element.parentElement;
+ }
+
getFrame('LayoutMDI').OB.Layout.ClassicOBCompatibility.Popup.close(MDIPopupId,
cancelEvent);
} else if (isWindowInMDITab) {
} else {
top.window.close();
------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn
about Cisco certifications, training, and career opportunities.
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits