@@ -16,177 +16,179 @@ define([
16
16
* @returns {Boolean }
17
17
*/
18
18
var isSolutionEnabled = function ( solution , enabler ) {
19
- return solution . find ( enabler ) . val ( ) === '1' ;
20
- } ,
19
+ return solution . find ( enabler ) . val ( ) === '1' ;
20
+ } ,
21
21
22
- /**
23
- * Check is solution has related solutions enabled
24
- *
25
- * @param {Object } data
26
- * @returns {Boolean }
27
- */
28
- hasRelationsEnabled = function ( data ) {
29
- var name ;
22
+ /**
23
+ * Check is solution has related solutions enabled
24
+ *
25
+ * @param {Object } data
26
+ * @returns {Boolean }
27
+ */
28
+ hasRelationsEnabled = function ( data ) {
29
+ var name ;
30
30
31
- for ( name in data . argument ) {
32
- if (
33
- data . solutionsElements [ name ] &&
34
- isSolutionEnabled ( data . solutionsElements [ name ] , data . enableButton )
35
- ) {
36
- return true ;
31
+ for ( name in data . argument ) {
32
+ if (
33
+ data . solutionsElements [ name ] &&
34
+ isSolutionEnabled ( data . solutionsElements [ name ] , data . enableButton )
35
+ ) {
36
+ return true ;
37
+ }
37
38
}
38
- }
39
39
40
- return false ;
41
- } ,
40
+ return false ;
41
+ } ,
42
42
43
- /**
44
- * Set solution select-enabler to certain option
45
- *
46
- * @param {* } solution
47
- * @param {String } enabler
48
- * @param {Boolean } enabled
49
- */
50
- setSolutionSelectEnabled = function ( solution , enabler , enabled ) {
51
- enabled = ! ( enabled || typeof enabled === 'undefined' ) ? '0' : '1' ;
43
+ /**
44
+ * Set solution select-enabler to certain option
45
+ *
46
+ * @param {* } solution
47
+ * @param {String } enabler
48
+ * @param {Boolean } enabled
49
+ */
50
+ setSolutionSelectEnabled = function ( solution , enabler , enabled ) {
51
+ enabled = ! ( enabled || typeof enabled === 'undefined' ) ? '0' : '1' ;
52
52
53
- solution . find ( enabler + ' option[value=' + enabled + ']' )
53
+ solution . find ( enabler + ' option[value=' + enabled + ']' )
54
54
. prop ( 'selected' , true ) ;
55
- } ,
55
+ } ,
56
56
57
- /**
58
- * Set solution property 'disabled' value
59
- *
60
- * @param {* } solution
61
- * @param {String } enabler
62
- * @param {Boolean } enabled
63
- */
64
- setSolutionPropEnabled = function ( solution , enabler , enabled ) {
65
- enabled = ! ( enabled || typeof enabled === 'undefined' ) ;
57
+ /**
58
+ * Set solution property 'disabled' value
59
+ *
60
+ * @param {* } solution
61
+ * @param {String } enabler
62
+ * @param {Boolean } enabled
63
+ */
64
+ setSolutionPropEnabled = function ( solution , enabler , enabled ) {
65
+ enabled = ! ( enabled || typeof enabled === 'undefined' ) ;
66
66
67
- solution . find ( enabler ) . prop ( 'disabled' , enabled ) ;
68
- } ,
67
+ solution . find ( enabler ) . prop ( 'disabled' , enabled ) ;
68
+ } ,
69
69
70
- /**
71
- * Set/unset solution select-enabler label
72
- *
73
- * @param {* } solution
74
- * @param {String } enabler
75
- * @param {Boolean } enabled
76
- */
77
- setSolutionMarkEnabled = function ( solution , enabler , enabled ) {
78
- var solutionEnabler = solution . find ( 'label[for="' + solution . find ( enabler ) . attr ( 'id' ) + '"]' ) ;
70
+ /**
71
+ * Set/unset solution select-enabler label
72
+ *
73
+ * @param {* } solution
74
+ * @param {String } enabler
75
+ * @param {Boolean } enabled
76
+ */
77
+ setSolutionMarkEnabled = function ( solution , enabler , enabled ) {
78
+ var solutionEnabler = solution . find ( 'label[for="' + solution . find ( enabler ) . attr ( 'id' ) + '"]' ) ;
79
79
80
- enabled || typeof enabled === 'undefined' ?
81
- solutionEnabler . addClass ( 'enabled' ) :
82
- solutionEnabler . removeClass ( 'enabled' ) ;
83
- } ,
80
+ enabled || typeof enabled === 'undefined' ?
81
+ solutionEnabler . addClass ( 'enabled' ) :
82
+ solutionEnabler . removeClass ( 'enabled' ) ;
83
+ } ,
84
84
85
- /**
86
- * Set/unset solution section label
87
- *
88
- * @param {* } solution
89
- * @param {Boolean } enabled
90
- */
91
- setSolutionSectionMarkEnabled = function ( solution , enabled ) {
92
- var solutionSection = solution . find ( '.section-config' ) ;
85
+ /**
86
+ * Set/unset solution section label
87
+ *
88
+ * @param {* } solution
89
+ * @param {Boolean } enabled
90
+ */
91
+ setSolutionSectionMarkEnabled = function ( solution , enabled ) {
92
+ var solutionSection = solution . find ( '.section-config' ) ;
93
93
94
- enabled || typeof enabled === 'undefined' ?
95
- solutionSection . addClass ( 'enabled' ) :
96
- solutionSection . removeClass ( 'enabled' ) ;
97
- } ,
94
+ enabled || typeof enabled === 'undefined' ?
95
+ solutionSection . addClass ( 'enabled' ) :
96
+ solutionSection . removeClass ( 'enabled' ) ;
97
+ } ,
98
98
99
- /**
100
- * Set/unset solution section inner labels
101
- *
102
- * @param {* } solution
103
- * @param {Boolean } enabled
104
- */
105
- setSolutionLabelsMarkEnabled = function ( solution , enabled ) {
106
- var solutionLabels = solution . find ( 'label.enabled' ) ;
99
+ /**
100
+ * Set/unset solution section inner labels
101
+ *
102
+ * @param {* } solution
103
+ * @param {Boolean } enabled
104
+ */
105
+ setSolutionLabelsMarkEnabled = function ( solution , enabled ) {
106
+ var solutionLabels = solution . find ( 'label.enabled' ) ;
107
107
108
- enabled || typeof enabled === 'undefined' ?
109
- solutionLabels . addClass ( 'enabled' ) :
110
- solutionLabels . removeClass ( 'enabled' ) ;
111
- } ,
108
+ enabled || typeof enabled === 'undefined' ?
109
+ solutionLabels . addClass ( 'enabled' ) :
110
+ solutionLabels . removeClass ( 'enabled' ) ;
111
+ } ,
112
112
113
- /**
114
- * Set solution as disabled
115
- *
116
- * @param {* } solution
117
- * @param {String } enabler
118
- */
119
- disableSolution = function ( solution , enabler ) {
120
- setSolutionMarkEnabled ( solution , enabler , false ) ;
121
- setSolutionSelectEnabled ( solution , enabler , false ) ;
122
- setSolutionPropEnabled ( solution , enabler , false ) ;
123
- } ,
113
+ /**
114
+ * Set/unset solution usedefault checkbox
115
+ *
116
+ * @param {* } solution
117
+ * @param {String } enabler
118
+ * @param {Boolean } checked
119
+ */
120
+ setSolutionUsedefaultEnabled = function ( solution , enabler , checked ) {
121
+ checked = ! ( checked || typeof checked === 'undefined' ) ;
124
122
125
- /**
126
- * Set solution as enabled
127
- *
128
- * @param {* } solution
129
- * @param {String } enabler
130
- */
131
- enableSolution = function ( solution , enabler ) {
132
- setSolutionPropEnabled ( solution , enabler ) ;
133
- setSolutionSelectEnabled ( solution , enabler ) ;
134
- setSolutionMarkEnabled ( solution , enabler ) ;
135
- } ,
123
+ solution . find ( 'input[id="' + solution . find ( enabler ) . attr ( 'id' ) + '_inherit"]' )
124
+ . prop ( 'checked' , checked ) ;
125
+ } ,
136
126
137
- /**
138
- * Lock/unlock solution configuration button
139
- *
140
- * @param {* } solution
141
- * @param {String } buttonConfiguration
142
- * @param {Boolean } unlock
143
- */
144
- setSolutionConfigurationUnlock = function ( solution , buttonConfiguration , unlock ) {
145
- var solutionConfiguration = solution . find ( buttonConfiguration ) ;
127
+ /**
128
+ * Set solution as disabled
129
+ *
130
+ * @param {* } solution
131
+ * @param {String } enabler
132
+ */
133
+ disableSolution = function ( solution , enabler ) {
134
+ setSolutionUsedefaultEnabled ( solution , enabler ) ;
135
+ setSolutionMarkEnabled ( solution , enabler , false ) ;
136
+ setSolutionSelectEnabled ( solution , enabler , false ) ;
137
+ setSolutionPropEnabled ( solution , enabler , false ) ;
138
+ } ,
146
139
147
- unlock || typeof unlock === 'undefined' ?
148
- solutionConfiguration . removeClass ( 'disabled' ) . removeAttr ( 'disabled' ) :
149
- solutionConfiguration . addClass ( 'disabled' ) . attr ( 'disabled' , 'disabled' ) ;
150
- } ,
140
+ /**
141
+ * Set solution as enabled
142
+ *
143
+ * @param {* } solution
144
+ * @param {String } enabler
145
+ */
146
+ enableSolution = function ( solution , enabler ) {
147
+ setSolutionUsedefaultEnabled ( solution , enabler ) ;
148
+ setSolutionPropEnabled ( solution , enabler ) ;
149
+ setSolutionSelectEnabled ( solution , enabler ) ;
150
+ setSolutionMarkEnabled ( solution , enabler ) ;
151
+ } ,
151
152
152
- /**
153
- * Set/unset solution usedefault checkbox
154
- *
155
- * @param {* } solution
156
- * @param {String } enabler
157
- * @param {Boolean } checked
158
- */
159
- setSolutionUsedefaultEnabled = function ( solution , enabler , checked ) {
160
- checked = ! ( checked || typeof checked === 'undefined' ) ;
153
+ /**
154
+ * Lock/unlock solution configuration button
155
+ *
156
+ * @param {* } solution
157
+ * @param {String } buttonConfiguration
158
+ * @param {Boolean } unlock
159
+ */
160
+ setSolutionConfigurationUnlock = function ( solution , buttonConfiguration , unlock ) {
161
+ var solutionConfiguration = solution . find ( buttonConfiguration ) ;
161
162
162
- solution . find ( 'input[id="' + solution . find ( enabler ) . attr ( 'id' ) + '_inherit"]' )
163
- . prop ( 'checked' , checked ) ;
164
- } ,
163
+ unlock || typeof unlock === 'undefined' ?
164
+ solutionConfiguration . removeClass ( 'disabled' ) . removeAttr ( 'disabled' ) :
165
+ solutionConfiguration . addClass ( 'disabled' ) . attr ( 'disabled' , 'disabled' ) ;
166
+ } ,
165
167
166
- /**
167
- * Forward solution select-enabler changes
168
- *
169
- * @param {* } solution
170
- * @param {String } enabler
171
- */
172
- forwardSolutionChange = function ( solution , enabler ) {
173
- solution . find ( enabler ) . change ( ) ;
174
- } ,
168
+ /**
169
+ * Forward solution select-enabler changes
170
+ *
171
+ * @param {* } solution
172
+ * @param {String } enabler
173
+ */
174
+ forwardSolutionChange = function ( solution , enabler ) {
175
+ solution . find ( enabler ) . change ( ) ;
176
+ } ,
175
177
176
- /**
177
- * Show/hide dependent fields
178
- *
179
- * @param {* } solution
180
- * @param {String } identifier
181
- * @param {Boolean } show
182
- */
183
- showDependsField = function ( solution , identifier , show ) {
184
- show = show || typeof show === 'undefined' ;
178
+ /**
179
+ * Show/hide dependent fields
180
+ *
181
+ * @param {* } solution
182
+ * @param {String } identifier
183
+ * @param {Boolean } show
184
+ */
185
+ showDependsField = function ( solution , identifier , show ) {
186
+ show = show || typeof show === 'undefined' ;
185
187
186
- solution . find ( identifier ) . toggle ( show ) ;
187
- solution . find ( identifier ) . closest ( 'tr' ) . toggle ( show ) ;
188
- solution . find ( identifier ) . attr ( 'disabled' , ! show ) ;
189
- } ;
188
+ solution . find ( identifier ) . toggle ( show ) ;
189
+ solution . find ( identifier ) . closest ( 'tr' ) . toggle ( show ) ;
190
+ solution . find ( identifier ) . attr ( 'disabled' , ! show ) ;
191
+ } ;
190
192
191
193
return Class . extend ( {
192
194
defaults : {
0 commit comments