1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00

Fixed: Searching from missing won't trigger spinner on both buttons

Some formatting updates
This commit is contained in:
Mark McDowall 2014-05-12 17:32:50 -07:00
parent e7683642dd
commit 2fdb0513e8
4 changed files with 423 additions and 422 deletions

View File

@ -17,6 +17,7 @@
<option name="VALUE_ALIGNMENT" value="1" />
</CssCodeStyleSettings>
<JSCodeStyleSettings>
<option name="SPACE_BEFORE_PROPERTY_COLON" value="true" />
<option name="ALIGN_OBJECT_PROPERTIES" value="2" />
</JSCodeStyleSettings>
<XML>
@ -33,8 +34,7 @@
<option name="ELSE_ON_NEW_LINE" value="true" />
<option name="CATCH_ON_NEW_LINE" value="true" />
<option name="FINALLY_ON_NEW_LINE" value="true" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="SPACE_AFTER_COLON" value="false" />
<option name="SPACE_BEFORE_METHOD_PARENTHESES" value="true" />
<option name="METHOD_PARAMETERS_WRAP" value="5" />
<option name="ARRAY_INITIALIZER_WRAP" value="2" />
<option name="IF_BRACE_FORCE" value="3" />

View File

@ -33,6 +33,10 @@ define(
this.$el.addClass('btn-icon-only');
}
if (this.model.get('className')) {
this.$el.addClass(this.model.get('className'));
}
var command = this.model.get('command');
if (command) {
var properties = _.extend({ name: command }, this.model.get('properties'));

View File

@ -1,6 +1,5 @@
'use strict';
define(
[
define([
'underscore',
'marionette',
'backgrid',
@ -43,8 +42,7 @@ define(
searchSelectedButton : '.btn i.icon-search'
},
columns:
[
columns : [
{
name : '',
cell : 'select-row',
@ -67,7 +65,7 @@ define(
name : 'this',
label : 'Episode Title',
sortable : false,
cell : EpisodeTitleCell,
cell : EpisodeTitleCell
},
{
name : 'airDateUtc',
@ -113,13 +111,13 @@ define(
var leftSideButtons = {
type : 'default',
storeState : false,
items :
[
items : [
{
title : 'Search Selected',
icon : 'icon-search',
callback : this._searchSelected,
ownerContext: this
ownerContext : this,
className : 'x-search-selected'
},
{
title : 'Season Pass',
@ -134,8 +132,7 @@ define(
storeState : false,
menuKey : 'wanted.filterMode',
defaultAction : 'monitored',
items :
[
items : [
{
key : 'monitored',
title : '',
@ -154,19 +151,17 @@ define(
};
this.toolbar.show(new ToolbarLayout({
left :
[
left : [
leftSideButtons
],
right :
[
right : [
filterOptions
],
context : this
}));
CommandController.bindToCommand({
element: this.$('.x-toolbar-left-1 .btn i.icon-search'),
element : this.$('.x-search-selected'),
command : {
name : 'episodeSearch'
}

View File

@ -1,6 +1,5 @@
'use strict';
define(
[
define([
'underscore',
'marionette',
'backgrid',
@ -43,8 +42,7 @@ define(
searchSelectedButton : '.btn i.icon-search'
},
columns:
[
columns : [
{
name : '',
cell : 'select-row',
@ -114,19 +112,20 @@ define(
type : 'default',
storeState : false,
collapse : true,
items :
[
items : [
{
title : 'Search Selected',
icon : 'icon-search',
callback : this._searchSelected,
ownerContext: this
ownerContext : this,
className : 'x-search-selected'
},
{
title : 'Search All Missing',
icon : 'icon-search',
callback : this._searchMissing,
ownerContext: this
ownerContext : this,
className : 'x-search-missing'
},
{
title : 'Season Pass',
@ -149,8 +148,7 @@ define(
storeState : false,
menuKey : 'wanted.filterMode',
defaultAction : 'monitored',
items :
[
items : [
{
key : 'monitored',
title : '',
@ -169,23 +167,28 @@ define(
};
this.toolbar.show(new ToolbarLayout({
left :
[
left : [
leftSideButtons
],
right :
[
right : [
filterOptions
],
context : this
}));
CommandController.bindToCommand({
element: this.$('.x-toolbar-left-1 .btn i.icon-search'),
element : this.$('.x-search-selected'),
command : {
name : 'episodeSearch'
}
});
CommandController.bindToCommand({
element : this.$('.x-search-missing'),
command : {
name : 'missingEpisodeSearch'
}
});
},
_setFilter : function (buttonContext) {
@ -194,8 +197,9 @@ define(
this.collection.state.currentPage = 1;
var promise = this.collection.setFilterMode(mode);
if (buttonContext)
if (buttonContext) {
buttonContext.ui.icon.spinForPromise(promise);
}
},
_searchSelected : function () {
@ -219,9 +223,7 @@ define(
},
_searchMissing : function () {
if (window.confirm('Are you sure you want to search for {0} missing episodes? '.format(this.collection.state.totalRecords) +
'One API request to each indexer will be used for each episode. ' +
'This cannot be stopped once started.')) {
if (window.confirm('Are you sure you want to search for {0} missing episodes? '.format(this.collection.state.totalRecords) + 'One API request to each indexer will be used for each episode. ' + 'This cannot be stopped once started.')) {
CommandController.Execute('missingEpisodeSearch', {
name : 'missingEpisodeSearch'
});