mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Show spinner when loading from dropdown
This commit is contained in:
parent
11bc946797
commit
9e80473ea0
@ -1,4 +1,4 @@
|
|||||||
<select>
|
<select class="x-page-select">
|
||||||
{{#each pages}}
|
{{#each pages}}
|
||||||
{{#if current}}
|
{{#if current}}
|
||||||
<option value="{{page}}" selected="selected">{{page}}</option>
|
<option value="{{page}}" selected="selected">{{page}}</option>
|
||||||
|
@ -11,10 +11,10 @@ define(
|
|||||||
template: 'Shared/Grid/PagerTemplate',
|
template: 'Shared/Grid/PagerTemplate',
|
||||||
|
|
||||||
events: {
|
events: {
|
||||||
'click .pager-btn' : 'changePage',
|
'click .pager-btn' : 'changePage',
|
||||||
'click .x-page-number' : '_showPageJumper',
|
'click .x-page-number' : '_showPageJumper',
|
||||||
'change .x-page-number select' : '_jumpToPage',
|
'change .x-page-select' : '_jumpToPage',
|
||||||
'blur .x-page-number select' : 'render'
|
'blur .x-page-select' : 'render'
|
||||||
},
|
},
|
||||||
|
|
||||||
windowSize: 1,
|
windowSize: 1,
|
||||||
@ -176,12 +176,15 @@ define(
|
|||||||
this.$el.find('.x-page-number').html(templateFunction({
|
this.$el.find('.x-page-number').html(templateFunction({
|
||||||
pages : pages
|
pages : pages
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this.$el.find('.x-page-number select').trigger('click');
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_jumpToPage: function () {
|
_jumpToPage: function () {
|
||||||
var selectedPage = parseInt(this.$el.find('.x-page-number select').val(), 10);
|
var target = this.$el.find('.x-page-select');
|
||||||
|
|
||||||
|
//Remove event handlers so the blur event is not triggered
|
||||||
|
this.undelegateEvents();
|
||||||
|
|
||||||
|
var selectedPage = parseInt(target.val(), 10);
|
||||||
|
|
||||||
this.$el.find('.x-page-number').html('<i class="icon-spinner icon-spin"></i>');
|
this.$el.find('.x-page-number').html('<i class="icon-spinner icon-spin"></i>');
|
||||||
this.collection.getPage(selectedPage);
|
this.collection.getPage(selectedPage);
|
||||||
|
Loading…
Reference in New Issue
Block a user