svn commit: r1303045 - in /ofbiz/trunk: framework/images/webapp/images/ themes/bizznesstime/webapp/bizznesstime/css/ themes/bluelight/webapp/bluelight/ themes/droppingcrumbs/webapp/droppingcrumbs/css/ themes/flatgrey/webapp/flatgrey/ themes/tomahawk/we...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1303045 - in /ofbiz/trunk: framework/images/webapp/images/ themes/bizznesstime/webapp/bizznesstime/css/ themes/bluelight/webapp/bluelight/ themes/droppingcrumbs/webapp/droppingcrumbs/css/ themes/flatgrey/webapp/flatgrey/ themes/tomahawk/we...

ashish-18
Author: ashish
Date: Tue Mar 20 17:51:40 2012
New Revision: 1303045

URL: http://svn.apache.org/viewvc?rev=1303045&view=rev
Log:
Bug fix, Applied patch from jira issue OFBIZ-4735 - User behaviour issue on Lookup.
Currently if user perform search or use pagination in lookup and if matches found then list display but if no matches found then user didn't know that result will come or not, even no matches found.

Change behaviour should be when user perform search or use pagination then spinner (ajax loader image) shows which tells user that search is in progress. If matches found or not found spinner disappears.
Now user won't see any abnormal behaviour at ui.
Thanks Deepak, Rishi & Anil Gupta for the contribution.

Modified:
    ofbiz/trunk/framework/images/webapp/images/fieldlookup.js
    ofbiz/trunk/themes/bizznesstime/webapp/bizznesstime/css/style.css
    ofbiz/trunk/themes/bluelight/webapp/bluelight/style.css
    ofbiz/trunk/themes/droppingcrumbs/webapp/droppingcrumbs/css/style.css
    ofbiz/trunk/themes/flatgrey/webapp/flatgrey/javascript.css
    ofbiz/trunk/themes/tomahawk/webapp/tomahawk/css/style.css

Modified: ofbiz/trunk/framework/images/webapp/images/fieldlookup.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/fieldlookup.js?rev=1303045&r1=1303044&r2=1303045&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/fieldlookup.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/fieldlookup.js Tue Mar 20 17:51:40 2012
@@ -608,8 +608,34 @@ function lookupFormAjaxRequest(formActio
     lookupId = GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).lookupId;
     var data = jQuery("#" + form).serialize();
     data = data + "&presentation=" + GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).presentation;
