mirror of https://github.com/apache/superset.git
Add Table List Refresh Button (#7502)
* Keep Search button because previously it disappeared + formatting. * more stylistic consistency. * more reliable event listener * revert auto-formatting
This commit is contained in:
parent
ffa7c617ad
commit
56eac687f8
|
@ -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 <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>
|
||||
|
|
Loading…
Reference in New Issue