semantic-ui-sass 2.2.10.1 → 2.2.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/semantic-ui/dropdown.js +108 -50
- data/app/assets/javascripts/semantic-ui/form.js +119 -19
- data/app/assets/javascripts/semantic-ui/modal.js +41 -16
- data/app/assets/javascripts/semantic-ui/popup.js +42 -31
- data/app/assets/javascripts/semantic-ui/search.js +11 -2
- data/app/assets/javascripts/semantic-ui/sidebar.js +1 -4
- data/app/assets/javascripts/semantic-ui/sticky.js +22 -5
- data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/collections/_form.scss +46 -59
- data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +23 -52
- data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +18 -26
- data/app/assets/stylesheets/semantic-ui/collections/_message.scss +6 -6
- data/app/assets/stylesheets/semantic-ui/collections/_table.scss +2 -2
- data/app/assets/stylesheets/semantic-ui/elements/_button.scss +1 -14
- data/app/assets/stylesheets/semantic-ui/elements/_container.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_header.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +25 -1
- data/app/assets/stylesheets/semantic-ui/elements/_image.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_input.scss +4 -10
- data/app/assets/stylesheets/semantic-ui/elements/_label.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_list.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +14 -20
- data/app/assets/stylesheets/semantic-ui/elements/_step.scss +22 -44
- data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +254 -199
- data/app/assets/stylesheets/semantic-ui/globals/_site.scss +44 -1
- data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +19 -3
- data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +70 -39
- data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +96 -22
- data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +1 -3
- data/app/assets/stylesheets/semantic-ui/modules/_search.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +1 -9
- data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/views/_ad.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/views/_card.scss +3 -12
- data/app/assets/stylesheets/semantic-ui/views/_comment.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/views/_feed.scss +7 -11
- data/app/assets/stylesheets/semantic-ui/views/_item.scss +17 -23
- data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +3 -19
- data/lib/semantic/ui/sass/version.rb +2 -2
- data/spec/helpers/semantic_icon_helper_spec.rb +9 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1521867198a4fac3e182e40271feac34a95bcab9
|
4
|
+
data.tar.gz: 8e7e9759bf06188a57a099d72d7c0a7dbd857eb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 689cd4198579d090b8e3419b7ec11c4c569d9d3cd5c11047c54db0d5529ff4be0a6d441afc12d82b05e06323651c4fc16de14981cd645260b9bd8095ddda24a8
|
7
|
+
data.tar.gz: 518e75742d5b759c73ab1c50d7558dfdd7c8a56557a958e5b4c5049148179041a95fafc664427d1ec3d5c0b4aded77516c0918ff3d74d867530a330a264db4e7
|
@@ -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
|
|
@@ -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,
|
@@ -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
|
}
|