@ -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'
} ) ;