File tree 11 files changed +22
-11
lines changed
11 files changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,8 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({
46
46
this . _super ( ) ;
47
47
}
48
48
} ,
49
- disable : function ( ) {
49
+ disable : function ( always_disabled ) {
50
+ if ( always_disabled ) this . always_disabled = true ;
50
51
if ( this . add_row_button ) this . add_row_button . disabled = true ;
51
52
if ( this . remove_all_rows_button ) this . remove_all_rows_button . disabled = true ;
52
53
if ( this . delete_last_row_button ) this . delete_last_row_button . disabled = true ;
Original file line number Diff line number Diff line change @@ -72,7 +72,8 @@ JSONEditor.defaults.editors.base64 = JSONEditor.AbstractEditor.extend({
72
72
this . _super ( ) ;
73
73
}
74
74
} ,
75
- disable : function ( ) {
75
+ disable : function ( always_disabled ) {
76
+ if ( always_disabled ) this . always_disabled = true ;
76
77
if ( this . uploader ) this . uploader . disabled = true ;
77
78
this . _super ( ) ;
78
79
} ,
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ JSONEditor.defaults.editors.checkbox = JSONEditor.AbstractEditor.extend({
48
48
this . _super ( ) ;
49
49
}
50
50
} ,
51
- disable : function ( ) {
51
+ disable : function ( always_disabled ) {
52
+ if ( always_disabled ) this . always_disabled = true ;
52
53
this . input . disabled = true ;
53
54
this . _super ( ) ;
54
55
} ,
Original file line number Diff line number Diff line change @@ -67,7 +67,8 @@ JSONEditor.defaults.editors["enum"] = JSONEditor.AbstractEditor.extend({
67
67
this . _super ( ) ;
68
68
}
69
69
} ,
70
- disable : function ( ) {
70
+ disable : function ( always_disabled ) {
71
+ if ( always_disabled ) this . always_disabled = true ;
71
72
this . switcher . disabled = true ;
72
73
this . _super ( ) ;
73
74
} ,
Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ JSONEditor.defaults.editors.multiple = JSONEditor.AbstractEditor.extend({
35
35
this . _super ( ) ;
36
36
}
37
37
} ,
38
- disable : function ( ) {
38
+ disable : function ( always_disabled ) {
39
+ if ( always_disabled ) this . always_disabled = true ;
39
40
if ( this . editors ) {
40
41
for ( var i = 0 ; i < this . editors . length ; i ++ ) {
41
42
if ( ! this . editors [ i ] ) continue ;
Original file line number Diff line number Diff line change @@ -179,7 +179,8 @@ JSONEditor.defaults.editors.multiselect = JSONEditor.AbstractEditor.extend({
179
179
this . _super ( ) ;
180
180
}
181
181
} ,
182
- disable : function ( ) {
182
+ disable : function ( always_disabled ) {
183
+ if ( always_disabled ) this . always_disabled = true ;
183
184
if ( this . input ) {
184
185
this . input . disabled = true ;
185
186
}
Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ JSONEditor.defaults.editors.object = JSONEditor.AbstractEditor.extend({
40
40
}
41
41
}
42
42
} ,
43
- disable : function ( ) {
43
+ disable : function ( always_disabled ) {
44
+ if ( always_disabled ) this . always_disabled = true ;
44
45
if ( this . editjson_button ) this . editjson_button . disabled = true ;
45
46
if ( this . addproperty_button ) this . addproperty_button . disabled = true ;
46
47
this . hideEditJSON ( ) ;
Original file line number Diff line number Diff line change @@ -336,7 +336,8 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({
336
336
this . _super ( ) ;
337
337
}
338
338
} ,
339
- disable : function ( ) {
339
+ disable : function ( always_disabled ) {
340
+ if ( always_disabled ) this . always_disabled = true ;
340
341
this . input . disabled = true ;
341
342
if ( this . select2 ) this . select2 . select2 ( "enable" , false ) ;
342
343
this . _super ( ) ;
Original file line number Diff line number Diff line change @@ -327,7 +327,8 @@ JSONEditor.defaults.editors.selectize = JSONEditor.AbstractEditor.extend({
327
327
this . _super ( ) ;
328
328
}
329
329
} ,
330
- disable : function ( ) {
330
+ disable : function ( always_disabled ) {
331
+ if ( always_disabled ) this . always_disabled = true ;
331
332
this . input . disabled = true ;
332
333
if ( this . selectize ) {
333
334
this . selectize [ 0 ] . selectize . lock ( ) ;
Original file line number Diff line number Diff line change @@ -280,7 +280,8 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({
280
280
this . _super ( ) ;
281
281
}
282
282
} ,
283
- disable : function ( ) {
283
+ disable : function ( always_disabled ) {
284
+ if ( always_disabled ) this . always_disabled = true ;
284
285
this . input . disabled = true ;
285
286
// TODO: WYSIWYG and Markdown editors
286
287
this . _super ( ) ;
Original file line number Diff line number Diff line change @@ -114,7 +114,8 @@ JSONEditor.defaults.editors.upload = JSONEditor.AbstractEditor.extend({
114
114
this . _super ( ) ;
115
115
}
116
116
} ,
117
- disable : function ( ) {
117
+ disable : function ( always_disabled ) {
118
+ if ( always_disabled ) this . always_disabled = true ;
118
119
if ( this . uploader ) this . uploader . disabled = true ;
119
120
this . _super ( ) ;
120
121
} ,
You can’t perform that action at this time.
0 commit comments