File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
app/assets/javascripts/blacklight Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 2323 progress_label: "Saving...",
2424 //css_class is added to elements added, plus used for id base
2525 css_class: "toggle_my_kinda_form",
26+ error: function() {
27+ #optional callback
28+ },
2629 success: function(after_success_check_state) {
2730 #optional callback
2831 }
9699 type : form . attr ( "method" ) . toUpperCase ( ) ,
97100 data : form . serialize ( ) ,
98101 error : function ( ) {
99- alert ( "Error" ) ;
100102 label . removeAttr ( "disabled" ) ;
101103 checkbox . removeAttr ( "disabled" ) ;
104+ options . error . call ( ) ;
102105 } ,
103106 success : function ( data , status , xhr ) {
104107 //if app isn't running at all, xhr annoyingly
110113 checkbox . removeAttr ( "disabled" ) ;
111114 options . success . call ( form , checked , xhr . responseJSON ) ;
112115 } else {
113- alert ( "Error" ) ;
114116 label . removeAttr ( "disabled" ) ;
115117 checkbox . removeAttr ( "disabled" ) ;
118+ options . error . call ( ) ;
116119 }
117120 }
118121 } ) ;
128131 $ . fn . bl_checkbox_submit . defaults = {
129132 //css_class is added to elements added, plus used for id base
130133 css_class : "bl_checkbox_submit" ,
134+ error : function ( ) {
135+ alert ( "Error" ) ;
136+ } ,
131137 success : function ( ) { } //callback
132138 } ;
133139} ) ( jQuery ) ;
You can’t perform that action at this time.
0 commit comments