Author: adityasharma
Date: Wed Jan 16 11:49:11 2019
New Revision: 1851433

URL: http://svn.apache.org/viewvc?rev=1851433&view=rev
Log:
Improved: Replace Inline js with External js in renderFieldGroupOpen macro
(OFBIZ-9853)

Modified:
    ofbiz/ofbiz-framework/trunk/themes/bluelight/webapp/bluelight/style.css
    
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
    
ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js
    ofbiz/ofbiz-framework/trunk/themes/flatgrey/webapp/flatgrey/style.css
    
ofbiz/ofbiz-framework/trunk/themes/rainbowstone/webapp/rainbowstone/style.css
    ofbiz/ofbiz-framework/trunk/themes/tomahawk/webapp/tomahawk/css/style.css

Modified: 
ofbiz/ofbiz-framework/trunk/themes/bluelight/webapp/bluelight/style.css
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/bluelight/webapp/bluelight/style.css?rev=1851433&r1=1851432&r2=1851433&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/bluelight/webapp/bluelight/style.css 
(original)
+++ ofbiz/ofbiz-framework/trunk/themes/bluelight/webapp/bluelight/style.css Wed 
Jan 16 11:49:11 2019
@@ -1286,8 +1286,8 @@ ul#preferences-menu li a.help-link {
     text-decoration: none;
 }
 
-.screenlet-title-bar ul .collapsed a,
-.screenlet-title-bar ul .expanded a {
+.screenlet-title-bar ul .collapsed,
+.screenlet-title-bar ul .expanded{
     /* IE fix */
     cursor: default;
 }
@@ -1942,17 +1942,14 @@ render borders around empty <td> element
 
 .fieldgroup-title-bar ul .collapsed, .fieldgroup-title-bar ul .collapsed:hover 
{
     background: url(/bluelight/images/bullet_toggle_plus.png) no-repeat left 
center;
+    cursor: pointer;
+    padding-left: 10px;
 }
 
 .fieldgroup-title-bar ul .expanded, .fieldgroup-title-bar ul .expanded:hover {
     background: url(/bluelight/images/bullet_toggle_minus.png) no-repeat left 
center;
-}
-
-.fieldgroup-title-bar a {
     cursor: pointer;
-    text-decoration: none;
     padding-left: 10px;
-    color: #000000;
 }
 
 /* == Portlet configuration screenlet == */

Modified: 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl?rev=1851433&r1=1851432&r2=1851433&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/themes/common-theme/template/macro/HtmlFormMacroLibrary.ftl
 Wed Jan 16 11:49:11 2019
@@ -649,11 +649,8 @@ Parameter: delegatorName, String, option
     <div class="fieldgroup-title-bar">
       <#if collapsible>
         <ul>
-          <li class="<#if collapsed>collapsed">
-                      <a onclick="javascript:toggleCollapsiblePanel(this, 
'${collapsibleAreaId}', '${expandToolTip}', '${collapseToolTip}');">
-                    <#else>expanded">
-                      <a onclick="javascript:toggleCollapsiblePanel(this, 
'${collapsibleAreaId}', '${expandToolTip}', '${collapseToolTip}');">
-                    </#if>
+          <li data-collapsible-area-id="${collapsibleAreaId}" 
data-expand-tooltip="${expandToolTip}" 
data-collapse-tooltip="${collapseToolTip}"
+                  class="<#if collapsed>collapsed"><#else>expanded"></#if>
             &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<#if 
title?has_content>${title}</#if></a>
           </li>
         </ul>

Modified: 
ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js?rev=1851433&r1=1851432&r2=1851433&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js
 (original)
+++ 
ofbiz/ofbiz-framework/trunk/themes/common-theme/webapp/common/js/util/OfbizUtil.js
 Wed Jan 16 11:49:11 2019
@@ -325,6 +325,13 @@ function bindObservers(bind_element) {
             })
         }
     });
