details:   /erp/devel/pi/rev/9a277c7cbcfb
changeset: 6504:9a277c7cbcfb
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Fri Feb 26 01:06:55 2010 +0100
summary:   Related to issue 12479: Now utils.js has relative references -part1

diffstat:

 web/js/utils.js |  29 +++++++----------------------
 1 files changed, 7 insertions(+), 22 deletions(-)

diffs (71 lines):

diff -r 41394a20bc95 -r 9a277c7cbcfb web/js/utils.js
--- a/web/js/utils.js   Fri Feb 26 01:02:11 2010 +0100
+++ b/web/js/utils.js   Fri Feb 26 01:06:55 2010 +0100
@@ -415,15 +415,7 @@
  * @return true if autosave is enable, otherwise false
  */
 function isAutosaveEnabled() {
-  var autosave;
-  if(frames.name.indexOf('appFrame') === -1 && 
frames.name.indexOf('frameMenu') === -1) {
-    if(top.opener !== null) { // is a pop-up window
-      autosave = top.opener.top.frameMenu.autosave;
-    }
-  }
-  else {
-    autosave = top.frameMenu.autosave;
-  }
+  var autosave = getFrame('frameMenu').autosave;
   return autosave;
 }
 
@@ -505,14 +497,7 @@
        var form = f;
        
        if (form === null) {
-               if(frames.name.indexOf('appFrame') === -1 && 
frames.name.indexOf('frameMenu') === -1) {
-                       if(top.opener !== null) { // is a pop-up window
-                               form = 
top.opener.top.appFrame.document.forms[0];
-                       }
-               }
-               else {
-                       form = top.appFrame.document.forms[0];                  
-               }
+               form = getFrame('appFrame').document.forms[0];
        }
        
        if(typeof form === 'undefined') {
@@ -532,12 +517,12 @@
                return true;
        }
        else {
-               if(typeof top.appFrame === 'undefined'){
+               if(typeof parent.appFrame === 'undefined'){
                        return true;
                }
 
                try {
-                 var promptConfirmation = typeof top.appFrame.confirmOnChanges 
=== 'undefined' ? true : top.appFrame.confirmOnChanges;
+                 var promptConfirmation = typeof 
parent.appFrame.confirmOnChanges === 'undefined' ? true : 
parent.appFrame.confirmOnChanges;
                } catch(e) {
                  if(isDebugEnabled()) {
             console.error("%o", e);
@@ -545,7 +530,7 @@
                }
 
                try {
-                 var hasUserChanges = typeof top.appFrame.isUserChanges === 
'undefined' ? false : top.appFrame.isUserChanges;
+                 var hasUserChanges = typeof parent.appFrame.isUserChanges === 
'undefined' ? false : parent.appFrame.isUserChanges;
                } catch(e) {
                  if(isDebugEnabled()) {
             console.error("%o", e);
@@ -560,8 +545,8 @@
                        var autoSaveFlag = autosave;            
                        if (promptConfirmation && hasUserChanges) {
                                autoSaveFlag = showJSMessage(25);
-                               if(typeof top.appFrame.confirmOnChanges !== 
'undefined' && autoSaveFlag) {
-                                       top.appFrame.confirmOnChanges = false;
+                               if(typeof parent.appFrame.confirmOnChanges !== 
'undefined' && autoSaveFlag) {
+                                       parent.appFrame.confirmOnChanges = 
false;
                                }
                        }
                        if (autoSaveFlag) {

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to