@@ -53,9 +53,9 @@ var ApprovedSiteListView = Backbone.View.extend({
53
53
'<span class="label" id="loading-scopes">' + $ . t ( 'common.scopes' ) + '</span> '
54
54
) ;
55
55
56
- $ . when ( this . model . fetchIfNeeded ( { success :function ( e ) { $ ( '#loading-grants' ) . addClass ( 'label-success' ) ; } } ) ,
57
- this . options . clientList . fetchIfNeeded ( { success :function ( e ) { $ ( '#loading-clients' ) . addClass ( 'label-success' ) ; } } ) ,
58
- this . options . systemScopeList . fetchIfNeeded ( { success :function ( e ) { $ ( '#loading-scopes' ) . addClass ( 'label-success' ) ; } } ) )
56
+ $ . when ( this . model . fetchIfNeeded ( { success :function ( e ) { $ ( '#loading-grants' ) . addClass ( 'label-success' ) ; } , error : app . errorHandlerView . handleError ( ) } ) ,
57
+ this . options . clientList . fetchIfNeeded ( { success :function ( e ) { $ ( '#loading-clients' ) . addClass ( 'label-success' ) ; } , error : app . errorHandlerView . handleError ( ) } ) ,
58
+ this . options . systemScopeList . fetchIfNeeded ( { success :function ( e ) { $ ( '#loading-scopes' ) . addClass ( 'label-success' ) ; } , error : app . errorHandlerView . handleError ( ) } ) )
59
59
. done ( function ( ) {
60
60
$ ( '#loadingbox' ) . sheet ( 'hide' ) ;
61
61
callback ( ) ;
@@ -115,9 +115,9 @@ var ApprovedSiteListView = Backbone.View.extend({
115
115
'<span class="label" id="loading-scopes">' + $ . t ( 'common.scopes' ) + '</span> '
116
116
) ;
117
117
118
- $ . when ( this . model . fetch ( { success :function ( e ) { $ ( '#loading-grants' ) . addClass ( 'label-success' ) ; } } ) ,
119
- this . options . clientList . fetch ( { success :function ( e ) { $ ( '#loading-clients' ) . addClass ( 'label-success' ) ; } } ) ,
120
- this . options . systemScopeList . fetch ( { success :function ( e ) { $ ( '#loading-scopes' ) . addClass ( 'label-success' ) ; } } ) )
118
+ $ . when ( this . model . fetch ( { success :function ( e ) { $ ( '#loading-grants' ) . addClass ( 'label-success' ) ; } , error : app . errorHandlerView . handleError ( ) } ) ,
119
+ this . options . clientList . fetch ( { success :function ( e ) { $ ( '#loading-clients' ) . addClass ( 'label-success' ) ; } , error : app . errorHandlerView . handleError ( ) } ) ,
120
+ this . options . systemScopeList . fetch ( { success :function ( e ) { $ ( '#loading-scopes' ) . addClass ( 'label-success' ) ; } , error : app . errorHandlerView . handleError ( ) } ) )
121
121
. done ( function ( ) {
122
122
$ ( '#loadingbox' ) . sheet ( 'hide' ) ;
123
123
_self . render ( ) ;
@@ -227,22 +227,7 @@ var ApprovedSiteView = Backbone.View.extend({
227
227
} ) ;
228
228
} ) ;
229
229
} ,
230
- error :function ( error , response ) {
231
-
232
- //Pull out the response text.
233
- var responseJson = JSON . parse ( response . responseText ) ;
234
-
235
- //Display an alert with an error message
236
- $ ( '#modalAlert div.modal-header' ) . html ( responseJson . error ) ;
237
- $ ( '#modalAlert div.modal-body' ) . html ( responseJson . error_description ) ;
238
-
239
- $ ( "#modalAlert" ) . modal ( { // wire up the actual modal functionality and show the dialog
240
- "backdrop" : "static" ,
241
- "keyboard" : true ,
242
- "show" : true // ensure the modal is shown immediately
243
- } ) ;
244
- }
245
-
230
+ error :app . errorHandlerView . handleError ( )
246
231
} ) ;
247
232
248
233
this . parentView . delegateEvents ( ) ;
0 commit comments