superset-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maximebeauche...@apache.org
Subject [incubator-superset] branch master updated: Add Table List Refresh Button (#7502)
Date Tue, 02 Jul 2019 01:29:19 GMT
This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-superset.git


The following commit(s) were added to refs/heads/master by this push:
     new 56eac68  Add Table List Refresh Button (#7502)
56eac68 is described below

commit 56eac687f8f1d360f68fc78213ade8d298409603
Author: Marcus <marcuseagan@gmail.com>
AuthorDate: Tue Jul 2 03:29:12 2019 +0200

    Add Table List Refresh Button (#7502)
    
    * Keep Search button because previously it disappeared + formatting.
    
    * more stylistic consistency.
    
    * more reliable event listener
    
    * revert auto-formatting
---
 .../appbuilder/general/widgets/search.html         | 45 +++++++++++-----------
 1 file changed, 23 insertions(+), 22 deletions(-)

diff --git a/superset/templates/appbuilder/general/widgets/search.html b/superset/templates/appbuilder/general/widgets/search.html
index 6d7bc2e..86637d0 100644
--- a/superset/templates/appbuilder/general/widgets/search.html
+++ b/superset/templates/appbuilder/general/widgets/search.html
@@ -45,30 +45,31 @@
 </div>
 
 <script>
-(function($) {
-    function checkSearchButton() {
-        var hasFilter = $('.filters tr').length;
-        if (hasFilter) {
-            $('.filters a.remove-filter').off('click', checkSearchButton);
-            $('.filters a.remove-filter').on('click', checkSearchButton);
-            $('.filter-action').toggle(true);
-        } else {
-            $('.filter-action').toggle(false);
+    (function($) {
+        function checkSearchButton() {
+            var hasFilter = $('.filters tr').length;
+            if (hasFilter) {
+                $('.filters a.remove-filter').off('click', checkSearchButton);
+                $('.filters a.remove-filter').on('click', checkSearchButton);
+                $('.filter-action').toggle(true);
+            } else {
+                $('.filter-action').toggle(true);
+                $('.filter-action > button').html('Refresh&nbsp;&nbsp;<i class="fa
fa-refresh"></i>');
+            }
         }
-    }
 
-    $('.list-search-container').on('hidden.bs.dropdown', checkSearchButton);
-    $(document).ready(function() {
-        checkSearchButton();
-    });
+        $('a.btn.remove-filter').on('click', checkSearchButton);
+        $(document).ready(function() {
+            checkSearchButton();
+        });
 
-    var filter = new AdminFilters(
-        '#filter_form',
-        {{ label_columns | tojson | safe }},
-        {{ form_fields | tojson | safe }},
-        {{ search_filters | tojson | safe }},
-        {{ active_filters | tojson | safe }}
-    );
-})(jQuery);
+        var filter = new AdminFilters(
+            '#filter_form',
+            {{ label_columns | tojson | safe }},
+            {{ form_fields | tojson | safe }},
+            {{ search_filters | tojson | safe }},
+            {{ active_filters | tojson | safe }}
+        );
+    })(jQuery);
 
 </script>


Mime
View raw message