+    jQuery(bind_element).on("click", ".fieldgroup  li.collapsed, .fieldgroup  
li.expanded", function(e){
+        var element = jQuery(this);
+        var collapsibleAreaId =  element.data("collapsible-area-id");
+        var expandToolTip =  element.data("expand-tooltip");
+        var collapseToolTip =  element.data("collapse-tooltip");
+        toggleCollapsiblePanel(element, collapsibleAreaId, expandToolTip, 
collapseToolTip);
+    });
 }
 
 /* SelectAll: This utility can be used when we need to use parent and child 
box combination over any page. Here is the list of tasks it will do:
@@ -879,7 +886,7 @@ function ajaxAutoCompleteDropDown() {
 */
 function toggleCollapsiblePanel(link, areaId, expandTxt, collapseTxt){
    var container = jQuery("#" + areaId);
-   var liElement = jQuery(link).parents('li:first');
+   var liElement = jQuery(link).is("li") ? jQuery(link) : 
jQuery(link).parents('li:first');
     if (liElement) {
       if (container.is(':visible')) {
         liElement.removeClass('expanded');
@@ -1096,7 +1103,7 @@ function expandAll(bool) {
     jQuery('.fieldgroup').each(function() {
         var titleBar = jQuery(this).children('.fieldgroup-title-bar'), body = 
jQuery(this).children('.fieldgroup-body');
         if (titleBar.children().length > 0 && body.is(':visible') != bool) {
-            toggleCollapsiblePanel(titleBar.find('a'), body.attr('id'), 
'expand', 'collapse');
+            toggleCollapsiblePanel(titleBar.find('li.collapsed, li.expanded'), 
body.attr('id'), 'expand', 'collapse');
         }
     });
 }

Modified: ofbiz/ofbiz-framework/trunk/themes/flatgrey/webapp/flatgrey/style.css
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/flatgrey/webapp/flatgrey/style.css?rev=1851433&r1=1851432&r2=1851433&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/flatgrey/webapp/flatgrey/style.css 
(original)
+++ ofbiz/ofbiz-framework/trunk/themes/flatgrey/webapp/flatgrey/style.css Wed 
Jan 16 11:49:11 2019
@@ -1262,6 +1262,8 @@ form .basic-table,
     background: url(/images/expand.gif) no-repeat left center;
     min-height: 1.1em;
     min-width: 1.1em;
+    cursor: pointer;
+    padding-left: 10px;
 }
 
 .fieldgroup-title-bar ul .expanded,
@@ -1269,13 +1271,8 @@ form .basic-table,
     background: url(/images/collapse.gif) no-repeat left center;
     min-height: 1.1em;
     min-width: 1.1em;
-}
-
-.fieldgroup-title-bar a {
     cursor: pointer;
-    text-decoration: none;
-    padding-left: 10px; /* Setting must be in px */
-    color: #000000;
+    padding-left: 10px;
 }
 
 /* ----------------------------------------- */

Modified: 
ofbiz/ofbiz-framework/trunk/themes/rainbowstone/webapp/rainbowstone/style.css
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/rainbowstone/webapp/rainbowstone/style.css?rev=1851433&r1=1851432&r2=1851433&view=diff
==============================================================================
--- 
ofbiz/ofbiz-framework/trunk/themes/rainbowstone/webapp/rainbowstone/style.css 
(original)
+++ 
ofbiz/ofbiz-framework/trunk/themes/rainbowstone/webapp/rainbowstone/style.css 
Wed Jan 16 11:49:11 2019
@@ -910,6 +910,8 @@ text-decoration: underline;
     background: url(/images/expand.gif) no-repeat left center;
     min-height: 1.1em;
     min-width: 1.1em;
+    cursor: pointer;
+    padding-left: 10px;
 }
 
 .fieldgroup-title-bar ul .expanded,
@@ -917,13 +919,8 @@ text-decoration: underline;
     background: url(/images/collapse.gif) no-repeat left center;
     min-height: 1.1em;
     min-width: 1.1em;
-}
-
-.fieldgroup-title-bar a {
     cursor: pointer;
-    text-decoration: none;
-    padding-left: 10px; /* Setting must be in px */
-    color: #000000;
+    padding-left: 10px;
 }
 
 /* ----------------------------------------- */

Modified: 
ofbiz/ofbiz-framework/trunk/themes/tomahawk/webapp/tomahawk/css/style.css
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/themes/tomahawk/webapp/tomahawk/css/style.css?rev=1851433&r1=1851432&r2=1851433&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/themes/tomahawk/webapp/tomahawk/css/style.css 
(original)
+++ ofbiz/ofbiz-framework/trunk/themes/tomahawk/webapp/tomahawk/css/style.css 
Wed Jan 16 11:49:11 2019
@@ -2232,17 +2232,14 @@ render borders around empty <td> element
 
 .fieldgroup-title-bar ul .collapsed, .fieldgroup-title-bar ul .collapsed:hover 
{
     background: url(../images/bullet_toggle_plus.png) no-repeat left center;
+    cursor: pointer;
+    padding-left: 10px;
 }
 
 .fieldgroup-title-bar ul .expanded, .fieldgroup-title-bar ul .expanded:hover {
     background: url(../images/bullet_toggle_minus.png) no-repeat left center;
-}
-
-.fieldgroup-title-bar a {
     cursor: pointer;
-    text-decoration: none;
     padding-left: 10px;
-    color: #000000;
 }
 
 /* == Portlet configuration screenlet == */


Reply via email to