Browse Source

HUE-1028 [core] Visual feedback on actions that are not of immediate execution

Every click on btn-primary and btn-danger will put the button/input in the loading status
Enrico Berti 13 years ago
parent
commit
ba1a3f4cf0
1 changed files with 9 additions and 2 deletions
  1. 9 2
      desktop/core/src/desktop/templates/common_footer.html

+ 9 - 2
desktop/core/src/desktop/templates/common_footer.html

@@ -30,9 +30,16 @@ limitations under the License.
 {% endif %}
 
     <script type="text/javascript">
-        $(document).ready(function(){
-            $(".dataTables_wrapper").jHueTableScroller();
+      $(document).ready(function () {
+        $(".dataTables_wrapper").jHueTableScroller();
+        $(document).on("click", ".btn-primary, .btn-danger", function () {
+          if (!$(this).hasClass('disabled')) {
+            var text = ($(this).text()) ? $(this).text() : $(this).val();
+            $(this).attr("data-loading-text", text + " ...");
+            $(this).button("loading");
+          }
         });
+      });
     </script>
 
 	</body>