semantic-ui-sass 1.8.1.0 → 1.11.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/assets/fonts/semantic-ui/icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/icons.otf +0 -0
- data/app/assets/fonts/semantic-ui/icons.svg +526 -465
- data/app/assets/fonts/semantic-ui/icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/icons.woff +0 -0
- data/app/assets/javascripts/semantic-ui/accordion.js +63 -43
- data/app/assets/javascripts/semantic-ui/api.js +38 -18
- data/app/assets/javascripts/semantic-ui/checkbox.js +6 -4
- data/app/assets/javascripts/semantic-ui/colorize.js +3 -3
- data/app/assets/javascripts/semantic-ui/dimmer.js +57 -15
- data/app/assets/javascripts/semantic-ui/dropdown.js +65 -27
- data/app/assets/javascripts/semantic-ui/form.js +108 -29
- data/app/assets/javascripts/semantic-ui/modal.js +31 -31
- data/app/assets/javascripts/semantic-ui/nag.js +4 -4
- data/app/assets/javascripts/semantic-ui/popup.js +74 -37
- data/app/assets/javascripts/semantic-ui/progress.js +4 -4
- data/app/assets/javascripts/semantic-ui/rating.js +4 -4
- data/app/assets/javascripts/semantic-ui/search.js +67 -26
- data/app/assets/javascripts/semantic-ui/shape.js +4 -4
- data/app/assets/javascripts/semantic-ui/sidebar.js +22 -17
- data/app/assets/javascripts/semantic-ui/site.js +3 -3
- data/app/assets/javascripts/semantic-ui/state.js +30 -25
- data/app/assets/javascripts/semantic-ui/sticky.js +89 -72
- data/app/assets/javascripts/semantic-ui/tab.js +37 -22
- data/app/assets/javascripts/semantic-ui/transition.js +163 -61
- data/app/assets/javascripts/semantic-ui/video.js +4 -4
- data/app/assets/javascripts/semantic-ui/visibility.js +186 -124
- data/app/assets/javascripts/semantic-ui/visit.js +6 -4
- data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +6 -7
- data/app/assets/stylesheets/semantic-ui/collections/_form.scss +56 -40
- data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +100 -45
- data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +28 -16
- data/app/assets/stylesheets/semantic-ui/collections/_message.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/collections/_table.scss +8 -7
- data/app/assets/stylesheets/semantic-ui/elements/_button.scss +11 -11
- data/app/assets/stylesheets/semantic-ui/elements/_divider.scss +5 -8
- data/app/assets/stylesheets/semantic-ui/elements/_flag.scss +11 -4
- data/app/assets/stylesheets/semantic-ui/elements/_header.scss +34 -10
- data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +391 -51
- data/app/assets/stylesheets/semantic-ui/elements/_image.scss +18 -5
- data/app/assets/stylesheets/semantic-ui/elements/_input.scss +33 -49
- data/app/assets/stylesheets/semantic-ui/elements/_label.scss +47 -14
- data/app/assets/stylesheets/semantic-ui/elements/_list.scss +7 -8
- data/app/assets/stylesheets/semantic-ui/elements/_loader.scss +10 -5
- data/app/assets/stylesheets/semantic-ui/elements/_rail.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/elements/_reveal.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +52 -7
- data/app/assets/stylesheets/semantic-ui/elements/_step.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/globals/_site.scss +20 -7
- data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +31 -13
- data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +9 -8
- data/app/assets/stylesheets/semantic-ui/modules/_nag.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_progress.scss +21 -9
- data/app/assets/stylesheets/semantic-ui/modules/_rating.scss +6 -17
- data/app/assets/stylesheets/semantic-ui/modules/_search.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_shape.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +15 -11
- data/app/assets/stylesheets/semantic-ui/modules/_sticky.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_tab.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/modules/_transition.scss +161 -323
- data/app/assets/stylesheets/semantic-ui/modules/_video.scss +4 -5
- data/app/assets/stylesheets/semantic-ui/views/_ad.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/views/_card.scss +202 -51
- data/app/assets/stylesheets/semantic-ui/views/_comment.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/views/_feed.scss +5 -6
- data/app/assets/stylesheets/semantic-ui/views/_item.scss +10 -12
- data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +5 -6
- data/lib/semantic/ui/sass/version.rb +2 -2
- metadata +3 -4
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Dropdown
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Dropdown
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -31,7 +31,7 @@ $.fn.dropdown = function(parameters) {
|
|
31
31
|
;
|
32
32
|
|
33
33
|
$allModules
|
34
|
-
.each(function() {
|
34
|
+
.each(function(index) {
|
35
35
|
var
|
36
36
|
settings = ( $.isPlainObject(parameters) )
|
37
37
|
? $.extend(true, {}, $.fn.dropdown.settings, parameters)
|
@@ -75,25 +75,25 @@ $.fn.dropdown = function(parameters) {
|
|
75
75
|
module.debug('Initializing dropdown', settings);
|
76
76
|
|
77
77
|
if( module.is.alreadySetup() ) {
|
78
|
-
module.
|
78
|
+
module.setup.reference();
|
79
79
|
}
|
80
80
|
else {
|
81
81
|
module.setup.layout();
|
82
|
-
}
|
83
82
|
|
84
|
-
|
85
|
-
|
83
|
+
module.save.defaults();
|
84
|
+
module.set.selected();
|
86
85
|
|
87
|
-
|
86
|
+
module.create.id();
|
88
87
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
88
|
+
if(hasTouch) {
|
89
|
+
module.bind.touchEvents();
|
90
|
+
}
|
91
|
+
module.bind.mouseEvents();
|
92
|
+
module.bind.keyboardEvents();
|
94
93
|
|
95
|
-
|
96
|
-
|
94
|
+
module.observeChanges();
|
95
|
+
module.instantiate();
|
96
|
+
}
|
97
97
|
},
|
98
98
|
|
99
99
|
instantiate: function() {
|
@@ -141,9 +141,9 @@ $.fn.dropdown = function(parameters) {
|
|
141
141
|
|
142
142
|
create: {
|
143
143
|
id: function() {
|
144
|
-
|
145
|
-
id = module.get.uniqueID();
|
144
|
+
id = (Math.random().toString(16) + '000000000').substr(2,8);
|
146
145
|
elementNamespace = '.' + id;
|
146
|
+
module.verbose('Creating unique id for element', id);
|
147
147
|
}
|
148
148
|
},
|
149
149
|
|
@@ -161,7 +161,6 @@ $.fn.dropdown = function(parameters) {
|
|
161
161
|
},
|
162
162
|
|
163
163
|
setup: {
|
164
|
-
|
165
164
|
layout: function() {
|
166
165
|
if( $module.is('select') ) {
|
167
166
|
module.setup.select();
|
@@ -211,7 +210,21 @@ $.fn.dropdown = function(parameters) {
|
|
211
210
|
.prependTo($module)
|
212
211
|
;
|
213
212
|
}
|
213
|
+
module.setup.reference();
|
214
|
+
},
|
215
|
+
reference: function() {
|
216
|
+
var
|
217
|
+
$firstModules,
|
218
|
+
$lastModules
|
219
|
+
;
|
220
|
+
module.debug('Dropdown behavior was called on select, replacing with closest dropdown');
|
221
|
+
// replace module reference
|
222
|
+
$module = $module.closest(selector.dropdown);
|
214
223
|
module.refresh();
|
224
|
+
// adjust all modules
|
225
|
+
$firstModules = $allModules.slice(0, index);
|
226
|
+
$lastModules = $allModules.slice(index + 1);
|
227
|
+
$allModules = $firstModules.add($module).add($lastModules);
|
215
228
|
}
|
216
229
|
},
|
217
230
|
|
@@ -445,6 +458,21 @@ $.fn.dropdown = function(parameters) {
|
|
445
458
|
}
|
446
459
|
},
|
447
460
|
|
461
|
+
forceSelection: function() {
|
462
|
+
var
|
463
|
+
$currentlySelected = $item.not(className.filtered).filter('.' + className.selected).eq(0),
|
464
|
+
$activeItem = $item.filter('.' + className.active).eq(0),
|
465
|
+
$selectedItem = ($currentlySelected.length > 0)
|
466
|
+
? $currentlySelected
|
467
|
+
: $activeItem,
|
468
|
+
hasSelected = ($selectedItem.size() > 0)
|
469
|
+
;
|
470
|
+
if(hasSelected) {
|
471
|
+
module.event.item.click.call($selectedItem);
|
472
|
+
module.remove.filteredItem();
|
473
|
+
}
|
474
|
+
},
|
475
|
+
|
448
476
|
event: {
|
449
477
|
// prevents focus callback from occuring on mousedown
|
450
478
|
mousedown: function() {
|
@@ -475,7 +503,12 @@ $.fn.dropdown = function(parameters) {
|
|
475
503
|
pageLostFocus = (document.activeElement === this)
|
476
504
|
;
|
477
505
|
if(!itemActivated && !pageLostFocus) {
|
478
|
-
|
506
|
+
if(settings.forceSelection) {
|
507
|
+
module.forceSelection();
|
508
|
+
}
|
509
|
+
else {
|
510
|
+
module.hide();
|
511
|
+
}
|
479
512
|
}
|
480
513
|
},
|
481
514
|
searchTextFocus: function(event) {
|
@@ -687,7 +720,9 @@ $.fn.dropdown = function(parameters) {
|
|
687
720
|
click: function (event) {
|
688
721
|
var
|
689
722
|
$choice = $(this),
|
690
|
-
$target =
|
723
|
+
$target = (event)
|
724
|
+
? $(event.target)
|
725
|
+
: $(''),
|
691
726
|
$subMenu = $choice.find(selector.menu),
|
692
727
|
text = module.get.choiceText($choice),
|
693
728
|
value = module.get.choiceValue($choice, text),
|
@@ -801,6 +836,9 @@ $.fn.dropdown = function(parameters) {
|
|
801
836
|
},
|
802
837
|
|
803
838
|
get: {
|
839
|
+
id: function() {
|
840
|
+
return id;
|
841
|
+
},
|
804
842
|
text: function() {
|
805
843
|
return $text.text();
|
806
844
|
},
|
@@ -948,9 +986,6 @@ $.fn.dropdown = function(parameters) {
|
|
948
986
|
value = module.get.text();
|
949
987
|
}
|
950
988
|
return $selectedItem || false;
|
951
|
-
},
|
952
|
-
uniqueID: function() {
|
953
|
-
return (Math.random().toString(16) + '000000000').substr(2,8);
|
954
989
|
}
|
955
990
|
},
|
956
991
|
|
@@ -1378,6 +1413,8 @@ $.fn.dropdown = function(parameters) {
|
|
1378
1413
|
;
|
1379
1414
|
}
|
1380
1415
|
|
1416
|
+
$input.trigger('blur');
|
1417
|
+
|
1381
1418
|
if(settings.transition == 'none') {
|
1382
1419
|
callback.call(element);
|
1383
1420
|
}
|
@@ -1617,16 +1654,15 @@ $.fn.dropdown = function(parameters) {
|
|
1617
1654
|
}
|
1618
1655
|
else {
|
1619
1656
|
if(instance !== undefined) {
|
1620
|
-
|
1657
|
+
instance.invoke('destroy');
|
1621
1658
|
}
|
1622
1659
|
module.initialize();
|
1623
1660
|
}
|
1624
1661
|
})
|
1625
1662
|
;
|
1626
|
-
|
1627
1663
|
return (returnedValue !== undefined)
|
1628
1664
|
? returnedValue
|
1629
|
-
:
|
1665
|
+
: $allModules
|
1630
1666
|
;
|
1631
1667
|
};
|
1632
1668
|
|
@@ -1653,6 +1689,8 @@ $.fn.dropdown.settings = {
|
|
1653
1689
|
touch : 50
|
1654
1690
|
},
|
1655
1691
|
|
1692
|
+
forceSelection: true,
|
1693
|
+
|
1656
1694
|
transition : 'auto',
|
1657
1695
|
duration : 250,
|
1658
1696
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Form Validation
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Form Validation
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -11,6 +11,8 @@
|
|
11
11
|
|
12
12
|
;(function ( $, window, document, undefined ) {
|
13
13
|
|
14
|
+
"use strict";
|
15
|
+
|
14
16
|
$.fn.form = function(fields, parameters) {
|
15
17
|
var
|
16
18
|
$allModules = $(this),
|
@@ -313,11 +315,23 @@ $.fn.form = function(fields, parameters) {
|
|
313
315
|
else if( $field.filter('[name="' + identifier +'"]').length > 0 ) {
|
314
316
|
return $field.filter('[name="' + identifier +'"]');
|
315
317
|
}
|
318
|
+
else if( $field.filter('[name="' + identifier +'[]"]').length > 0 ) {
|
319
|
+
return $field.filter('[name="' + identifier +'[]"]');
|
320
|
+
}
|
316
321
|
else if( $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]').length > 0 ) {
|
317
322
|
return $field.filter('[data-' + metadata.validate + '="'+ identifier +'"]');
|
318
323
|
}
|
319
324
|
return $('<input/>');
|
320
325
|
},
|
326
|
+
fields: function(fields) {
|
327
|
+
var
|
328
|
+
$fields = $()
|
329
|
+
;
|
330
|
+
$.each(fields, function(index, name) {
|
331
|
+
$fields = $fields.add( module.get.field(name) );
|
332
|
+
});
|
333
|
+
return $fields;
|
334
|
+
},
|
321
335
|
validation: function($field) {
|
322
336
|
var
|
323
337
|
rules
|
@@ -340,43 +354,61 @@ $.fn.form = function(fields, parameters) {
|
|
340
354
|
},
|
341
355
|
values: function (fields) {
|
342
356
|
var
|
357
|
+
$fields = $.isArray(fields)
|
358
|
+
? module.get.fields(fields)
|
359
|
+
: $field,
|
343
360
|
values = {}
|
344
361
|
;
|
345
|
-
|
346
|
-
if(!$.isArray(fields)) {
|
347
|
-
fields = $field;
|
348
|
-
}
|
349
|
-
$.each(fields, function(index, field) {
|
362
|
+
$fields.each(function(index, field) {
|
350
363
|
var
|
351
|
-
$field = (
|
352
|
-
? module.get.field(field)
|
353
|
-
: $(field),
|
364
|
+
$field = $(field),
|
354
365
|
type = $field.prop('type'),
|
355
366
|
name = $field.prop('name'),
|
356
367
|
value = $field.val(),
|
357
368
|
isCheckbox = $field.is(selector.checkbox),
|
358
369
|
isRadio = $field.is(selector.radio),
|
370
|
+
isMultiple = (name.indexOf('[]') !== -1),
|
359
371
|
isChecked = (isCheckbox)
|
360
372
|
? $field.is(':checked')
|
361
373
|
: false
|
362
374
|
;
|
363
375
|
if(name) {
|
364
|
-
if(
|
365
|
-
|
366
|
-
|
376
|
+
if(isMultiple) {
|
377
|
+
name = name.replace('[]', '');
|
378
|
+
if(!values[name]) {
|
379
|
+
values[name] = [];
|
367
380
|
}
|
368
|
-
|
369
|
-
|
370
|
-
|
371
|
-
|
381
|
+
if(isCheckbox) {
|
382
|
+
if(isChecked) {
|
383
|
+
values[name].push(value)
|
384
|
+
}
|
385
|
+
else {
|
386
|
+
module.debug('Omitted unchecked checkbox', $field);
|
387
|
+
return true;
|
388
|
+
}
|
372
389
|
}
|
373
390
|
else {
|
374
|
-
|
375
|
-
return true;
|
391
|
+
values[name].push(value);
|
376
392
|
}
|
377
393
|
}
|
378
394
|
else {
|
379
|
-
|
395
|
+
if(isRadio) {
|
396
|
+
if(isChecked) {
|
397
|
+
values[name] = value;
|
398
|
+
}
|
399
|
+
}
|
400
|
+
else if(isCheckbox) {
|
401
|
+
if(isChecked) {
|
402
|
+
values[name] = true;
|
403
|
+
}
|
404
|
+
else {
|
405
|
+
module.debug('Omitted unchecked checkbox', $field);
|
406
|
+
return true;
|
407
|
+
}
|
408
|
+
}
|
409
|
+
else {
|
410
|
+
values[name] = value;
|
411
|
+
}
|
380
412
|
}
|
381
413
|
}
|
382
414
|
});
|
@@ -523,13 +555,26 @@ $.fn.form = function(fields, parameters) {
|
|
523
555
|
var
|
524
556
|
$field = module.get.field(key),
|
525
557
|
$element = $field.parent(),
|
558
|
+
isMultiple = $.isArray(value),
|
526
559
|
isCheckbox = $element.is(selector.uiCheckbox),
|
527
560
|
isDropdown = $element.is(selector.uiDropdown),
|
528
|
-
isRadio = $field.is(selector.radio),
|
529
|
-
fieldExists = ($field.length > 0)
|
561
|
+
isRadio = ($field.is(selector.radio) && isCheckbox),
|
562
|
+
fieldExists = ($field.length > 0),
|
563
|
+
$multipleField
|
530
564
|
;
|
531
565
|
if(fieldExists) {
|
532
|
-
if(
|
566
|
+
if(isMultiple && isCheckbox) {
|
567
|
+
module.verbose('Selecting multiple', value, $field);
|
568
|
+
$element.checkbox('uncheck');
|
569
|
+
$.each(value, function(index, value) {
|
570
|
+
$multipleField = $field.filter('[value="' + value + '"]');
|
571
|
+
$element = $multipleField.parent();
|
572
|
+
if($multipleField.length > 0) {
|
573
|
+
$element.checkbox('check');
|
574
|
+
}
|
575
|
+
});
|
576
|
+
}
|
577
|
+
else if(isRadio) {
|
533
578
|
module.verbose('Selecting radio value', value, $field);
|
534
579
|
$field.filter('[value="' + value + '"]')
|
535
580
|
.parent(selector.uiCheckbox)
|
@@ -826,7 +871,7 @@ $.fn.form = function(fields, parameters) {
|
|
826
871
|
}
|
827
872
|
else {
|
828
873
|
if(instance !== undefined) {
|
829
|
-
|
874
|
+
instance.invoke('destroy');
|
830
875
|
}
|
831
876
|
module.initialize();
|
832
877
|
}
|
@@ -926,10 +971,18 @@ $.fn.form.settings = {
|
|
926
971
|
return ($(this).filter(':checked').length > 0);
|
927
972
|
},
|
928
973
|
|
929
|
-
// value contains (
|
974
|
+
// value contains text (insensitive)
|
930
975
|
contains: function(value, text) {
|
976
|
+
// escape regex characters
|
977
|
+
text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
978
|
+
return (value.search( new RegExp(text, 'i') ) !== -1);
|
979
|
+
},
|
980
|
+
|
981
|
+
// value contains text (case sensitive)
|
982
|
+
containsExactly: function(value, text) {
|
983
|
+
// escape regex characters
|
931
984
|
text = text.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
932
|
-
return (value.search(text) !== -1);
|
985
|
+
return (value.search( new RegExp(text) ) !== -1);
|
933
986
|
},
|
934
987
|
|
935
988
|
// is most likely an email
|
@@ -977,8 +1030,21 @@ $.fn.form.settings = {
|
|
977
1030
|
);
|
978
1031
|
},
|
979
1032
|
|
980
|
-
// is
|
1033
|
+
// is value (case insensitive)
|
981
1034
|
is: function(value, text) {
|
1035
|
+
text = (typeof text == 'string')
|
1036
|
+
? text.toLowerCase()
|
1037
|
+
: text
|
1038
|
+
;
|
1039
|
+
value = (typeof value == 'string')
|
1040
|
+
? value.toLowerCase()
|
1041
|
+
: value
|
1042
|
+
;
|
1043
|
+
return (value == text);
|
1044
|
+
},
|
1045
|
+
|
1046
|
+
// is value
|
1047
|
+
isExactly: function(value, text) {
|
982
1048
|
return (value == text);
|
983
1049
|
},
|
984
1050
|
|
@@ -1020,8 +1086,21 @@ $.fn.form.settings = {
|
|
1020
1086
|
;
|
1021
1087
|
},
|
1022
1088
|
|
1023
|
-
// value is not
|
1089
|
+
// value is not value (case insensitive)
|
1024
1090
|
not: function(value, notValue) {
|
1091
|
+
value = (typeof value == 'string')
|
1092
|
+
? value.toLowerCase()
|
1093
|
+
: value
|
1094
|
+
;
|
1095
|
+
notValue = (typeof notValue == 'string')
|
1096
|
+
? notValue.toLowerCase()
|
1097
|
+
: notValue
|
1098
|
+
;
|
1099
|
+
return (value != notValue);
|
1100
|
+
},
|
1101
|
+
|
1102
|
+
// value is not value (case sensitive)
|
1103
|
+
notExactly: function(value, notValue) {
|
1025
1104
|
return (value != notValue);
|
1026
1105
|
},
|
1027
1106
|
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Modal
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Modal
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -120,9 +120,9 @@ $.fn.modal = function(parameters) {
|
|
120
120
|
$dimmer = $dimmable.dimmer('get dimmer');
|
121
121
|
},
|
122
122
|
id: function() {
|
123
|
-
|
124
|
-
id = module.get.uniqueID();
|
123
|
+
id = (Math.random().toString(16) + '000000000').substr(2,8);
|
125
124
|
elementNamespace = '.' + id;
|
125
|
+
module.verbose('Creating unique id for element', id);
|
126
126
|
}
|
127
127
|
},
|
128
128
|
|
@@ -186,17 +186,13 @@ $.fn.modal = function(parameters) {
|
|
186
186
|
|
187
187
|
bind: {
|
188
188
|
events: function() {
|
189
|
-
$close
|
190
|
-
|
191
|
-
;
|
192
|
-
$window
|
193
|
-
.on('resize' + elementNamespace, module.event.resize)
|
194
|
-
;
|
189
|
+
$close.on('click' + eventNamespace, module.event.close);
|
190
|
+
$window.on('resize' + elementNamespace, module.event.resize);
|
195
191
|
}
|
196
192
|
},
|
197
193
|
|
198
194
|
get: {
|
199
|
-
|
195
|
+
id: function() {
|
200
196
|
return (Math.random().toString(16) + '000000000').substr(2,8);
|
201
197
|
}
|
202
198
|
},
|
@@ -306,7 +302,7 @@ $.fn.modal = function(parameters) {
|
|
306
302
|
module.set.type();
|
307
303
|
module.set.clickaway();
|
308
304
|
|
309
|
-
if( !settings.allowMultiple && $otherModals.filter('
|
305
|
+
if( !settings.allowMultiple && $otherModals.filter('.' + className.active).length > 0) {
|
310
306
|
module.debug('Other modals visible, queueing show animation');
|
311
307
|
module.hideOthers(module.showModal);
|
312
308
|
}
|
@@ -351,7 +347,7 @@ $.fn.modal = function(parameters) {
|
|
351
347
|
}
|
352
348
|
},
|
353
349
|
|
354
|
-
hideModal: function(callback) {
|
350
|
+
hideModal: function(callback, keepDimmed) {
|
355
351
|
callback = $.isFunction(callback)
|
356
352
|
? callback
|
357
353
|
: function(){}
|
@@ -370,7 +366,7 @@ $.fn.modal = function(parameters) {
|
|
370
366
|
duration : settings.duration,
|
371
367
|
useFailSafe : true,
|
372
368
|
onStart : function() {
|
373
|
-
if(
|
369
|
+
if(!module.othersActive() && !keepDimmed) {
|
374
370
|
module.hideDimmer();
|
375
371
|
}
|
376
372
|
module.remove.keyboardShortcuts();
|
@@ -426,30 +422,34 @@ $.fn.modal = function(parameters) {
|
|
426
422
|
},
|
427
423
|
|
428
424
|
hideAll: function(callback) {
|
425
|
+
var
|
426
|
+
$visibleModals = $allModals.filter(':visible')
|
427
|
+
;
|
429
428
|
callback = $.isFunction(callback)
|
430
429
|
? callback
|
431
430
|
: function(){}
|
432
431
|
;
|
433
|
-
if( $
|
432
|
+
if( $visibleModals.length > 0 ) {
|
434
433
|
module.debug('Hiding all visible modals');
|
435
434
|
module.hideDimmer();
|
436
|
-
$
|
437
|
-
.
|
438
|
-
.modal('hide modal', callback)
|
435
|
+
$visibleModals
|
436
|
+
.modal('hide modal', callback)
|
439
437
|
;
|
440
438
|
}
|
441
439
|
},
|
442
440
|
|
443
441
|
hideOthers: function(callback) {
|
442
|
+
var
|
443
|
+
$visibleModals = $otherModals.filter(':visible')
|
444
|
+
;
|
444
445
|
callback = $.isFunction(callback)
|
445
446
|
? callback
|
446
447
|
: function(){}
|
447
448
|
;
|
448
|
-
if( $
|
449
|
+
if( $visibleModals.length > 0 ) {
|
449
450
|
module.debug('Hiding other modals', $otherModals);
|
450
|
-
$
|
451
|
-
.
|
452
|
-
.modal('hide modal', callback)
|
451
|
+
$visibleModals
|
452
|
+
.modal('hide modal', callback, true)
|
453
453
|
;
|
454
454
|
}
|
455
455
|
},
|
@@ -530,7 +530,7 @@ $.fn.modal = function(parameters) {
|
|
530
530
|
|
531
531
|
can: {
|
532
532
|
fit: function() {
|
533
|
-
return (module.cache.height < module.cache.contextHeight);
|
533
|
+
return ( ( module.cache.height + (settings.padding * 2) ) < module.cache.contextHeight);
|
534
534
|
}
|
535
535
|
},
|
536
536
|
|
@@ -574,15 +574,15 @@ $.fn.modal = function(parameters) {
|
|
574
574
|
}
|
575
575
|
},
|
576
576
|
screenHeight: function() {
|
577
|
-
if(
|
577
|
+
if( module.can.fit() ) {
|
578
|
+
$body.css('height', '');
|
579
|
+
}
|
580
|
+
else {
|
578
581
|
module.debug('Modal is taller than page content, resizing page height');
|
579
582
|
$body
|
580
|
-
.css('height', module.cache.height + settings.padding)
|
583
|
+
.css('height', module.cache.height + (settings.padding / 2) )
|
581
584
|
;
|
582
585
|
}
|
583
|
-
else {
|
584
|
-
$body.css('height', '');
|
585
|
-
}
|
586
586
|
},
|
587
587
|
active: function() {
|
588
588
|
$module.addClass(className.active);
|
@@ -787,7 +787,7 @@ $.fn.modal = function(parameters) {
|
|
787
787
|
}
|
788
788
|
else {
|
789
789
|
if(instance !== undefined) {
|
790
|
-
|
790
|
+
instance.invoke('destroy');
|
791
791
|
}
|
792
792
|
module.initialize();
|
793
793
|
}
|
@@ -827,7 +827,7 @@ $.fn.modal.settings = {
|
|
827
827
|
offset : 0,
|
828
828
|
transition : 'scale',
|
829
829
|
|
830
|
-
padding :
|
830
|
+
padding : 50,
|
831
831
|
|
832
832
|
onShow : function(){},
|
833
833
|
onHide : function(){},
|
@@ -1,9 +1,9 @@
|
|
1
|
-
|
2
|
-
* # Semantic - Nag
|
1
|
+
/*!
|
2
|
+
* # Semantic UI - Nag
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
6
|
-
* Copyright 2014
|
6
|
+
* Copyright 2014 Contributors
|
7
7
|
* Released under the MIT license
|
8
8
|
* http://opensource.org/licenses/MIT
|
9
9
|
*
|
@@ -405,7 +405,7 @@ $.fn.nag = function(parameters) {
|
|
405
405
|
}
|
406
406
|
else {
|
407
407
|
if(instance !== undefined) {
|
408
|
-
|
408
|
+
instance.invoke('destroy');
|
409
409
|
}
|
410
410
|
module.initialize();
|
411
411
|
}
|