You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by jl...@apache.org on 2020/05/31 06:52:16 UTC

[ofbiz-framework] 04/28: Fixed: showjGrowl called twice (OFBIZ-11720)

This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch ecomify-OFBIZ-11468_Convert_ShipmentReceiptServices-squashed
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git

commit 2621fd4ef48f2255a337f3e2dc858e7f4521f755
Author: James Yong <ja...@apache.org>
AuthorDate: Thu May 21 21:38:08 2020 +0800

    Fixed: showjGrowl called twice (OFBIZ-11720)
    
    showjGrowl function is called twice,
    even when there is no message to show.
---
 themes/common-theme/template/includes/Messages.ftl | 42 +++++++++-------------
 1 file changed, 16 insertions(+), 26 deletions(-)

diff --git a/themes/common-theme/template/includes/Messages.ftl b/themes/common-theme/template/includes/Messages.ftl
index 78f82ab..78996db 100644
--- a/themes/common-theme/template/includes/Messages.ftl
+++ b/themes/common-theme/template/includes/Messages.ftl
@@ -57,17 +57,10 @@ under the License.
       </#if>
     </div>
   </#if>
-  <#assign jGrowlPosition = modelTheme.getProperty("jgrowlPosition")>
-  <#assign jGrowlWidth = modelTheme.getProperty("jgrowlWidth")>
-  <#assign jGrowlHeight = modelTheme.getProperty("jgrowlHeight")>
-  <#assign jGrowlSpeed = modelTheme.getProperty("jgrowlSpeed")>
 
-  <script>showjGrowl(
-          "${uiLabelMap.CommonShowAll}", "${uiLabelMap.CommonCollapse}", "${uiLabelMap.CommonHideAllNotifications}",
-          "${jGrowlPosition}", "${jGrowlWidth}", "${jGrowlHeight}", "${jGrowlSpeed}");</script>
   <#-- display the event messages -->
   <#if (eventMessage?has_content || eventMessageList?has_content)>
-  <div id="content-messages" class="content-messages eventMessage"
+    <div id="content-messages" class="content-messages eventMessage"
       onclick="document.getElementById('content-messages').parentNode.removeChild(this)">
     <#noescape><p>${uiLabelMap.CommonFollowingOccurred}:</p></#noescape>
     <#if eventMessage?has_content>
@@ -78,24 +71,17 @@ under the License.
         <p>${StringUtil.wrapString(eventMsg)}</p>
       </#list>
     </#if>
-  </div>
-  <#assign jGrowlPosition = modelTheme.getProperty("jgrowlPosition")>
-  <#assign jGrowlWidth = modelTheme.getProperty("jgrowlWidth")>
-  <#assign jGrowlHeight = modelTheme.getProperty("jgrowlHeight")>
-  <#assign jGrowlSpeed = modelTheme.getProperty("jgrowlSpeed")>
-  <script>showjGrowl(
-          "${uiLabelMap.CommonShowAll}", "${uiLabelMap.CommonCollapse}", "${uiLabelMap.CommonHideAllNotifications}",
-          "${jGrowlPosition}", "${jGrowlWidth}", "${jGrowlHeight}", "${jGrowlSpeed}");</script>
+    </div>
   </#if>
 
-   <#-- display the warning messages -->
+  <#-- display the warning messages -->
   <#if (warningMessage?has_content || warningMessageList?has_content)>
     <div id="content-messages" class="content-messages errorMessage"
         onclick="document.getElementById('content-messages').parentNode.removeChild(this)">
-      <#noescape><p>${uiLabelMap.CommonFollowingErrorsOccurred}:</p></#noescape>
-      <#if warningMessage?has_content>
-        <p>${StringUtil.wrapString(warningMessage)}</p>
-      </#if>
+    <#noescape><p>${uiLabelMap.CommonFollowingErrorsOccurred}:</p></#noescape>
+    <#if warningMessage?has_content>
+      <p>${StringUtil.wrapString(warningMessage)}</p>
+    </#if>
       <#if warningMessageList?has_content>
         <#list warningMessageList as warningMsg>
           <p>${StringUtil.wrapString(warningMsg)}</p>
@@ -103,12 +89,16 @@ under the License.
       </#if>
     </div>
   </#if>
-  <#assign jGrowlPosition = modelTheme.getProperty("jgrowlPosition")>
-  <#assign jGrowlWidth = modelTheme.getProperty("jgrowlWidth")>
-  <#assign jGrowlHeight = modelTheme.getProperty("jgrowlHeight")>
-  <#assign jGrowlSpeed = modelTheme.getProperty("jgrowlSpeed")>
 
-  <script>showjGrowl(
+  <#if (errorMessage?has_content || errorMessageList?has_content
+     || eventMessage?has_content || eventMessageList?has_content
+     || warningMessage?has_content || warningMessageList?has_content)>
+    <#assign jGrowlPosition = modelTheme.getProperty("jgrowlPosition")>
+    <#assign jGrowlWidth = modelTheme.getProperty("jgrowlWidth")>
+    <#assign jGrowlHeight = modelTheme.getProperty("jgrowlHeight")>
+    <#assign jGrowlSpeed = modelTheme.getProperty("jgrowlSpeed")>
+    <script>showjGrowl(
           "${uiLabelMap.CommonShowAll}", "${uiLabelMap.CommonCollapse}", "${uiLabelMap.CommonHideAllNotifications}",
           "${jGrowlPosition}", "${jGrowlWidth}", "${jGrowlHeight}", "${jGrowlSpeed}");</script>
+  </#if>
 </#escape>