less-rails-semantic_ui 2.2.10.0 → 2.2.11.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/fonts/semantic_ui/themes/material/assets/fonts/icons.woff2 +0 -0
- data/assets/javascripts/semantic_ui/definitions/behaviors/form.js +119 -19
- data/assets/javascripts/semantic_ui/definitions/modules/dropdown.js +108 -50
- data/assets/javascripts/semantic_ui/definitions/modules/modal.js +41 -16
- data/assets/javascripts/semantic_ui/definitions/modules/popup.js +42 -31
- data/assets/javascripts/semantic_ui/definitions/modules/search.js +11 -2
- data/assets/javascripts/semantic_ui/definitions/modules/sidebar.js +1 -4
- data/assets/javascripts/semantic_ui/definitions/modules/sticky.js +22 -5
- data/assets/stylesheets/semantic_ui/definitions/collections/form.less +43 -43
- data/assets/stylesheets/semantic_ui/definitions/collections/menu.less +8 -0
- data/assets/stylesheets/semantic_ui/definitions/collections/message.less +3 -0
- data/assets/stylesheets/semantic_ui/definitions/collections/table.less +1 -1
- data/assets/stylesheets/semantic_ui/definitions/elements/icon.less +24 -0
- data/assets/stylesheets/semantic_ui/definitions/elements/input.less +3 -2
- data/assets/stylesheets/semantic_ui/definitions/elements/segment.less +13 -13
- data/assets/stylesheets/semantic_ui/definitions/elements/step.less +34 -34
- data/assets/stylesheets/semantic_ui/definitions/globals/site.less +44 -3
- data/assets/stylesheets/semantic_ui/definitions/modules/dimmer.less +18 -1
- data/assets/stylesheets/semantic_ui/definitions/modules/dropdown.less +63 -30
- data/assets/stylesheets/semantic_ui/definitions/modules/modal.less +81 -0
- data/assets/stylesheets/semantic_ui/definitions/modules/sidebar.less +0 -10
- data/assets/stylesheets/semantic_ui/themes/default/globals/reset.overrides +216 -198
- data/assets/stylesheets/semantic_ui/themes/default/globals/site.variables +24 -0
- data/assets/stylesheets/semantic_ui/themes/default/modules/dropdown.variables +7 -5
- data/assets/stylesheets/semantic_ui/themes/default/modules/modal.variables +32 -1
- data/lib/generators/semantic_ui/install/templates/config/collections/menu.overrides +1 -1
- data/lib/less/rails/semantic_ui/version.rb +1 -1
- metadata +8 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d477837a7be01ca7239764a19594ac8d1194f963
|
4
|
+
data.tar.gz: c6c168faa6f43180f91e61884c9ae231adcc6301
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a9721ac19d26e54823071fdf0bb52d343c3f3239910b526377747b3bf168ac8a2fe79573e5c7f6629e79d0f1340efb159ecd6b9ed8bdea02437bef32eafc9a4a
|
7
|
+
data.tar.gz: a267be9c25cb2db24cbea2d452d8da9b1b25ddf0593ec6275e1de83f3fd90673007a3e43bde4e2dc74dafa8e6d289ddb270ed7f7e3ab76a7353f154d96e3715c
|
Binary file
|
@@ -252,6 +252,17 @@ $.fn.form = function(parameters) {
|
|
252
252
|
bracketedRule: function(rule) {
|
253
253
|
return (rule.type && rule.type.match(settings.regExp.bracket));
|
254
254
|
},
|
255
|
+
shorthandFields: function(fields) {
|
256
|
+
var
|
257
|
+
fieldKeys = Object.keys(fields),
|
258
|
+
firstRule = fields[fieldKeys[0]]
|
259
|
+
;
|
260
|
+
return module.is.shorthandRules(firstRule);
|
261
|
+
},
|
262
|
+
// duck type rule test
|
263
|
+
shorthandRules: function(rules) {
|
264
|
+
return (typeof rules == 'string' || $.isArray(rules));
|
265
|
+
},
|
255
266
|
empty: function($field) {
|
256
267
|
if(!$field || $field.length === 0) {
|
257
268
|
return true;
|
@@ -403,6 +414,23 @@ $.fn.form = function(parameters) {
|
|
403
414
|
: 'keyup'
|
404
415
|
;
|
405
416
|
},
|
417
|
+
fieldsFromShorthand: function(fields) {
|
418
|
+
var
|
419
|
+
fullFields = {}
|
420
|
+
;
|
421
|
+
$.each(fields, function(name, rules) {
|
422
|
+
if(typeof rules == 'string') {
|
423
|
+
rules = [rules];
|
424
|
+
}
|
425
|
+
fullFields[name] = {
|
426
|
+
rules: []
|
427
|
+
};
|
428
|
+
$.each(rules, function(index, rule) {
|
429
|
+
fullFields[name].rules.push({ type: rule });
|
430
|
+
});
|
431
|
+
});
|
432
|
+
return fullFields;
|
433
|
+
},
|
406
434
|
prompt: function(rule, field) {
|
407
435
|
var
|
408
436
|
ruleName = module.get.ruleName(rule),
|
@@ -453,23 +481,9 @@ $.fn.form = function(parameters) {
|
|
453
481
|
}
|
454
482
|
else {
|
455
483
|
// 2.x
|
456
|
-
if(parameters.fields) {
|
457
|
-
|
458
|
-
if( typeof parameters.fields[ruleKeys[0]] == 'string' || $.isArray(parameters.fields[ruleKeys[0]]) ) {
|
459
|
-
$.each(parameters.fields, function(name, rules) {
|
460
|
-
if(typeof rules == 'string') {
|
461
|
-
rules = [rules];
|
462
|
-
}
|
463
|
-
parameters.fields[name] = {
|
464
|
-
rules: []
|
465
|
-
};
|
466
|
-
$.each(rules, function(index, rule) {
|
467
|
-
parameters.fields[name].rules.push({ type: rule });
|
468
|
-
});
|
469
|
-
});
|
470
|
-
}
|
484
|
+
if(parameters.fields && module.is.shorthandFields(parameters.fields)) {
|
485
|
+
parameters.fields = module.get.fieldsFromShorthand(parameters.fields);
|
471
486
|
}
|
472
|
-
|
473
487
|
settings = $.extend(true, {}, $.fn.form.settings, parameters);
|
474
488
|
validation = $.extend({}, $.fn.form.settings.defaults, settings.fields);
|
475
489
|
module.verbose('Extending settings', validation, settings);
|
@@ -589,8 +603,11 @@ $.fn.form = function(parameters) {
|
|
589
603
|
}
|
590
604
|
else {
|
591
605
|
if(isRadio) {
|
592
|
-
if(
|
593
|
-
values[name] =
|
606
|
+
if(values[name] === undefined) {
|
607
|
+
values[name] = (isChecked)
|
608
|
+
? true
|
609
|
+
: false
|
610
|
+
;
|
594
611
|
}
|
595
612
|
}
|
596
613
|
else if(isCheckbox) {
|
@@ -641,6 +658,44 @@ $.fn.form = function(parameters) {
|
|
641
658
|
},
|
642
659
|
|
643
660
|
add: {
|
661
|
+
// alias
|
662
|
+
rule: function(name, rules) {
|
663
|
+
module.add.field(name, rules);
|
664
|
+
},
|
665
|
+
field: function(name, rules) {
|
666
|
+
var
|
667
|
+
newValidation = {}
|
668
|
+
;
|
669
|
+
if(module.is.shorthandRules(rules)) {
|
670
|
+
rules = $.isArray(rules)
|
671
|
+
? rules
|
672
|
+
: [rules]
|
673
|
+
;
|
674
|
+
newValidation[name] = {
|
675
|
+
rules: []
|
676
|
+
};
|
677
|
+
$.each(rules, function(index, rule) {
|
678
|
+
newValidation[name].rules.push({ type: rule });
|
679
|
+
});
|
680
|
+
}
|
681
|
+
else {
|
682
|
+
newValidation[name] = rules;
|
683
|
+
}
|
684
|
+
validation = $.extend({}, validation, newValidation);
|
685
|
+
module.debug('Adding rules', newValidation, validation);
|
686
|
+
},
|
687
|
+
fields: function(fields) {
|
688
|
+
var
|
689
|
+
newValidation
|
690
|
+
;
|
691
|
+
if(fields && module.is.shorthandFields(fields)) {
|
692
|
+
newValidation = module.get.fieldsFromShorthand(fields);
|
693
|
+
}
|
694
|
+
else {
|
695
|
+
newValidation = fields;
|
696
|
+
}
|
697
|
+
validation = $.extend({}, validation, newValidation);
|
698
|
+
},
|
644
699
|
prompt: function(identifier, errors) {
|
645
700
|
var
|
646
701
|
$field = module.get.field(identifier),
|
@@ -693,6 +748,51 @@ $.fn.form = function(parameters) {
|
|
693
748
|
},
|
694
749
|
|
695
750
|
remove: {
|
751
|
+
rule: function(field, rule) {
|
752
|
+
var
|
753
|
+
rules = $.isArray(rule)
|
754
|
+
? rule
|
755
|
+
: [rule]
|
756
|
+
;
|
757
|
+
if(rule == undefined) {
|
758
|
+
module.debug('Removed all rules');
|
759
|
+
validation[field].rules = [];
|
760
|
+
return;
|
761
|
+
}
|
762
|
+
if(validation[field] == undefined || !$.isArray(validation[field].rules)) {
|
763
|
+
return;
|
764
|
+
}
|
765
|
+
$.each(validation[field].rules, function(index, rule) {
|
766
|
+
if(rules.indexOf(rule.type) !== -1) {
|
767
|
+
module.debug('Removed rule', rule.type);
|
768
|
+
validation[field].rules.splice(index, 1);
|
769
|
+
}
|
770
|
+
});
|
771
|
+
},
|
772
|
+
field: function(field) {
|
773
|
+
var
|
774
|
+
fields = $.isArray(field)
|
775
|
+
? field
|
776
|
+
: [field]
|
777
|
+
;
|
778
|
+
$.each(fields, function(index, field) {
|
779
|
+
module.remove.rule(field);
|
780
|
+
});
|
781
|
+
},
|
782
|
+
// alias
|
783
|
+
rules: function(field, rules) {
|
784
|
+
if($.isArray(field)) {
|
785
|
+
$.each(fields, function(index, field) {
|
786
|
+
module.remove.rule(field, rules);
|
787
|
+
});
|
788
|
+
}
|
789
|
+
else {
|
790
|
+
module.remove.rule(field, rules);
|
791
|
+
}
|
792
|
+
},
|
793
|
+
fields: function(fields) {
|
794
|
+
module.remove.field(fields);
|
795
|
+
},
|
696
796
|
prompt: function(identifier) {
|
697
797
|
var
|
698
798
|
$field = module.get.field(identifier),
|
@@ -857,7 +957,7 @@ $.fn.form = function(parameters) {
|
|
857
957
|
if(typeof field == 'string') {
|
858
958
|
module.verbose('Validating field', field);
|
859
959
|
fieldName = field;
|
860
|
-
field
|
960
|
+
field = validation[field];
|
861
961
|
}
|
862
962
|
var
|
863
963
|
identifier = field.identifier || fieldName,
|
@@ -677,7 +677,9 @@ $.fn.dropdown = function(parameters) {
|
|
677
677
|
if(module.is.multiple()) {
|
678
678
|
module.filterActive();
|
679
679
|
}
|
680
|
-
module.
|
680
|
+
if(query || (!query && module.get.activeItem().length == 0)) {
|
681
|
+
module.select.firstUnfiltered();
|
682
|
+
}
|
681
683
|
if( module.has.allResultsFiltered() ) {
|
682
684
|
if( settings.onNoResults.call(element, searchTerm) ) {
|
683
685
|
if(settings.allowAdditions) {
|
@@ -1468,7 +1470,6 @@ $.fn.dropdown = function(parameters) {
|
|
1468
1470
|
// down arrow (open menu)
|
1469
1471
|
if(pressedKey == keys.downArrow && !module.is.visible()) {
|
1470
1472
|
module.verbose('Down key pressed, showing dropdown');
|
1471
|
-
module.select.firstUnfiltered();
|
1472
1473
|
module.show();
|
1473
1474
|
event.preventDefault();
|
1474
1475
|
}
|
@@ -2367,21 +2368,31 @@ $.fn.dropdown = function(parameters) {
|
|
2367
2368
|
},
|
2368
2369
|
direction: function($menu) {
|
2369
2370
|
if(settings.direction == 'auto') {
|
2370
|
-
|
2371
|
+
// reset position
|
2372
|
+
module.remove.upward();
|
2373
|
+
|
2374
|
+
if(module.can.openDownward($menu)) {
|
2371
2375
|
module.remove.upward($menu);
|
2372
2376
|
}
|
2373
2377
|
else {
|
2374
2378
|
module.set.upward($menu);
|
2375
2379
|
}
|
2380
|
+
if(!module.is.leftward($menu) && !module.can.openRightward($menu)) {
|
2381
|
+
module.set.leftward($menu);
|
2382
|
+
}
|
2376
2383
|
}
|
2377
2384
|
else if(settings.direction == 'upward') {
|
2378
2385
|
module.set.upward($menu);
|
2379
2386
|
}
|
2380
2387
|
},
|
2381
|
-
upward: function($
|
2382
|
-
var $element = $
|
2388
|
+
upward: function($currentMenu) {
|
2389
|
+
var $element = $currentMenu || $module;
|
2383
2390
|
$element.addClass(className.upward);
|
2384
2391
|
},
|
2392
|
+
leftward: function($currentMenu) {
|
2393
|
+
var $element = $currentMenu || $menu;
|
2394
|
+
$element.addClass(className.leftward);
|
2395
|
+
},
|
2385
2396
|
value: function(value, text, $selected) {
|
2386
2397
|
var
|
2387
2398
|
escapedValue = module.escape.value(value),
|
@@ -2729,10 +2740,14 @@ $.fn.dropdown = function(parameters) {
|
|
2729
2740
|
initialLoad: function() {
|
2730
2741
|
initialLoad = false;
|
2731
2742
|
},
|
2732
|
-
upward: function($
|
2733
|
-
var $element = $
|
2743
|
+
upward: function($currentMenu) {
|
2744
|
+
var $element = $currentMenu || $module;
|
2734
2745
|
$element.removeClass(className.upward);
|
2735
2746
|
},
|
2747
|
+
leftward: function($currentMenu) {
|
2748
|
+
var $element = $currentMenu || $menu;
|
2749
|
+
$element.removeClass(className.leftward);
|
2750
|
+
},
|
2736
2751
|
visible: function() {
|
2737
2752
|
$module.removeClass(className.visible);
|
2738
2753
|
},
|
@@ -3037,6 +3052,10 @@ $.fn.dropdown = function(parameters) {
|
|
3037
3052
|
: $menu.transition && $menu.transition('is animating')
|
3038
3053
|
;
|
3039
3054
|
},
|
3055
|
+
leftward: function($subMenu) {
|
3056
|
+
var $selectedMenu = $subMenu || $menu;
|
3057
|
+
return $selectedMenu.hasClass(className.leftward);
|
3058
|
+
},
|
3040
3059
|
disabled: function() {
|
3041
3060
|
return $module.hasClass(className.disabled);
|
3042
3061
|
},
|
@@ -3055,46 +3074,6 @@ $.fn.dropdown = function(parameters) {
|
|
3055
3074
|
initialLoad: function() {
|
3056
3075
|
return initialLoad;
|
3057
3076
|
},
|
3058
|
-
onScreen: function($subMenu) {
|
3059
|
-
var
|
3060
|
-
$currentMenu = $subMenu || $menu,
|
3061
|
-
canOpenDownward = true,
|
3062
|
-
onScreen = {},
|
3063
|
-
calculations
|
3064
|
-
;
|
3065
|
-
$currentMenu.addClass(className.loading);
|
3066
|
-
calculations = {
|
3067
|
-
context: {
|
3068
|
-
scrollTop : $context.scrollTop(),
|
3069
|
-
height : $context.outerHeight()
|
3070
|
-
},
|
3071
|
-
menu : {
|
3072
|
-
offset: $currentMenu.offset(),
|
3073
|
-
height: $currentMenu.outerHeight()
|
3074
|
-
}
|
3075
|
-
};
|
3076
|
-
if(module.is.verticallyScrollableContext()) {
|
3077
|
-
calculations.menu.offset.top += calculations.context.scrollTop;
|
3078
|
-
}
|
3079
|
-
onScreen = {
|
3080
|
-
above : (calculations.context.scrollTop) <= calculations.menu.offset.top - calculations.menu.height,
|
3081
|
-
below : (calculations.context.scrollTop + calculations.context.height) >= calculations.menu.offset.top + calculations.menu.height
|
3082
|
-
};
|
3083
|
-
if(onScreen.below) {
|
3084
|
-
module.verbose('Dropdown can fit in context downward', onScreen);
|
3085
|
-
canOpenDownward = true;
|
3086
|
-
}
|
3087
|
-
else if(!onScreen.below && !onScreen.above) {
|
3088
|
-
module.verbose('Dropdown cannot fit in either direction, favoring downward', onScreen);
|
3089
|
-
canOpenDownward = true;
|
3090
|
-
}
|
3091
|
-
else {
|
3092
|
-
module.verbose('Dropdown cannot fit below, opening upward', onScreen);
|
3093
|
-
canOpenDownward = false;
|
3094
|
-
}
|
3095
|
-
$currentMenu.removeClass(className.loading);
|
3096
|
-
return canOpenDownward;
|
3097
|
-
},
|
3098
3077
|
inObject: function(needle, object) {
|
3099
3078
|
var
|
3100
3079
|
found = false
|
@@ -3157,6 +3136,14 @@ $.fn.dropdown = function(parameters) {
|
|
3157
3136
|
: false
|
3158
3137
|
;
|
3159
3138
|
return (overflowY == 'auto' || overflowY == 'scroll');
|
3139
|
+
},
|
3140
|
+
horizontallyScrollableContext: function() {
|
3141
|
+
var
|
3142
|
+
overflowX = ($context.get(0) !== window)
|
3143
|
+
? $context.css('overflow-X')
|
3144
|
+
: false
|
3145
|
+
;
|
3146
|
+
return (overflowX == 'auto' || overflowX == 'scroll');
|
3160
3147
|
}
|
3161
3148
|
},
|
3162
3149
|
|
@@ -3173,6 +3160,79 @@ $.fn.dropdown = function(parameters) {
|
|
3173
3160
|
}
|
3174
3161
|
return false;
|
3175
3162
|
},
|
3163
|
+
openDownward: function($subMenu) {
|
3164
|
+
var
|
3165
|
+
$currentMenu = $subMenu || $menu,
|
3166
|
+
canOpenDownward = true,
|
3167
|
+
onScreen = {},
|
3168
|
+
calculations
|
3169
|
+
;
|
3170
|
+
$currentMenu
|
3171
|
+
.addClass(className.loading)
|
3172
|
+
;
|
3173
|
+
calculations = {
|
3174
|
+
context: {
|
3175
|
+
scrollTop : $context.scrollTop(),
|
3176
|
+
height : $context.outerHeight()
|
3177
|
+
},
|
3178
|
+
menu : {
|
3179
|
+
offset: $currentMenu.offset(),
|
3180
|
+
height: $currentMenu.outerHeight()
|
3181
|
+
}
|
3182
|
+
};
|
3183
|
+
if(module.is.verticallyScrollableContext()) {
|
3184
|
+
calculations.menu.offset.top += calculations.context.scrollTop;
|
3185
|
+
}
|
3186
|
+
onScreen = {
|
3187
|
+
above : (calculations.context.scrollTop) <= calculations.menu.offset.top - calculations.menu.height,
|
3188
|
+
below : (calculations.context.scrollTop + calculations.context.height) >= calculations.menu.offset.top + calculations.menu.height
|
3189
|
+
};
|
3190
|
+
if(onScreen.below) {
|
3191
|
+
module.verbose('Dropdown can fit in context downward', onScreen);
|
3192
|
+
canOpenDownward = true;
|
3193
|
+
}
|
3194
|
+
else if(!onScreen.below && !onScreen.above) {
|
3195
|
+
module.verbose('Dropdown cannot fit in either direction, favoring downward', onScreen);
|
3196
|
+
canOpenDownward = true;
|
3197
|
+
}
|
3198
|
+
else {
|
3199
|
+
module.verbose('Dropdown cannot fit below, opening upward', onScreen);
|
3200
|
+
canOpenDownward = false;
|
3201
|
+
}
|
3202
|
+
$currentMenu.removeClass(className.loading);
|
3203
|
+
return canOpenDownward;
|
3204
|
+
},
|
3205
|
+
openRightward: function($subMenu) {
|
3206
|
+
var
|
3207
|
+
$currentMenu = $subMenu || $menu,
|
3208
|
+
canOpenRightward = true,
|
3209
|
+
isOffscreenRight = false,
|
3210
|
+
calculations
|
3211
|
+
;
|
3212
|
+
$currentMenu
|
3213
|
+
.addClass(className.loading)
|
3214
|
+
;
|
3215
|
+
calculations = {
|
3216
|
+
context: {
|
3217
|
+
scrollLeft : $context.scrollLeft(),
|
3218
|
+
width : $context.outerWidth()
|
3219
|
+
},
|
3220
|
+
menu: {
|
3221
|
+
offset : $currentMenu.offset(),
|
3222
|
+
width : $currentMenu.outerWidth()
|
3223
|
+
}
|
3224
|
+
};
|
3225
|
+
if(module.is.horizontallyScrollableContext()) {
|
3226
|
+
calculations.menu.offset.left += calculations.context.scrollLeft;
|
3227
|
+
}
|
3228
|
+
isOffscreenRight = (calculations.menu.offset.left + calculations.menu.width >= calculations.context.scrollLeft + calculations.context.width);
|
3229
|
+
if(isOffscreenRight) {
|
3230
|
+
module.verbose('Dropdown cannot fit in context rightward', isOffscreenRight);
|
3231
|
+
canOpenRightward = false;
|
3232
|
+
}
|
3233
|
+
$currentMenu.removeClass(className.loading);
|
3234
|
+
return canOpenRightward;
|
3235
|
+
},
|
3176
3236
|
click: function() {
|
3177
3237
|
return (hasTouch || settings.on == 'click');
|
3178
3238
|
},
|
@@ -3274,9 +3334,6 @@ $.fn.dropdown = function(parameters) {
|
|
3274
3334
|
queue : true,
|
3275
3335
|
onStart : start,
|
3276
3336
|
onComplete : function() {
|
3277
|
-
if(settings.direction == 'auto') {
|
3278
|
-
module.remove.upward($subMenu);
|
3279
|
-
}
|
3280
3337
|
callback.call(element);
|
3281
3338
|
}
|
3282
3339
|
})
|
@@ -3706,6 +3763,7 @@ $.fn.dropdown.settings = {
|
|
3706
3763
|
selected : 'selected',
|
3707
3764
|
selection : 'selection',
|
3708
3765
|
upward : 'upward',
|
3766
|
+
leftward : 'left',
|
3709
3767
|
visible : 'visible'
|
3710
3768
|
}
|
3711
3769
|
|
@@ -108,25 +108,15 @@ $.fn.modal = function(parameters) {
|
|
108
108
|
var
|
109
109
|
defaultSettings = {
|
110
110
|
debug : settings.debug,
|
111
|
-
dimmerName : 'modals'
|
112
|
-
duration : {
|
113
|
-
show : settings.duration,
|
114
|
-
hide : settings.duration
|
115
|
-
}
|
111
|
+
dimmerName : 'modals'
|
116
112
|
},
|
117
113
|
dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings)
|
118
114
|
;
|
119
|
-
if(settings.inverted) {
|
120
|
-
dimmerSettings.variation = (dimmerSettings.variation !== undefined)
|
121
|
-
? dimmerSettings.variation + ' inverted'
|
122
|
-
: 'inverted'
|
123
|
-
;
|
124
|
-
}
|
125
115
|
if($.fn.dimmer === undefined) {
|
126
116
|
module.error(error.dimmer);
|
127
117
|
return;
|
128
118
|
}
|
129
|
-
module.debug('Creating dimmer
|
119
|
+
module.debug('Creating dimmer');
|
130
120
|
$dimmable = $context.dimmer(dimmerSettings);
|
131
121
|
if(settings.detachable) {
|
132
122
|
module.verbose('Modal is detachable, moving content into dimmer');
|
@@ -135,9 +125,6 @@ $.fn.modal = function(parameters) {
|
|
135
125
|
else {
|
136
126
|
module.set.undetached();
|
137
127
|
}
|
138
|
-
if(settings.blurring) {
|
139
|
-
$dimmable.addClass(className.blurring);
|
140
|
-
}
|
141
128
|
$dimmer = $dimmable.dimmer('get dimmer');
|
142
129
|
},
|
143
130
|
id: function() {
|
@@ -290,7 +277,7 @@ $.fn.modal = function(parameters) {
|
|
290
277
|
}
|
291
278
|
},
|
292
279
|
resize: function() {
|
293
|
-
if( $dimmable.dimmer('is active') ) {
|
280
|
+
if( $dimmable.dimmer('is active') && ( module.is.animating() || module.is.active() ) ) {
|
294
281
|
requestAnimationFrame(module.refresh);
|
295
282
|
}
|
296
283
|
}
|
@@ -311,6 +298,7 @@ $.fn.modal = function(parameters) {
|
|
311
298
|
: function(){}
|
312
299
|
;
|
313
300
|
module.refreshModals();
|
301
|
+
module.set.dimmerSettings();
|
314
302
|
module.showModal(callback);
|
315
303
|
},
|
316
304
|
|
@@ -604,6 +592,42 @@ $.fn.modal = function(parameters) {
|
|
604
592
|
;
|
605
593
|
}
|
606
594
|
},
|
595
|
+
dimmerSettings: function() {
|
596
|
+
if($.fn.dimmer === undefined) {
|
597
|
+
module.error(error.dimmer);
|
598
|
+
return;
|
599
|
+
}
|
600
|
+
var
|
601
|
+
defaultSettings = {
|
602
|
+
debug : settings.debug,
|
603
|
+
dimmerName : 'modals',
|
604
|
+
variation : false,
|
605
|
+
closable : 'auto',
|
606
|
+
duration : {
|
607
|
+
show : settings.duration,
|
608
|
+
hide : settings.duration
|
609
|
+
}
|
610
|
+
},
|
611
|
+
dimmerSettings = $.extend(true, defaultSettings, settings.dimmerSettings)
|
612
|
+
;
|
613
|
+
if(settings.inverted) {
|
614
|
+
dimmerSettings.variation = (dimmerSettings.variation !== undefined)
|
615
|
+
? dimmerSettings.variation + ' inverted'
|
616
|
+
: 'inverted'
|
617
|
+
;
|
618
|
+
$dimmer.addClass(className.inverted);
|
619
|
+
}
|
620
|
+
else {
|
621
|
+
$dimmer.removeClass(className.inverted);
|
622
|
+
}
|
623
|
+
if(settings.blurring) {
|
624
|
+
$dimmable.addClass(className.blurring);
|
625
|
+
}
|
626
|
+
else {
|
627
|
+
$dimmable.removeClass(className.blurring);
|
628
|
+
}
|
629
|
+
$context.dimmer('setting', dimmerSettings);
|
630
|
+
},
|
607
631
|
screenHeight: function() {
|
608
632
|
if( module.can.fit() ) {
|
609
633
|
$body.css('height', '');
|
@@ -912,6 +936,7 @@ $.fn.modal.settings = {
|
|
912
936
|
active : 'active',
|
913
937
|
animating : 'animating',
|
914
938
|
blurring : 'blurring',
|
939
|
+
inverted : 'inverted',
|
915
940
|
scrolling : 'scrolling',
|
916
941
|
undetached : 'undetached'
|
917
942
|
}
|