From 273887a8f6cd37cbf07110c075994a940e6ca8d4 Mon Sep 17 00:00:00 2001 From: Heng Sin Low Date: Wed, 10 Oct 2012 17:08:50 +0800 Subject: [PATCH] IDEMPIERE-369 Master Detail layout improvements. Improve Firefox compatibility. Still some layout issue but at least it run now. --- .../WEB-INF/src/metainfo/zk/lang-addon.xml | 1 + org.adempiere.ui.zk/WEB-INF/zk.xml | 2 +- org.adempiere.ui.zk/js/jquery-patch.js | 27 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 org.adempiere.ui.zk/js/jquery-patch.js diff --git a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml index 3219dbe872..0ccedf0dbc 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml +++ b/org.adempiere.ui.zk/WEB-INF/src/metainfo/zk/lang-addon.xml @@ -38,6 +38,7 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI). + diff --git a/org.adempiere.ui.zk/WEB-INF/zk.xml b/org.adempiere.ui.zk/WEB-INF/zk.xml index be0e3bf04f..877f0ddeb7 100644 --- a/org.adempiere.ui.zk/WEB-INF/zk.xml +++ b/org.adempiere.ui.zk/WEB-INF/zk.xml @@ -25,7 +25,7 @@ - false + true 500 diff --git a/org.adempiere.ui.zk/js/jquery-patch.js b/org.adempiere.ui.zk/js/jquery-patch.js new file mode 100644 index 0000000000..7699aeda63 --- /dev/null +++ b/org.adempiere.ui.zk/js/jquery-patch.js @@ -0,0 +1,27 @@ +//patch for jquery bug under firefox +(function(undefined) { +var rupper = /([A-Z]|^ms)/g; +if ( document.defaultView && 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 ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) { + ret = computedStyle.getPropertyValue( name ); + if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) { + ret = jQuery.style( elem, name ); + } + } + } catch (err) {} + + return ret; + }; +} +})(); \ No newline at end of file