less-rails-semantic_ui 1.6.2.0 → 1.7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/assets/javascripts/semantic_ui/definitions/behaviors/api.js +9 -9
- data/assets/javascripts/semantic_ui/definitions/behaviors/form.js +23 -23
- data/assets/javascripts/semantic_ui/definitions/behaviors/state.js +6 -6
- data/assets/javascripts/semantic_ui/definitions/behaviors/visibility.js +3 -3
- data/assets/javascripts/semantic_ui/definitions/behaviors/visit.js +7 -7
- data/assets/javascripts/semantic_ui/definitions/globals/site.js +2 -2
- data/assets/javascripts/semantic_ui/definitions/modules/accordion.js +12 -12
- data/assets/javascripts/semantic_ui/definitions/modules/checkbox.js +14 -13
- data/assets/javascripts/semantic_ui/definitions/modules/dimmer.js +9 -9
- data/assets/javascripts/semantic_ui/definitions/modules/dropdown.js +98 -58
- data/assets/javascripts/semantic_ui/definitions/modules/modal.js +14 -14
- data/assets/javascripts/semantic_ui/definitions/modules/popup.js +90 -39
- data/assets/javascripts/semantic_ui/definitions/modules/progress.js +12 -6
- data/assets/javascripts/semantic_ui/definitions/modules/rating.js +6 -6
- data/assets/javascripts/semantic_ui/definitions/modules/search.js +216 -205
- data/assets/javascripts/semantic_ui/definitions/modules/shape.js +8 -8
- data/assets/javascripts/semantic_ui/definitions/modules/sidebar.js +112 -89
- data/assets/javascripts/semantic_ui/definitions/modules/sticky.js +11 -11
- data/assets/javascripts/semantic_ui/definitions/modules/tab.js +12 -12
- data/assets/javascripts/semantic_ui/definitions/modules/transition.js +9 -9
- data/assets/javascripts/semantic_ui/definitions/modules/video.js +4 -4
- data/assets/stylesheets/semantic_ui/definitions/collections/grid.less +65 -10
- data/assets/stylesheets/semantic_ui/definitions/collections/menu.less +10 -6
- data/assets/stylesheets/semantic_ui/definitions/elements/button.less +54 -55
- data/assets/stylesheets/semantic_ui/definitions/elements/label.less +4 -4
- data/assets/stylesheets/semantic_ui/definitions/elements/list.less +4 -2
- data/assets/stylesheets/semantic_ui/definitions/elements/segment.less +0 -7
- data/assets/stylesheets/semantic_ui/definitions/elements/step.less +41 -40
- data/assets/stylesheets/semantic_ui/definitions/globals/site.less +19 -0
- data/assets/stylesheets/semantic_ui/definitions/modules/dropdown.less +108 -23
- data/assets/stylesheets/semantic_ui/definitions/modules/popup.less +0 -2
- data/assets/stylesheets/semantic_ui/definitions/modules/sidebar.less +109 -27
- data/assets/stylesheets/semantic_ui/themes/default/collections/menu.variables +3 -0
- data/assets/stylesheets/semantic_ui/themes/default/elements/button.variables +24 -0
- data/assets/stylesheets/semantic_ui/themes/default/globals/site.variables +5 -2
- data/assets/stylesheets/semantic_ui/themes/default/modules/dropdown.variables +22 -6
- data/assets/stylesheets/semantic_ui/themes/default/modules/sidebar.variables +21 -12
- data/assets/stylesheets/semantic_ui/themes/material/elements/button.overrides +0 -4
- data/assets/stylesheets/semantic_ui/themes/rtl/globals/site.overrides +6 -0
- data/assets/stylesheets/semantic_ui/themes/rtl/globals/site.variables +14 -0
- data/lib/less/rails/semantic_ui/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0820661de8ba53ee227f0ac697dddb36c83fba1
|
4
|
+
data.tar.gz: 98664a2d0866433be37c04e75dc25c7d13fc92ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 851d20f635a22e609c9d3c69240662ab0a318836d1e083297f05d33d69ad4c58e193a48f5461c16813fa0ca5311b2f3c8a5e78282f446be9f55148b213af31f2
|
7
|
+
data.tar.gz: 00fcef7942a600ed8355c6b75b6aa6366b47c285d690832012f673a1aef27d45e0b6d390c512c474097a2b3c93b297fe20b1bd67c7aab14f123b53483a7727ec
|
@@ -198,7 +198,7 @@ $.api = $.fn.api = function(parameters) {
|
|
198
198
|
|
199
199
|
is: {
|
200
200
|
disabled: function() {
|
201
|
-
return ($module.filter(settings.filter).
|
201
|
+
return ($module.filter(settings.filter).length > 0);
|
202
202
|
},
|
203
203
|
loading: function() {
|
204
204
|
return (module.request && module.request.state() == 'pending');
|
@@ -342,7 +342,7 @@ $.api = $.fn.api = function(parameters) {
|
|
342
342
|
request: {
|
343
343
|
complete: function(response) {
|
344
344
|
module.remove.loading();
|
345
|
-
|
345
|
+
settings.onComplete.call(context, response, $module);
|
346
346
|
},
|
347
347
|
done: function(response) {
|
348
348
|
module.debug('API Response Received', response);
|
@@ -350,19 +350,19 @@ $.api = $.fn.api = function(parameters) {
|
|
350
350
|
if( $.isFunction(settings.successTest) ) {
|
351
351
|
module.debug('Checking JSON returned success', settings.successTest, response);
|
352
352
|
if( settings.successTest(response) ) {
|
353
|
-
|
353
|
+
settings.onSuccess.call(context, response, $module);
|
354
354
|
}
|
355
355
|
else {
|
356
356
|
module.debug('JSON test specified by user and response failed', response);
|
357
|
-
|
357
|
+
settings.onFailure.call(context, response, $module);
|
358
358
|
}
|
359
359
|
}
|
360
360
|
else {
|
361
|
-
|
361
|
+
settings.onSuccess.call(context, response, $module);
|
362
362
|
}
|
363
363
|
}
|
364
364
|
else {
|
365
|
-
|
365
|
+
settings.onSuccess.call(context, response, $module);
|
366
366
|
}
|
367
367
|
},
|
368
368
|
error: function(xhr, status, httpMessage) {
|
@@ -401,10 +401,10 @@ $.api = $.fn.api = function(parameters) {
|
|
401
401
|
setTimeout(module.remove.error, settings.errorDuration);
|
402
402
|
}
|
403
403
|
module.debug('API Request error:', errorMessage);
|
404
|
-
|
404
|
+
settings.onError.call(context, errorMessage, $module);
|
405
405
|
}
|
406
406
|
else {
|
407
|
-
|
407
|
+
settings.onAbort.call(context, errorMessage, $module);
|
408
408
|
module.debug('Request Aborted (Most likely caused by page change or CORS Policy)', status, httpMessage);
|
409
409
|
}
|
410
410
|
}
|
@@ -462,7 +462,7 @@ $.api = $.fn.api = function(parameters) {
|
|
462
462
|
var
|
463
463
|
runSettings
|
464
464
|
;
|
465
|
-
runSettings =
|
465
|
+
runSettings = settings.beforeSend.call($module, settings);
|
466
466
|
if(runSettings) {
|
467
467
|
if(runSettings.success !== undefined) {
|
468
468
|
module.debug('Legacy success callback detected', runSettings);
|
@@ -161,7 +161,7 @@ $.fn.form = function(fields, parameters) {
|
|
161
161
|
.blur()
|
162
162
|
;
|
163
163
|
}
|
164
|
-
if(!event.ctrlKey && key == keyCode.enter && $field.is(selector.input) && $field.not(selector.checkbox).
|
164
|
+
if(!event.ctrlKey && key == keyCode.enter && $field.is(selector.input) && $field.not(selector.checkbox).length > 0 ) {
|
165
165
|
module.debug('Enter key pressed, submitting form');
|
166
166
|
$submit
|
167
167
|
.addClass(className.down)
|
@@ -222,13 +222,13 @@ $.fn.form = function(fields, parameters) {
|
|
222
222
|
},
|
223
223
|
field: function(identifier) {
|
224
224
|
module.verbose('Finding field with identifier', identifier);
|
225
|
-
if( $field.filter('#' + identifier).
|
225
|
+
if( $field.filter('#' + identifier).length > 0 ) {
|
226
226
|
return $field.filter('#' + identifier);
|
227
227
|
}
|
228
|
-
else if( $field.filter('[name="' + identifier +'"]').
|
228
|
+
else if( $field.filter('[name="' + identifier +'"]').length > 0 ) {
|
229
229
|
return $field.filter('[name="' + identifier +'"]');
|
230
230
|
}
|
231
|
-
else if( $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]').
|
231
|
+
else if( $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]').length > 0 ) {
|
232
232
|
return $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]');
|
233
233
|
}
|
234
234
|
return $('<input/>');
|
@@ -250,13 +250,13 @@ $.fn.form = function(fields, parameters) {
|
|
250
250
|
|
251
251
|
field: function(identifier) {
|
252
252
|
module.verbose('Checking for existence of a field with identifier', identifier);
|
253
|
-
if( $field.filter('#' + identifier).
|
253
|
+
if( $field.filter('#' + identifier).length > 0 ) {
|
254
254
|
return true;
|
255
255
|
}
|
256
|
-
else if( $field.filter('[name="' + identifier +'"]').
|
256
|
+
else if( $field.filter('[name="' + identifier +'"]').length > 0 ) {
|
257
257
|
return true;
|
258
258
|
}
|
259
|
-
else if( $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]').
|
259
|
+
else if( $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]').length > 0 ) {
|
260
260
|
return true;
|
261
261
|
}
|
262
262
|
return false;
|
@@ -269,8 +269,8 @@ $.fn.form = function(fields, parameters) {
|
|
269
269
|
var
|
270
270
|
$field = module.get.field(identifier),
|
271
271
|
$fieldGroup = $field.closest($group),
|
272
|
-
$prompt = $fieldGroup.
|
273
|
-
promptExists = ($prompt.
|
272
|
+
$prompt = $fieldGroup.children(selector.prompt),
|
273
|
+
promptExists = ($prompt.length !== 0)
|
274
274
|
;
|
275
275
|
errors = (typeof errors == 'string')
|
276
276
|
? [errors]
|
@@ -320,7 +320,7 @@ $.fn.form = function(fields, parameters) {
|
|
320
320
|
var
|
321
321
|
$field = module.get.field(field.identifier),
|
322
322
|
$fieldGroup = $field.closest($group),
|
323
|
-
$prompt = $fieldGroup.
|
323
|
+
$prompt = $fieldGroup.children(selector.prompt)
|
324
324
|
;
|
325
325
|
$fieldGroup
|
326
326
|
.removeClass(className.error)
|
@@ -375,7 +375,7 @@ $.fn.form = function(fields, parameters) {
|
|
375
375
|
if(allValid) {
|
376
376
|
module.debug('Form has no validation errors, submitting');
|
377
377
|
module.set.success();
|
378
|
-
return
|
378
|
+
return settings.onSuccess.call(element, event);
|
379
379
|
}
|
380
380
|
else {
|
381
381
|
module.debug('Form has errors');
|
@@ -387,7 +387,7 @@ $.fn.form = function(fields, parameters) {
|
|
387
387
|
if($module.data('moduleApi') !== undefined) {
|
388
388
|
event.stopImmediatePropagation();
|
389
389
|
}
|
390
|
-
return
|
390
|
+
return settings.onFailure.call(element, formErrors);
|
391
391
|
}
|
392
392
|
},
|
393
393
|
|
@@ -417,12 +417,12 @@ $.fn.form = function(fields, parameters) {
|
|
417
417
|
}
|
418
418
|
if(fieldValid) {
|
419
419
|
module.remove.prompt(field, fieldErrors);
|
420
|
-
|
420
|
+
settings.onValid.call($field);
|
421
421
|
}
|
422
422
|
else {
|
423
423
|
formErrors = formErrors.concat(fieldErrors);
|
424
424
|
module.add.prompt(field.identifier, fieldErrors);
|
425
|
-
|
425
|
+
settings.onInvalid.call($field, fieldErrors);
|
426
426
|
return false;
|
427
427
|
}
|
428
428
|
return true;
|
@@ -445,11 +445,11 @@ $.fn.form = function(fields, parameters) {
|
|
445
445
|
if(bracket !== undefined && bracket !== null) {
|
446
446
|
ancillary = '' + bracket[1];
|
447
447
|
functionType = type.replace(bracket[0], '');
|
448
|
-
isValid =
|
448
|
+
isValid = settings.rules[functionType].call(element, value, ancillary);
|
449
449
|
}
|
450
450
|
// normal notation
|
451
451
|
else {
|
452
|
-
isValid =
|
452
|
+
isValid = settings.rules[type].call($field, value);
|
453
453
|
}
|
454
454
|
return isValid;
|
455
455
|
}
|
@@ -539,8 +539,8 @@ $.fn.form = function(fields, parameters) {
|
|
539
539
|
if(moduleSelector) {
|
540
540
|
title += ' \'' + moduleSelector + '\'';
|
541
541
|
}
|
542
|
-
if($allModules.
|
543
|
-
title += ' ' + '(' + $allModules.
|
542
|
+
if($allModules.length > 1) {
|
543
|
+
title += ' ' + '(' + $allModules.length + ')';
|
544
544
|
}
|
545
545
|
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
546
546
|
console.groupCollapsed(title);
|
@@ -669,7 +669,7 @@ $.fn.form.settings = {
|
|
669
669
|
group : '.field',
|
670
670
|
checkbox: 'input[type="checkbox"], input[type="radio"]',
|
671
671
|
input : 'input',
|
672
|
-
prompt : '.prompt',
|
672
|
+
prompt : '.prompt.label',
|
673
673
|
submit : '.submit'
|
674
674
|
},
|
675
675
|
|
@@ -707,7 +707,7 @@ $.fn.form.settings = {
|
|
707
707
|
|
708
708
|
// checkbox checked
|
709
709
|
checked: function() {
|
710
|
-
return ($(this).filter(':checked').
|
710
|
+
return ($(this).filter(':checked').length > 0);
|
711
711
|
},
|
712
712
|
|
713
713
|
// value contains (text)
|
@@ -781,13 +781,13 @@ $.fn.form.settings = {
|
|
781
781
|
$form = $(this),
|
782
782
|
matchingValue
|
783
783
|
;
|
784
|
-
if($form.find('#' + fieldIdentifier).
|
784
|
+
if($form.find('#' + fieldIdentifier).length > 0) {
|
785
785
|
matchingValue = $form.find('#' + fieldIdentifier).val();
|
786
786
|
}
|
787
|
-
else if($form.find('[name="' + fieldIdentifier +'"]').
|
787
|
+
else if($form.find('[name="' + fieldIdentifier +'"]').length > 0) {
|
788
788
|
matchingValue = $form.find('[name="' + fieldIdentifier + '"]').val();
|
789
789
|
}
|
790
|
-
else if( $form.find('[data-validate="'+ fieldIdentifier +'"]').
|
790
|
+
else if( $form.find('[data-validate="'+ fieldIdentifier +'"]').length > 0 ) {
|
791
791
|
matchingValue = $form.find('[data-validate="'+ fieldIdentifier +'"]').val();
|
792
792
|
}
|
793
793
|
return (matchingValue !== undefined)
|
@@ -252,7 +252,7 @@ $.fn.state = function(parameters) {
|
|
252
252
|
if(settings.sync) {
|
253
253
|
module.sync();
|
254
254
|
}
|
255
|
-
|
255
|
+
settings.onChange.call(element);
|
256
256
|
},
|
257
257
|
|
258
258
|
text: function() {
|
@@ -287,24 +287,24 @@ $.fn.state = function(parameters) {
|
|
287
287
|
},
|
288
288
|
|
289
289
|
activate: function() {
|
290
|
-
if(
|
290
|
+
if( settings.activateTest.call(element) ) {
|
291
291
|
module.debug('Setting state to active');
|
292
292
|
$module
|
293
293
|
.addClass(className.active)
|
294
294
|
;
|
295
295
|
module.update.text(text.active);
|
296
|
-
|
296
|
+
settings.onActivate.call(element);
|
297
297
|
}
|
298
298
|
},
|
299
299
|
|
300
300
|
deactivate: function() {
|
301
|
-
if(
|
301
|
+
if( settings.deactivateTest.call(element) ) {
|
302
302
|
module.debug('Setting state to inactive');
|
303
303
|
$module
|
304
304
|
.removeClass(className.active)
|
305
305
|
;
|
306
306
|
module.update.text(text.inactive);
|
307
|
-
|
307
|
+
settings.onDeactivate.call(element);
|
308
308
|
}
|
309
309
|
},
|
310
310
|
|
@@ -347,7 +347,7 @@ $.fn.state = function(parameters) {
|
|
347
347
|
module.update.text(text);
|
348
348
|
setTimeout(function(){
|
349
349
|
module.update.text(previousText);
|
350
|
-
|
350
|
+
callback.call(element);
|
351
351
|
}, duration);
|
352
352
|
}
|
353
353
|
},
|
@@ -241,7 +241,7 @@ $.fn.visibility = function(parameters) {
|
|
241
241
|
module.reset();
|
242
242
|
module.save.position();
|
243
243
|
module.checkVisibility();
|
244
|
-
|
244
|
+
settings.onRefresh.call(element);
|
245
245
|
},
|
246
246
|
|
247
247
|
reset: function() {
|
@@ -529,11 +529,11 @@ $.fn.visibility = function(parameters) {
|
|
529
529
|
if(callback) {
|
530
530
|
if(settings.continuous) {
|
531
531
|
module.debug('Callback being called continuously', callbackName, calculations);
|
532
|
-
|
532
|
+
callback.call(element, calculations, screen);
|
533
533
|
}
|
534
534
|
else if(!module.get.occurred(callbackName)) {
|
535
535
|
module.debug('Conditions met', callbackName, calculations);
|
536
|
-
|
536
|
+
callback.call(element, calculations, screen);
|
537
537
|
}
|
538
538
|
}
|
539
539
|
module.save.occurred(callbackName);
|
@@ -197,9 +197,9 @@ $.visit = $.fn.visit = function(parameters) {
|
|
197
197
|
var
|
198
198
|
$element = $(selector)
|
199
199
|
;
|
200
|
-
if($element.
|
200
|
+
if($element.length > 0 && !$.isWindow($element[0])) {
|
201
201
|
module.debug('Updating visit count for element', $element);
|
202
|
-
$displays = ($displays.
|
202
|
+
$displays = ($displays.length > 0)
|
203
203
|
? $displays.add($element)
|
204
204
|
: $element
|
205
205
|
;
|
@@ -233,10 +233,10 @@ $.visit = $.fn.visit = function(parameters) {
|
|
233
233
|
if(settings.limit) {
|
234
234
|
if(value >= settings.limit) {
|
235
235
|
module.debug('Pages viewed exceeded limit, firing callback', value, settings.limit);
|
236
|
-
|
236
|
+
settings.onLimit.call(element, value);
|
237
237
|
}
|
238
238
|
module.debug('Limit not reached', value, settings.limit);
|
239
|
-
|
239
|
+
settings.onChange.call(element, value);
|
240
240
|
}
|
241
241
|
module.update.display(value);
|
242
242
|
}
|
@@ -245,7 +245,7 @@ $.visit = $.fn.visit = function(parameters) {
|
|
245
245
|
update: {
|
246
246
|
display: function(value) {
|
247
247
|
value = value || module.get.count();
|
248
|
-
if($displays.
|
248
|
+
if($displays.length > 0) {
|
249
249
|
module.debug('Updating displayed view count', $displays);
|
250
250
|
$displays.html(value);
|
251
251
|
}
|
@@ -379,8 +379,8 @@ $.visit = $.fn.visit = function(parameters) {
|
|
379
379
|
if(moduleSelector) {
|
380
380
|
title += ' \'' + moduleSelector + '\'';
|
381
381
|
}
|
382
|
-
if($allModules.
|
383
|
-
title += ' ' + '(' + $allModules.
|
382
|
+
if($allModules.length > 1) {
|
383
|
+
title += ' ' + '(' + $allModules.length + ')';
|
384
384
|
}
|
385
385
|
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
386
386
|
console.groupCollapsed(title);
|
@@ -150,7 +150,7 @@ $.site = $.fn.site = function(parameters) {
|
|
150
150
|
$.fn[name].settings[setting] = value;
|
151
151
|
if(modifyExisting && namespace) {
|
152
152
|
$existingModules = $(':data(module-' + namespace + ')');
|
153
|
-
if($existingModules.
|
153
|
+
if($existingModules.length > 0) {
|
154
154
|
module.verbose('Modifying existing settings', $existingModules);
|
155
155
|
$existingModules[name]('setting', setting, value);
|
156
156
|
}
|
@@ -176,7 +176,7 @@ $.site = $.fn.site = function(parameters) {
|
|
176
176
|
$.extend(true, $.fn[name].settings, newSettings);
|
177
177
|
if(modifyExisting && namespace) {
|
178
178
|
$existingModules = $(':data(module-' + namespace + ')');
|
179
|
-
if($existingModules.
|
179
|
+
if($existingModules.length > 0) {
|
180
180
|
module.verbose('Modifying existing settings', $existingModules);
|
181
181
|
$existingModules[name]('setting', newSettings);
|
182
182
|
}
|
@@ -108,7 +108,7 @@ $.fn.accordion = function(parameters) {
|
|
108
108
|
|
109
109
|
event: {
|
110
110
|
click: function() {
|
111
|
-
|
111
|
+
module.toggle.call(this);
|
112
112
|
}
|
113
113
|
},
|
114
114
|
|
@@ -125,14 +125,14 @@ $.fn.accordion = function(parameters) {
|
|
125
125
|
module.debug('Toggling visibility of content', $activeTitle);
|
126
126
|
if(contentIsOpen) {
|
127
127
|
if(settings.collapsible) {
|
128
|
-
|
128
|
+
module.close.call($activeTitle);
|
129
129
|
}
|
130
130
|
else {
|
131
131
|
module.debug('Cannot close accordion content collapsing is disabled');
|
132
132
|
}
|
133
133
|
}
|
134
134
|
else {
|
135
|
-
|
135
|
+
module.open.call($activeTitle);
|
136
136
|
}
|
137
137
|
},
|
138
138
|
|
@@ -150,7 +150,7 @@ $.fn.accordion = function(parameters) {
|
|
150
150
|
if(!currentlyAnimating && !currentlyActive) {
|
151
151
|
module.debug('Opening accordion content', $activeTitle);
|
152
152
|
if(settings.exclusive) {
|
153
|
-
|
153
|
+
module.closeOthers.call($activeTitle);
|
154
154
|
}
|
155
155
|
$activeTitle
|
156
156
|
.addClass(className.active)
|
@@ -184,9 +184,9 @@ $.fn.accordion = function(parameters) {
|
|
184
184
|
$activeContent
|
185
185
|
.addClass(className.active)
|
186
186
|
;
|
187
|
-
|
188
|
-
|
189
|
-
|
187
|
+
module.reset.display.call(this);
|
188
|
+
settings.onOpen.call(this);
|
189
|
+
settings.onChange.call(this);
|
190
190
|
})
|
191
191
|
;
|
192
192
|
}
|
@@ -237,9 +237,9 @@ $.fn.accordion = function(parameters) {
|
|
237
237
|
$activeContent
|
238
238
|
.stop()
|
239
239
|
.slideUp(settings.duration, settings.easing, function() {
|
240
|
-
|
241
|
-
|
242
|
-
|
240
|
+
module.reset.display.call(this);
|
241
|
+
settings.onClose.call(this);
|
242
|
+
settings.onChange.call(this);
|
243
243
|
})
|
244
244
|
;
|
245
245
|
}
|
@@ -268,7 +268,7 @@ $.fn.accordion = function(parameters) {
|
|
268
268
|
$openTitles = $openTitles.not($nestedTitles);
|
269
269
|
$openContents = $openTitles.next($content);
|
270
270
|
}
|
271
|
-
if( ($openTitles.
|
271
|
+
if( ($openTitles.length > 0) ) {
|
272
272
|
module.debug('Exclusive enabled, closing other content', $openTitles);
|
273
273
|
$openTitles
|
274
274
|
.removeClass(className.active)
|
@@ -300,7 +300,7 @@ $.fn.accordion = function(parameters) {
|
|
300
300
|
.stop()
|
301
301
|
.slideUp(settings.duration , settings.easing, function() {
|
302
302
|
$(this).removeClass(className.active);
|
303
|
-
|
303
|
+
module.reset.display.call(this);
|
304
304
|
})
|
305
305
|
;
|
306
306
|
}
|
@@ -62,13 +62,13 @@ $.fn.checkbox = function(parameters) {
|
|
62
62
|
if( module.is.checked() ) {
|
63
63
|
module.set.checked();
|
64
64
|
if(settings.fireOnInit) {
|
65
|
-
|
65
|
+
settings.onChecked.call($input.get());
|
66
66
|
}
|
67
67
|
}
|
68
68
|
else {
|
69
69
|
module.remove.checked();
|
70
70
|
if(settings.fireOnInit) {
|
71
|
-
|
71
|
+
settings.onUnchecked.call($input.get());
|
72
72
|
}
|
73
73
|
}
|
74
74
|
module.observeChanges();
|
@@ -120,7 +120,7 @@ $.fn.checkbox = function(parameters) {
|
|
120
120
|
? module[event]
|
121
121
|
: module.toggle
|
122
122
|
;
|
123
|
-
if($element.
|
123
|
+
if($element.length > 0) {
|
124
124
|
module.debug('Attaching checkbox events to element', selector, event);
|
125
125
|
$element
|
126
126
|
.on('click' + eventNamespace, event)
|
@@ -137,6 +137,7 @@ $.fn.checkbox = function(parameters) {
|
|
137
137
|
key = event.which,
|
138
138
|
keyCode = {
|
139
139
|
enter : 13,
|
140
|
+
space : 32,
|
140
141
|
escape : 27
|
141
142
|
}
|
142
143
|
;
|
@@ -146,9 +147,9 @@ $.fn.checkbox = function(parameters) {
|
|
146
147
|
.blur()
|
147
148
|
;
|
148
149
|
}
|
149
|
-
if(!event.ctrlKey && key == keyCode.enter) {
|
150
|
+
if(!event.ctrlKey && (key == keyCode.enter || key == keyCode.space)) {
|
150
151
|
module.verbose('Enter key pressed, toggling checkbox');
|
151
|
-
|
152
|
+
module.toggle.call(this);
|
152
153
|
event.preventDefault();
|
153
154
|
}
|
154
155
|
}
|
@@ -193,7 +194,7 @@ $.fn.checkbox = function(parameters) {
|
|
193
194
|
|
194
195
|
create: {
|
195
196
|
label: function() {
|
196
|
-
if($input.prevAll(selector.label).
|
197
|
+
if($input.prevAll(selector.label).length > 0) {
|
197
198
|
$input.prev(selector.label).detach().insertAfter($input);
|
198
199
|
module.debug('Moving existing label', $label);
|
199
200
|
}
|
@@ -206,7 +207,7 @@ $.fn.checkbox = function(parameters) {
|
|
206
207
|
|
207
208
|
has: {
|
208
209
|
label: function() {
|
209
|
-
return ($label.
|
210
|
+
return ($label.length > 0);
|
210
211
|
}
|
211
212
|
},
|
212
213
|
|
@@ -243,14 +244,14 @@ $.fn.checkbox = function(parameters) {
|
|
243
244
|
module.debug('Enabling checkbox functionality');
|
244
245
|
$module.removeClass(className.disabled);
|
245
246
|
$input.prop('disabled', false);
|
246
|
-
|
247
|
+
settings.onEnabled.call($input.get());
|
247
248
|
},
|
248
249
|
|
249
250
|
disable: function() {
|
250
251
|
module.debug('Disabling checkbox functionality');
|
251
252
|
$module.addClass(className.disabled);
|
252
253
|
$input.prop('disabled', 'disabled');
|
253
|
-
|
254
|
+
settings.onDisabled.call($input.get());
|
254
255
|
},
|
255
256
|
|
256
257
|
check: function() {
|
@@ -260,8 +261,8 @@ $.fn.checkbox = function(parameters) {
|
|
260
261
|
.trigger('change')
|
261
262
|
;
|
262
263
|
module.set.checked();
|
263
|
-
|
264
|
-
|
264
|
+
settings.onChange.call($input.get());
|
265
|
+
settings.onChecked.call($input.get());
|
265
266
|
},
|
266
267
|
|
267
268
|
uncheck: function() {
|
@@ -271,8 +272,8 @@ $.fn.checkbox = function(parameters) {
|
|
271
272
|
.trigger('change')
|
272
273
|
;
|
273
274
|
module.remove.checked();
|
274
|
-
|
275
|
-
|
275
|
+
settings.onChange.call($input.get());
|
276
|
+
settings.onUnchecked.call($input.get());
|
276
277
|
},
|
277
278
|
|
278
279
|
toggle: function(event) {
|