File tree 11 files changed +49
-37
lines changed
11 files changed +49
-37
lines changed Original file line number Diff line number Diff line change @@ -29,20 +29,22 @@ JSONEditor.defaults.editors.array = JSONEditor.AbstractEditor.extend({
29
29
}
30
30
} ,
31
31
enable : function ( ) {
32
- if ( this . add_row_button ) this . add_row_button . disabled = false ;
33
- if ( this . remove_all_rows_button ) this . remove_all_rows_button . disabled = false ;
34
- if ( this . delete_last_row_button ) this . delete_last_row_button . disabled = false ;
35
-
36
- if ( this . rows ) {
37
- for ( var i = 0 ; i < this . rows . length ; i ++ ) {
38
- this . rows [ i ] . enable ( ) ;
39
-
40
- if ( this . rows [ i ] . moveup_button ) this . rows [ i ] . moveup_button . disabled = false ;
41
- if ( this . rows [ i ] . movedown_button ) this . rows [ i ] . movedown_button . disabled = false ;
42
- if ( this . rows [ i ] . delete_button ) this . rows [ i ] . delete_button . disabled = false ;
32
+ if ( ! this . always_disabled ) {
33
+ if ( this . add_row_button ) this . add_row_button . disabled = false ;
34
+ if ( this . remove_all_rows_button ) this . remove_all_rows_button . disabled = false ;
35
+ if ( this . delete_last_row_button ) this . delete_last_row_button . disabled = false ;
36
+
37
+ if ( this . rows ) {
38
+ for ( var i = 0 ; i < this . rows . length ; i ++ ) {
39
+ this . rows [ i ] . enable ( ) ;
40
+
41
+ if ( this . rows [ i ] . moveup_button ) this . rows [ i ] . moveup_button . disabled = false ;
42
+ if ( this . rows [ i ] . movedown_button ) this . rows [ i ] . movedown_button . disabled = false ;
43
+ if ( this . rows [ i ] . delete_button ) this . rows [ i ] . delete_button . disabled = false ;
44
+ }
43
45
}
46
+ this . _super ( ) ;
44
47
}
45
- this . _super ( ) ;
46
48
} ,
47
49
disable : function ( ) {
48
50
if ( this . add_row_button ) this . add_row_button . disabled = true ;
Original file line number Diff line number Diff line change @@ -67,8 +67,10 @@ JSONEditor.defaults.editors.base64 = JSONEditor.AbstractEditor.extend({
67
67
}
68
68
} ,
69
69
enable : function ( ) {
70
- if ( this . uploader ) this . uploader . disabled = false ;
71
- this . _super ( ) ;
70
+ if ( ! this . always_disabled ) {
71
+ if ( this . uploader ) this . uploader . disabled = false ;
72
+ this . _super ( ) ;
73
+ }
72
74
} ,
73
75
disable : function ( ) {
74
76
if ( this . uploader ) this . uploader . disabled = true ;
Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ JSONEditor.defaults.editors.checkbox = JSONEditor.AbstractEditor.extend({
45
45
enable : function ( ) {
46
46
if ( ! this . always_disabled ) {
47
47
this . input . disabled = false ;
48
+ this . _super ( ) ;
48
49
}
49
- this . _super ( ) ;
50
50
} ,
51
51
disable : function ( ) {
52
52
this . input . disabled = true ;
Original file line number Diff line number Diff line change @@ -62,8 +62,10 @@ JSONEditor.defaults.editors["enum"] = JSONEditor.AbstractEditor.extend({
62
62
this . display_area . innerHTML = this . html_values [ this . selected ] ;
63
63
} ,
64
64
enable : function ( ) {
65
- if ( ! this . always_disabled ) this . switcher . disabled = false ;
66
- this . _super ( ) ;
65
+ if ( ! this . always_disabled ) {
66
+ this . switcher . disabled = false ;
67
+ this . _super ( ) ;
68
+ }
67
69
} ,
68
70
disable : function ( ) {
69
71
this . switcher . disabled = true ;
Original file line number Diff line number Diff line change @@ -24,14 +24,16 @@ JSONEditor.defaults.editors.multiple = JSONEditor.AbstractEditor.extend({
24
24
return Math . max ( this . editors [ this . type ] . getNumColumns ( ) , 4 ) ;
25
25
} ,
26
26
enable : function ( ) {
27
- if ( this . editors ) {
28
- for ( var i = 0 ; i < this . editors . length ; i ++ ) {
29
- if ( ! this . editors [ i ] ) continue ;
30
- this . editors [ i ] . enable ( ) ;
27
+ if ( ! this . always_disabled ) {
28
+ if ( this . editors ) {
29
+ for ( var i = 0 ; i < this . editors . length ; i ++ ) {
30
+ if ( ! this . editors [ i ] ) continue ;
31
+ this . editors [ i ] . enable ( ) ;
32
+ }
31
33
}
34
+ this . switcher . disabled = false ;
35
+ this . _super ( ) ;
32
36
}
33
- this . switcher . disabled = false ;
34
- this . _super ( ) ;
35
37
} ,
36
38
disable : function ( ) {
37
39
if ( this . editors ) {
Original file line number Diff line number Diff line change @@ -176,8 +176,8 @@ JSONEditor.defaults.editors.multiselect = JSONEditor.AbstractEditor.extend({
176
176
}
177
177
}
178
178
if ( this . select2 ) this . select2 . select2 ( "enable" , true ) ;
179
+ this . _super ( ) ;
179
180
}
180
- this . _super ( ) ;
181
181
} ,
182
182
disable : function ( ) {
183
183
if ( this . input ) {
Original file line number Diff line number Diff line change @@ -27,14 +27,16 @@ JSONEditor.defaults.editors.object = JSONEditor.AbstractEditor.extend({
27
27
return Math . max ( Math . min ( 12 , this . maxwidth ) , 3 ) ;
28
28
} ,
29
29
enable : function ( ) {
30
- if ( this . editjson_button ) this . editjson_button . disabled = false ;
31
- if ( this . addproperty_button ) this . addproperty_button . disabled = false ;
32
-
33
- this . _super ( ) ;
34
- if ( this . editors ) {
35
- for ( var i in this . editors ) {
36
- if ( ! this . editors . hasOwnProperty ( i ) ) continue ;
37
- this . editors [ i ] . enable ( ) ;
30
+ if ( ! this . always_disabled ) {
31
+ if ( this . editjson_button ) this . editjson_button . disabled = false ;
32
+ if ( this . addproperty_button ) this . addproperty_button . disabled = false ;
33
+
34
+ this . _super ( ) ;
35
+ if ( this . editors ) {
36
+ for ( var i in this . editors ) {
37
+ if ( ! this . editors . hasOwnProperty ( i ) ) continue ;
38
+ this . editors [ i ] . enable ( ) ;
39
+ }
38
40
}
39
41
}
40
42
} ,
Original file line number Diff line number Diff line change @@ -333,8 +333,8 @@ JSONEditor.defaults.editors.select = JSONEditor.AbstractEditor.extend({
333
333
if ( ! this . always_disabled ) {
334
334
this . input . disabled = false ;
335
335
if ( this . select2 ) this . select2 . select2 ( "enable" , true ) ;
336
+ this . _super ( ) ;
336
337
}
337
- this . _super ( ) ;
338
338
} ,
339
339
disable : function ( ) {
340
340
this . input . disabled = true ;
Original file line number Diff line number Diff line change @@ -324,8 +324,8 @@ JSONEditor.defaults.editors.selectize = JSONEditor.AbstractEditor.extend({
324
324
if ( this . selectize ) {
325
325
this . selectize [ 0 ] . selectize . unlock ( ) ;
326
326
}
327
+ this . _super ( ) ;
327
328
}
328
- this . _super ( ) ;
329
329
} ,
330
330
disable : function ( ) {
331
331
this . input . disabled = true ;
Original file line number Diff line number Diff line change @@ -277,8 +277,8 @@ JSONEditor.defaults.editors.string = JSONEditor.AbstractEditor.extend({
277
277
if ( ! this . always_disabled ) {
278
278
this . input . disabled = false ;
279
279
// TODO: WYSIWYG and Markdown editors
280
+ this . _super ( ) ;
280
281
}
281
- this . _super ( ) ;
282
282
} ,
283
283
disable : function ( ) {
284
284
this . input . disabled = true ;
Original file line number Diff line number Diff line change @@ -109,8 +109,10 @@ JSONEditor.defaults.editors.upload = JSONEditor.AbstractEditor.extend({
109
109
} ) ;
110
110
} ,
111
111
enable : function ( ) {
112
- if ( this . uploader ) this . uploader . disabled = false ;
113
- this . _super ( ) ;
112
+ if ( ! this . always_disabled ) {
113
+ if ( this . uploader ) this . uploader . disabled = false ;
114
+ this . _super ( ) ;
115
+ }
114
116
} ,
115
117
disable : function ( ) {
116
118
if ( this . uploader ) this . uploader . disabled = true ;
You can’t perform that action at this time.
0 commit comments