From 748a09c3be60233c1550462a08afaf626697b07a Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 10 Oct 2012 17:43:03 +0800 Subject: [PATCH] IDEMPIERE-369 Master Detail layout improvements. More correct patch for jquery issue under firefox. Now works fine under firefox and chrome. --- org.adempiere.ui.zk/WEB-INF/zk.xml | 13 ++++++------ org.adempiere.ui.zk/js/jquery-patch.js | 28 +++++++++++++++++--------- 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/zk.xml b/org.adempiere.ui.zk/WEB-INF/zk.xml index 877f0ddeb7..c843b75ae6 100644 --- a/org.adempiere.ui.zk/WEB-INF/zk.xml +++ b/org.adempiere.ui.zk/WEB-INF/zk.xml @@ -12,7 +12,7 @@ - + @@ -23,9 +23,9 @@ - + - true + false 500 @@ -46,9 +46,10 @@ --> - + + ajax - fi.jawsy.jawwa.zk.atmosphere.AtmosphereServerPush + true diff --git a/org.adempiere.ui.zk/js/jquery-patch.js b/org.adempiere.ui.zk/js/jquery-patch.js index 7699aeda63..cc7fda845f 100644 --- a/org.adempiere.ui.zk/js/jquery-patch.js +++ b/org.adempiere.ui.zk/js/jquery-patch.js @@ -2,24 +2,34 @@ (function(undefined) { var rupper = /([A-Z]|^ms)/g; if ( document.defaultView && document.defaultView.getComputedStyle ) { + var old = document.defaultView.getComputedStyle; getComputedStyle = function( elem, name ) { var ret, defaultView, computedStyle; - //added try catch for firefox - try { - name = name.replace( rupper, "-$1" ).toLowerCase(); - - if ( !(defaultView = elem.ownerDocument.defaultView) ) { - return undefined; - } + if ( !(defaultView = elem.ownerDocument.defaultView) ) { + return undefined; + } - if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) { + if (name == undefined || name == null) { + try { + return old(elem, null); + } catch (err) { + return ""; + } + } + + name = name.replace( rupper, "-$1" ).toLowerCase(); + + try { + if ( (computedStyle = old( elem, null )) ) { ret = computedStyle.getPropertyValue( name ); if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { ret = jQuery.style( elem, name ); } } - } catch (err) {} + } catch (err) { + return ""; + } return ret; };