-    jQuery("#" + lookupId).load(formAction, data, function(data) {
+    /*jQuery("#" + lookupId).load(formAction, data, function(data) {
         modifySubmitButton(lookupId);
+    });*/
+    var screenletTitleBar= jQuery("#"+lookupId+" .screenlet-title-bar :visible:first");
+    jQuery.ajax({
+      url: formAction,
+      data: data,
+      beforeSend: function(jqXHR, settings) {
+        //Here we append the spinner to the lookup screenlet and it will shown till the ajax request is processed.
+        var indicator = screenletTitleBar.find("span.indicator");
+        //Check that if spinner is already in execution then don't add new spinner
+        if (indicator.length == 0) {
+          jQuery("<span class='indicator'><img src='/images/ajax-loader.gif' alt='' /></span>").appendTo(screenletTitleBar);
+        }
+      },
+      success: function(result) {
+        if (result.search(/loginform/) != -1) {
+          window.location.href = window.location.href;
+          return;
+        }
+        // Here we are removing the spinner.
+        var indicator = screenletTitleBar.find("span.indicator");
+        if (indicator != undefined) {
+          jQuery("span.indicator").remove();
+        }
+        jQuery("#" + lookupId).html(result);
+        modifySubmitButton(lookupId);
+      }
     });
 }
 
@@ -618,8 +644,33 @@ function lookupPaginationAjaxRequest(nav
     lookupContent = (GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).contentRef);
 
     lookupId = GLOBAL_LOOKUP_REF.getReference(ACTIVATED_LOOKUP).lookupId;
-    jQuery("#" + lookupId).load(navAction, function(data) {
+    /*jQuery("#" + lookupId).load(navAction, function(data) {
         modifySubmitButton(lookupId);
+    });*/
+    var screenletTitleBar= jQuery("#"+lookupId+" .screenlet-title-bar :visible:first");
+    jQuery.ajax({
+      url: navAction,
+      beforeSend: function(jqXHR, settings) {
+        //Here we append the spinner to the lookup screenlet and it will shown till the ajax request is processed.
+        var indicator = screenletTitleBar.find("span.indicator");
+        //Check that if spinner is already in execution then don't add new spinner
+        if (indicator.length == 0) {
+          jQuery("<span class='indicator'><img src='/images/ajax-loader.gif' alt='' /></span>").appendTo(screenletTitleBar);
+        }
+      },
+      success: function(result) {
+        if (result.search(/loginform/) != -1) {
+          window.location.href = window.location.href;
+          return;
+        }
+        // Here we are removing the spinner.
+        var indicator = screenletTitleBar.find("span.indicator");
+        if (indicator != undefined) {
+          jQuery("span.indicator").remove();
+        }
+        jQuery("#" + lookupId).html(result);
+        modifySubmitButton(lookupId);
+      }
     });
 }
 

Modified: ofbiz/trunk/themes/bizznesstime/webapp/bizznesstime/css/style.css
URL: http://svn.apache.org/viewvc/ofbiz/trunk/themes/bizznesstime/webapp/bizznesstime/css/style.css?rev=1303045&r1=1303044&r2=1303045&view=diff
==============================================================================
--- ofbiz/trunk/themes/bizznesstime/webapp/bizznesstime/css/style.css (original)
+++ ofbiz/trunk/themes/bizznesstime/webapp/bizznesstime/css/style.css Tue Mar 20 17:51:40 2012
@@ -1429,7 +1429,13 @@ div.autocomplete ul li {
   height:16px;
   border: none;
 }
-
+.screenlet-title-bar .indicator img {
+  float:right;
+  margin:0 3px;
+  width:16px;
+  height:16px;
+  display:inline;
+}
 /***********************************************
 Webtools
 ***********************************************/

Modified: ofbiz/trunk/themes/bluelight/webapp/bluelight/style.css
URL: http://svn.apache.org/viewvc/ofbiz/trunk/themes/bluelight/webapp/bluelight/style.css?rev=1303045&r1=1303044&r2=1303045&view=diff
==============================================================================
--- ofbiz/trunk/themes/bluelight/webapp/bluelight/style.css (original)
+++ ofbiz/trunk/themes/bluelight/webapp/bluelight/style.css Tue Mar 20 17:51:40 2012
@@ -1330,6 +1330,13 @@ div.autocomplete ul li {
   border: none;
 }
 
+.screenlet-title-bar .indicator img {
+  float:right;
+  margin:0 3px;
+  width:16px;
+  height:16px;
+  display:inline;
+}
 /* ======================================================= */
     /* ===== Basic Navigation (Vertical Menu) Style ========== */
     /* ======================================================= */

Modified: ofbiz/trunk/themes/droppingcrumbs/webapp/droppingcrumbs/css/style.css
URL: http://svn.apache.org/viewvc/ofbiz/trunk/themes/droppingcrumbs/webapp/droppingcrumbs/css/style.css?rev=1303045&r1=1303044&r2=1303045&view=diff
==============================================================================
--- ofbiz/trunk/themes/droppingcrumbs/webapp/droppingcrumbs/css/style.css (original)
+++ ofbiz/trunk/themes/droppingcrumbs/webapp/droppingcrumbs/css/style.css Tue Mar 20 17:51:40 2012
@@ -1303,6 +1303,14 @@ div.autocomplete ul li {
   height:16px;
   border: none;
 }
+
+.screenlet-title-bar .indicator img {
+  float:right;
+  margin:0 3px;
+  width:16px;
+  height:16px;
+  display:inline;
+}
 /* ======================================================= */
 /* ===== Basic Navigation (Vertical Menu) Style ========== */
 /* ======================================================= */

Modified: ofbiz/trunk/themes/flatgrey/webapp/flatgrey/javascript.css
URL: http://svn.apache.org/viewvc/ofbiz/trunk/themes/flatgrey/webapp/flatgrey/javascript.css?rev=1303045&r1=1303044&r2=1303045&view=diff
==============================================================================
--- ofbiz/trunk/themes/flatgrey/webapp/flatgrey/javascript.css (original)
+++ ofbiz/trunk/themes/flatgrey/webapp/flatgrey/javascript.css Tue Mar 20 17:51:40 2012
@@ -75,6 +75,13 @@ div.autocomplete ul li {
   border: none;
 }
 
+.screenlet-title-bar .indicator img {
+  float:right;
+  margin:0 3px;
+  width:16px;
+  height:16px;
+  display:inline;
+}
 /* -------------------------------------------------- */
 /*      JavaScript jQuery widgets  REDMOND Design     */
 /* -------------------------------------------------- */

Modified: ofbiz/trunk/themes/tomahawk/webapp/tomahawk/css/style.css
URL: http://svn.apache.org/viewvc/ofbiz/trunk/themes/tomahawk/webapp/tomahawk/css/style.css?rev=1303045&r1=1303044&r2=1303045&view=diff
==============================================================================
--- ofbiz/trunk/themes/tomahawk/webapp/tomahawk/css/style.css (original)
+++ ofbiz/trunk/themes/tomahawk/webapp/tomahawk/css/style.css Tue Mar 20 17:51:40 2012
@@ -1421,6 +1421,13 @@ div.autocomplete ul li {
   height:16px;
   border: none;
 }
+.screenlet-title-bar .indicator img {
+  float:right;
+  margin:0 3px;
+  width:16px;
+  height:16px;
+  display:inline;
+}
 /* ======================================================= */
 /* ===== Basic Navigation (Vertical Menu) Style ========== */
 /* ======================================================= */