Explorar o código

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 %!s(int64=13) %!d(string=hai) anos
pai
achega
ba1a3f4cf0
Modificáronse 1 ficheiros con 9 adicións e 2 borrados
  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>