fomantic-ui-sass 2.8.6 → 2.8.7
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/brand-icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/brand-icons.svg +6 -41
- data/app/assets/fonts/semantic-ui/brand-icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/brand-icons.woff +0 -0
- data/app/assets/fonts/semantic-ui/brand-icons.woff2 +0 -0
- data/app/assets/fonts/semantic-ui/icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/icons.svg +7 -245
- data/app/assets/fonts/semantic-ui/icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/icons.woff +0 -0
- data/app/assets/fonts/semantic-ui/icons.woff2 +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.eot +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.svg +2 -2
- data/app/assets/fonts/semantic-ui/outline-icons.ttf +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.woff +0 -0
- data/app/assets/fonts/semantic-ui/outline-icons.woff2 +0 -0
- data/app/assets/javascripts/semantic-ui/calendar.js +144 -18
- data/app/assets/javascripts/semantic-ui/checkbox.js +1 -1
- data/app/assets/javascripts/semantic-ui/dimmer.js +3 -3
- data/app/assets/javascripts/semantic-ui/dropdown.js +52 -16
- data/app/assets/javascripts/semantic-ui/form.js +34 -8
- data/app/assets/javascripts/semantic-ui/progress.js +20 -24
- data/app/assets/javascripts/semantic-ui/search.js +1 -0
- data/app/assets/javascripts/semantic-ui/slider.js +2 -2
- data/app/assets/stylesheets/semantic-ui/collections/_form.scss +23 -69
- data/app/assets/stylesheets/semantic-ui/collections/_menu.scss +8 -7
- data/app/assets/stylesheets/semantic-ui/collections/_message.scss +4 -4
- data/app/assets/stylesheets/semantic-ui/collections/_table.scss +3 -3
- data/app/assets/stylesheets/semantic-ui/elements/_button.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_header.scss +8 -8
- data/app/assets/stylesheets/semantic-ui/elements/_icon.scss +7 -1
- data/app/assets/stylesheets/semantic-ui/elements/_image.scss +33 -4
- data/app/assets/stylesheets/semantic-ui/elements/_input.scss +32 -32
- data/app/assets/stylesheets/semantic-ui/elements/_list.scss +12 -12
- data/app/assets/stylesheets/semantic-ui/elements/_segment.scss +6 -0
- data/app/assets/stylesheets/semantic-ui/elements/_step.scss +9 -9
- data/app/assets/stylesheets/semantic-ui/elements/_text.scss +12 -0
- data/app/assets/stylesheets/semantic-ui/modules/_calendar.scss +16 -9
- data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +14 -14
- data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +108 -25
- data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +6 -6
- data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +3 -3
- data/app/assets/stylesheets/semantic-ui/modules/_popup.scss +2 -0
- data/app/assets/stylesheets/semantic-ui/modules/_sidebar.scss +2 -1
- data/app/assets/stylesheets/semantic-ui/modules/_slider.scss +9 -0
- data/app/assets/stylesheets/semantic-ui/modules/_toast.scss +7 -7
- data/app/assets/stylesheets/semantic-ui/views/_card.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/views/_feed.scss +5 -5
- data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +4 -4
- data/lib/fomantic/ui/sass/version.rb +2 -2
- metadata +5 -5
Binary file
|
Binary file
|
Binary file
|
@@ -42,7 +42,8 @@ $.fn.calendar = function(parameters) {
|
|
42
42
|
'15': {'row': 2, 'column': 2 },
|
43
43
|
'20': {'row': 3, 'column': 1 },
|
44
44
|
'30': {'row': 2, 'column': 1 }
|
45
|
-
}
|
45
|
+
},
|
46
|
+
numberText = ['','one','two','three','four','five','six','seven','eight']
|
46
47
|
;
|
47
48
|
|
48
49
|
$allModules
|
@@ -74,7 +75,10 @@ $.fn.calendar = function(parameters) {
|
|
74
75
|
|
75
76
|
isTouch,
|
76
77
|
isTouchDown = false,
|
78
|
+
isInverted = $module.hasClass(className.inverted),
|
77
79
|
focusDateUsedForRange = false,
|
80
|
+
selectionComplete = false,
|
81
|
+
classObserver,
|
78
82
|
module
|
79
83
|
;
|
80
84
|
|
@@ -92,6 +96,7 @@ $.fn.calendar = function(parameters) {
|
|
92
96
|
module.create.calendar();
|
93
97
|
|
94
98
|
module.bind.events();
|
99
|
+
module.observeChanges();
|
95
100
|
module.instantiate();
|
96
101
|
},
|
97
102
|
|
@@ -105,6 +110,7 @@ $.fn.calendar = function(parameters) {
|
|
105
110
|
module.verbose('Destroying previous calendar for', element);
|
106
111
|
$module.removeData(moduleNamespace);
|
107
112
|
module.unbind.events();
|
113
|
+
module.disconnect.classObserver();
|
108
114
|
},
|
109
115
|
|
110
116
|
setup: {
|
@@ -140,12 +146,19 @@ $.fn.calendar = function(parameters) {
|
|
140
146
|
$container = $('<div/>').addClass(className.popup)[domPositionFunction]($activatorParent);
|
141
147
|
}
|
142
148
|
$container.addClass(className.calendar);
|
143
|
-
|
149
|
+
if(isInverted){
|
150
|
+
$container.addClass(className.inverted);
|
151
|
+
}
|
152
|
+
var onVisible = function () {
|
153
|
+
module.refreshTooltips();
|
154
|
+
return settings.onVisible.apply($container, arguments);
|
155
|
+
};
|
144
156
|
var onHidden = settings.onHidden;
|
145
157
|
if (!$input.length) {
|
146
158
|
//no input, $container has to handle focus/blur
|
147
159
|
$container.attr('tabindex', '0');
|
148
160
|
onVisible = function () {
|
161
|
+
module.refreshTooltips();
|
149
162
|
module.focus();
|
150
163
|
return settings.onVisible.apply($container, arguments);
|
151
164
|
};
|
@@ -157,7 +170,7 @@ $.fn.calendar = function(parameters) {
|
|
157
170
|
var onShow = function () {
|
158
171
|
//reset the focus date onShow
|
159
172
|
module.set.focusDate(module.get.date());
|
160
|
-
module.set.mode(settings.startMode);
|
173
|
+
module.set.mode(module.get.validatedMode(settings.startMode));
|
161
174
|
return settings.onShow.apply($container, arguments);
|
162
175
|
};
|
163
176
|
var on = module.setting('on');
|
@@ -177,6 +190,7 @@ $.fn.calendar = function(parameters) {
|
|
177
190
|
if ($activator.length && !settings.inline) {
|
178
191
|
return;
|
179
192
|
}
|
193
|
+
settings.inline = true;
|
180
194
|
$container = $('<div/>').addClass(className.calendar).appendTo($module);
|
181
195
|
if (!$input.length) {
|
182
196
|
$container.attr('tabindex', '0');
|
@@ -186,6 +200,7 @@ $.fn.calendar = function(parameters) {
|
|
186
200
|
if (settings.touchReadonly && $input.length && isTouch) {
|
187
201
|
$input.prop('readonly', true);
|
188
202
|
}
|
203
|
+
module.check.disabled();
|
189
204
|
},
|
190
205
|
date: function () {
|
191
206
|
var date;
|
@@ -197,6 +212,21 @@ $.fn.calendar = function(parameters) {
|
|
197
212
|
date = parser.date($input.val(), settings);
|
198
213
|
}
|
199
214
|
module.set.date(date, settings.formatInput, false);
|
215
|
+
module.set.mode(module.get.mode(), false);
|
216
|
+
}
|
217
|
+
},
|
218
|
+
|
219
|
+
trigger: {
|
220
|
+
change: function() {
|
221
|
+
var
|
222
|
+
inputElement = $input[0]
|
223
|
+
;
|
224
|
+
if(inputElement) {
|
225
|
+
var events = document.createEvent('HTMLEvents');
|
226
|
+
module.verbose('Triggering native change event');
|
227
|
+
events.initEvent('change', true, false);
|
228
|
+
inputElement.dispatchEvent(events);
|
229
|
+
}
|
200
230
|
}
|
201
231
|
},
|
202
232
|
|
@@ -278,7 +308,10 @@ $.fn.calendar = function(parameters) {
|
|
278
308
|
if (isDay && settings.showWeekNumbers){
|
279
309
|
tempMode += ' andweek';
|
280
310
|
}
|
281
|
-
var table = $('<table/>').addClass(className.table).addClass(tempMode).appendTo(container);
|
311
|
+
var table = $('<table/>').addClass(className.table).addClass(tempMode).addClass(numberText[columns] + ' column').appendTo(container);
|
312
|
+
if(isInverted){
|
313
|
+
table.addClass(className.inverted);
|
314
|
+
}
|
282
315
|
var textColumns = columns;
|
283
316
|
//no header for time-only mode
|
284
317
|
if (!isTimeOnly) {
|
@@ -348,7 +381,13 @@ $.fn.calendar = function(parameters) {
|
|
348
381
|
var disabledDate = module.helper.findDayAsObject(cellDate, mode, settings.disabledDates);
|
349
382
|
if (disabledDate !== null && disabledDate[metadata.message]) {
|
350
383
|
cell.attr("data-tooltip", disabledDate[metadata.message]);
|
351
|
-
cell.attr("data-position", tooltipPosition);
|
384
|
+
cell.attr("data-position", disabledDate[metadata.position] || tooltipPosition);
|
385
|
+
if(disabledDate[metadata.inverted] || (isInverted && disabledDate[metadata.inverted] === undefined)) {
|
386
|
+
cell.attr("data-inverted", '');
|
387
|
+
}
|
388
|
+
if(disabledDate[metadata.variation]) {
|
389
|
+
cell.attr("data-variation", disabledDate[metadata.variation]);
|
390
|
+
}
|
352
391
|
}
|
353
392
|
} else {
|
354
393
|
var eventDate = module.helper.findDayAsObject(cellDate, mode, settings.eventDates);
|
@@ -356,7 +395,13 @@ $.fn.calendar = function(parameters) {
|
|
356
395
|
cell.addClass(eventDate[metadata.class] || settings.eventClass);
|
357
396
|
if (eventDate[metadata.message]) {
|
358
397
|
cell.attr("data-tooltip", eventDate[metadata.message]);
|
359
|
-
cell.attr("data-position", tooltipPosition);
|
398
|
+
cell.attr("data-position", eventDate[metadata.position] || tooltipPosition);
|
399
|
+
if(eventDate[metadata.inverted] || (isInverted && eventDate[metadata.inverted] === undefined)) {
|
400
|
+
cell.attr("data-inverted", '');
|
401
|
+
}
|
402
|
+
if(eventDate[metadata.variation]) {
|
403
|
+
cell.attr("data-variation", eventDate[metadata.variation]);
|
404
|
+
}
|
360
405
|
}
|
361
406
|
}
|
362
407
|
}
|
@@ -395,6 +440,10 @@ $.fn.calendar = function(parameters) {
|
|
395
440
|
}
|
396
441
|
|
397
442
|
module.update.focus(false, table);
|
443
|
+
|
444
|
+
if(settings.inline){
|
445
|
+
module.refreshTooltips();
|
446
|
+
}
|
398
447
|
}
|
399
448
|
}
|
400
449
|
},
|
@@ -436,6 +485,20 @@ $.fn.calendar = function(parameters) {
|
|
436
485
|
module.create.calendar();
|
437
486
|
},
|
438
487
|
|
488
|
+
refreshTooltips: function() {
|
489
|
+
var winWidth = $(window).width();
|
490
|
+
$container.find('td[data-position]').each(function () {
|
491
|
+
var cell = $(this);
|
492
|
+
var tooltipWidth = window.getComputedStyle(cell[0], ':after').width.replace(/[^0-9\.]/g,'');
|
493
|
+
var tooltipPosition = cell.attr('data-position');
|
494
|
+
// use a fallback width of 250 (calendar width) for IE/Edge (which return "auto")
|
495
|
+
var calcPosition = (winWidth - cell.width() - (parseInt(tooltipWidth,10) || 250)) > cell.offset().left ? 'right' : 'left';
|
496
|
+
if(tooltipPosition.indexOf(calcPosition) === -1) {
|
497
|
+
cell.attr('data-position',tooltipPosition.replace(/(left|right)/,calcPosition));
|
498
|
+
}
|
499
|
+
});
|
500
|
+
},
|
501
|
+
|
439
502
|
bind: {
|
440
503
|
events: function () {
|
441
504
|
module.debug('Binding events');
|
@@ -576,6 +639,57 @@ $.fn.calendar = function(parameters) {
|
|
576
639
|
var text = formatter.datetime(date, settings);
|
577
640
|
$input.val(text);
|
578
641
|
}
|
642
|
+
if(selectionComplete){
|
643
|
+
module.trigger.change();
|
644
|
+
selectionComplete = false;
|
645
|
+
}
|
646
|
+
},
|
647
|
+
class: {
|
648
|
+
mutation: function(mutations) {
|
649
|
+
mutations.forEach(function(mutation) {
|
650
|
+
if(mutation.attributeName === "class") {
|
651
|
+
module.check.disabled();
|
652
|
+
}
|
653
|
+
});
|
654
|
+
}
|
655
|
+
}
|
656
|
+
},
|
657
|
+
|
658
|
+
observeChanges: function() {
|
659
|
+
if('MutationObserver' in window) {
|
660
|
+
classObserver = new MutationObserver(module.event.class.mutation);
|
661
|
+
module.debug('Setting up mutation observer', classObserver);
|
662
|
+
module.observe.class();
|
663
|
+
}
|
664
|
+
},
|
665
|
+
|
666
|
+
disconnect: {
|
667
|
+
classObserver: function() {
|
668
|
+
if($input.length && classObserver) {
|
669
|
+
classObserver.disconnect();
|
670
|
+
}
|
671
|
+
}
|
672
|
+
},
|
673
|
+
|
674
|
+
observe: {
|
675
|
+
class: function() {
|
676
|
+
if($input.length && classObserver) {
|
677
|
+
classObserver.observe($module[0], {
|
678
|
+
attributes : true
|
679
|
+
});
|
680
|
+
}
|
681
|
+
}
|
682
|
+
},
|
683
|
+
|
684
|
+
is: {
|
685
|
+
disabled: function() {
|
686
|
+
return $module.hasClass(className.disabled);
|
687
|
+
}
|
688
|
+
},
|
689
|
+
|
690
|
+
check: {
|
691
|
+
disabled: function(){
|
692
|
+
$input.attr('tabindex',module.is.disabled() ? -1 : 0);
|
579
693
|
}
|
580
694
|
},
|
581
695
|
|
@@ -622,6 +736,9 @@ $.fn.calendar = function(parameters) {
|
|
622
736
|
mode: function () {
|
623
737
|
//only returns valid modes for the current settings
|
624
738
|
var mode = $module.data(metadata.mode) || settings.startMode;
|
739
|
+
return module.get.validatedMode(mode);
|
740
|
+
},
|
741
|
+
validatedMode: function(mode){
|
625
742
|
var validModes = module.get.validModes();
|
626
743
|
if ($.inArray(mode, validModes) >= 0) {
|
627
744
|
return mode;
|
@@ -739,7 +856,7 @@ $.fn.calendar = function(parameters) {
|
|
739
856
|
module.set.monthOffset(monthOffset, false);
|
740
857
|
}
|
741
858
|
}
|
742
|
-
var changed = module.set.dataKeyValue(metadata.focusDate, date, refreshCalendar);
|
859
|
+
var changed = module.set.dataKeyValue(metadata.focusDate, date, !!date && refreshCalendar);
|
743
860
|
updateFocus = (updateFocus !== false && changed && refreshCalendar === false) || focusDateUsedForRange != updateRange;
|
744
861
|
focusDateUsedForRange = updateRange;
|
745
862
|
if (updateFocus) {
|
@@ -798,15 +915,18 @@ $.fn.calendar = function(parameters) {
|
|
798
915
|
(settings.type === 'year' && mode === 'year');
|
799
916
|
if (complete) {
|
800
917
|
var canceled = module.set.date(date) === false;
|
801
|
-
if (!canceled
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
918
|
+
if (!canceled) {
|
919
|
+
selectionComplete = true;
|
920
|
+
if(settings.closable) {
|
921
|
+
module.popup('hide');
|
922
|
+
//if this is a range calendar, focus the container or input. This will open the popup from its event listeners.
|
923
|
+
var endModule = module.get.calendarModule(settings.endCalendar);
|
924
|
+
if (endModule) {
|
925
|
+
if (endModule.setting('on') !== 'focus') {
|
926
|
+
endModule.popup('show');
|
927
|
+
}
|
928
|
+
endModule.focus();
|
808
929
|
}
|
809
|
-
endModule.focus();
|
810
930
|
}
|
811
931
|
}
|
812
932
|
} else {
|
@@ -1348,12 +1468,13 @@ $.fn.calendar.settings = {
|
|
1348
1468
|
return null;
|
1349
1469
|
}
|
1350
1470
|
if(text.match(/^[0-9]{4}[\/\-\.][0-9]{2}[\/\-\.][0-9]{2}$/)){
|
1351
|
-
text
|
1471
|
+
text = text.replace(/[\/\-\.]/g,'/') + ' 00:00:00';
|
1352
1472
|
}
|
1353
1473
|
// Reverse date and month in some cases
|
1354
1474
|
text = settings.monthFirst || !text.match(/^[0-9]{2}[\/\-\.]/) ? text : text.replace(/[\/\-\.]/g,'/').replace(/([0-9]+)\/([0-9]+)/,'$2/$1');
|
1355
1475
|
var textDate = new Date(text);
|
1356
|
-
|
1476
|
+
var numberOnly = text.match(/^[0-9]+$/) !== null;
|
1477
|
+
if(!numberOnly && !isNaN(textDate.getDate())) {
|
1357
1478
|
return textDate;
|
1358
1479
|
}
|
1359
1480
|
text = text.toLowerCase();
|
@@ -1610,6 +1731,7 @@ $.fn.calendar.settings = {
|
|
1610
1731
|
grid: 'ui equal width grid',
|
1611
1732
|
column: 'column',
|
1612
1733
|
table: 'ui celled center aligned unstackable table',
|
1734
|
+
inverted: 'inverted',
|
1613
1735
|
prev: 'prev link',
|
1614
1736
|
next: 'next link',
|
1615
1737
|
prevIcon: 'chevron left icon',
|
@@ -1623,7 +1745,8 @@ $.fn.calendar.settings = {
|
|
1623
1745
|
rangeCell: 'range',
|
1624
1746
|
focusCell: 'focus',
|
1625
1747
|
todayCell: 'today',
|
1626
|
-
today: 'today link'
|
1748
|
+
today: 'today link',
|
1749
|
+
disabled: 'disabled'
|
1627
1750
|
},
|
1628
1751
|
|
1629
1752
|
metadata: {
|
@@ -1638,6 +1761,9 @@ $.fn.calendar.settings = {
|
|
1638
1761
|
monthOffset: 'monthOffset',
|
1639
1762
|
message: 'message',
|
1640
1763
|
class: 'class',
|
1764
|
+
inverted: 'inverted',
|
1765
|
+
variation: 'variation',
|
1766
|
+
position: 'position',
|
1641
1767
|
month: 'month',
|
1642
1768
|
year: 'year'
|
1643
1769
|
},
|
@@ -556,10 +556,10 @@ $.fn.checkbox = function(parameters) {
|
|
556
556
|
trigger: {
|
557
557
|
change: function() {
|
558
558
|
var
|
559
|
-
events = document.createEvent('HTMLEvents'),
|
560
559
|
inputElement = $input[0]
|
561
560
|
;
|
562
561
|
if(inputElement) {
|
562
|
+
var events = document.createEvent('HTMLEvents');
|
563
563
|
module.verbose('Triggering native change event');
|
564
564
|
events.initEvent('change', true, false);
|
565
565
|
inputElement.dispatchEvent(events);
|
@@ -408,11 +408,11 @@ $.fn.dimmer = function(parameters) {
|
|
408
408
|
var
|
409
409
|
color = $dimmer.css('background-color'),
|
410
410
|
colorArray = color.split(','),
|
411
|
-
isRGB = (colorArray && colorArray.length
|
412
|
-
isRGBA = (colorArray && colorArray.length == 4)
|
411
|
+
isRGB = (colorArray && colorArray.length >= 3)
|
413
412
|
;
|
414
413
|
opacity = settings.opacity === 0 ? 0 : settings.opacity || opacity;
|
415
|
-
if(isRGB
|
414
|
+
if(isRGB) {
|
415
|
+
colorArray[2] = colorArray[2].replace(')','');
|
416
416
|
colorArray[3] = opacity + ')';
|
417
417
|
color = colorArray.join(',');
|
418
418
|
}
|
@@ -97,6 +97,7 @@ $.fn.dropdown = function(parameters) {
|
|
97
97
|
id,
|
98
98
|
selectObserver,
|
99
99
|
menuObserver,
|
100
|
+
classObserver,
|
100
101
|
module
|
101
102
|
;
|
102
103
|
|
@@ -162,15 +163,18 @@ $.fn.dropdown = function(parameters) {
|
|
162
163
|
;
|
163
164
|
module.disconnect.menuObserver();
|
164
165
|
module.disconnect.selectObserver();
|
166
|
+
module.disconnect.classObserver();
|
165
167
|
},
|
166
168
|
|
167
169
|
observeChanges: function() {
|
168
170
|
if('MutationObserver' in window) {
|
169
171
|
selectObserver = new MutationObserver(module.event.select.mutation);
|
170
172
|
menuObserver = new MutationObserver(module.event.menu.mutation);
|
171
|
-
module.
|
173
|
+
classObserver = new MutationObserver(module.event.class.mutation);
|
174
|
+
module.debug('Setting up mutation observer', selectObserver, menuObserver, classObserver);
|
172
175
|
module.observe.select();
|
173
176
|
module.observe.menu();
|
177
|
+
module.observe.class();
|
174
178
|
}
|
175
179
|
},
|
176
180
|
|
@@ -184,6 +188,11 @@ $.fn.dropdown = function(parameters) {
|
|
184
188
|
if(selectObserver) {
|
185
189
|
selectObserver.disconnect();
|
186
190
|
}
|
191
|
+
},
|
192
|
+
classObserver: function() {
|
193
|
+
if(classObserver) {
|
194
|
+
classObserver.disconnect();
|
195
|
+
}
|
187
196
|
}
|
188
197
|
},
|
189
198
|
observe: {
|
@@ -202,6 +211,13 @@ $.fn.dropdown = function(parameters) {
|
|
202
211
|
subtree : true
|
203
212
|
});
|
204
213
|
}
|
214
|
+
},
|
215
|
+
class: function() {
|
216
|
+
if(module.has.search() && classObserver) {
|
217
|
+
classObserver.observe($module[0], {
|
218
|
+
attributes : true
|
219
|
+
});
|
220
|
+
}
|
205
221
|
}
|
206
222
|
},
|
207
223
|
|
@@ -794,9 +810,9 @@ $.fn.dropdown = function(parameters) {
|
|
794
810
|
values = [];
|
795
811
|
}
|
796
812
|
module.remove.message();
|
797
|
-
|
798
|
-
|
799
|
-
|
813
|
+
var menuConfig = {};
|
814
|
+
menuConfig[fields.values] = values;
|
815
|
+
module.setup.menu(menuConfig);
|
800
816
|
|
801
817
|
if(values.length===0 && !settings.allowAdditions) {
|
802
818
|
module.add.message(message.noResults);
|
@@ -992,7 +1008,9 @@ $.fn.dropdown = function(parameters) {
|
|
992
1008
|
module.clear();
|
993
1009
|
}
|
994
1010
|
module.debug('Creating dropdown with specified values', values);
|
995
|
-
|
1011
|
+
var menuConfig = {};
|
1012
|
+
menuConfig[fields.values] = values;
|
1013
|
+
module.setup.menu(menuConfig);
|
996
1014
|
$.each(values, function(index, item) {
|
997
1015
|
if(item.selected == true) {
|
998
1016
|
module.debug('Setting initial selection to', item[fields.value]);
|
@@ -1216,6 +1234,15 @@ $.fn.dropdown = function(parameters) {
|
|
1216
1234
|
}
|
1217
1235
|
}
|
1218
1236
|
},
|
1237
|
+
class: {
|
1238
|
+
mutation: function(mutations) {
|
1239
|
+
mutations.forEach(function(mutation) {
|
1240
|
+
if(mutation.attributeName === "class") {
|
1241
|
+
module.check.disabled();
|
1242
|
+
}
|
1243
|
+
});
|
1244
|
+
}
|
1245
|
+
},
|
1219
1246
|
select: {
|
1220
1247
|
mutation: function(mutations) {
|
1221
1248
|
module.debug('<select> modified, recreating menu');
|
@@ -1637,10 +1664,10 @@ $.fn.dropdown = function(parameters) {
|
|
1637
1664
|
trigger: {
|
1638
1665
|
change: function() {
|
1639
1666
|
var
|
1640
|
-
events = document.createEvent('HTMLEvents'),
|
1641
1667
|
inputElement = $input[0]
|
1642
1668
|
;
|
1643
1669
|
if(inputElement) {
|
1670
|
+
var events = document.createEvent('HTMLEvents');
|
1644
1671
|
module.verbose('Triggering native change event');
|
1645
1672
|
events.initEvent('change', true, false);
|
1646
1673
|
inputElement.dispatchEvent(events);
|
@@ -1772,7 +1799,7 @@ $.fn.dropdown = function(parameters) {
|
|
1772
1799
|
return $module.data(metadata.placeholderText) || '';
|
1773
1800
|
},
|
1774
1801
|
text: function() {
|
1775
|
-
return $text.text();
|
1802
|
+
return settings.preserveHTML ? $text.html() : $text.text();
|
1776
1803
|
},
|
1777
1804
|
query: function() {
|
1778
1805
|
return String($search.val()).trim();
|
@@ -1956,9 +1983,9 @@ $.fn.dropdown = function(parameters) {
|
|
1956
1983
|
selectValues: function() {
|
1957
1984
|
var
|
1958
1985
|
select = {},
|
1959
|
-
oldGroup = []
|
1986
|
+
oldGroup = [],
|
1987
|
+
values = []
|
1960
1988
|
;
|
1961
|
-
select.values = [];
|
1962
1989
|
$module
|
1963
1990
|
.find('option')
|
1964
1991
|
.each(function() {
|
@@ -1979,14 +2006,14 @@ $.fn.dropdown = function(parameters) {
|
|
1979
2006
|
}
|
1980
2007
|
else {
|
1981
2008
|
if(group.length !== oldGroup.length || group[0] !== oldGroup[0]) {
|
1982
|
-
|
2009
|
+
values.push({
|
1983
2010
|
type: 'header',
|
1984
2011
|
divider: settings.headerDivider,
|
1985
2012
|
name: group.attr('label') || ''
|
1986
2013
|
});
|
1987
2014
|
oldGroup = group;
|
1988
2015
|
}
|
1989
|
-
|
2016
|
+
values.push({
|
1990
2017
|
name : name,
|
1991
2018
|
value : value,
|
1992
2019
|
text : text,
|
@@ -2001,19 +2028,21 @@ $.fn.dropdown = function(parameters) {
|
|
2001
2028
|
}
|
2002
2029
|
if(settings.sortSelect) {
|
2003
2030
|
if(settings.sortSelect === true) {
|
2004
|
-
|
2031
|
+
values.sort(function(a, b) {
|
2005
2032
|
return a.name.localeCompare(b.name);
|
2006
2033
|
});
|
2007
2034
|
} else if(settings.sortSelect === 'natural') {
|
2008
|
-
|
2035
|
+
values.sort(function(a, b) {
|
2009
2036
|
return (a.name.toLowerCase().localeCompare(b.name.toLowerCase()));
|
2010
2037
|
});
|
2011
2038
|
} else if($.isFunction(settings.sortSelect)) {
|
2012
|
-
|
2039
|
+
values.sort(settings.sortSelect);
|
2013
2040
|
}
|
2041
|
+
select[fields.values] = values;
|
2014
2042
|
module.debug('Retrieved and sorted values from select', select);
|
2015
2043
|
}
|
2016
2044
|
else {
|
2045
|
+
select[fields.values] = values;
|
2017
2046
|
module.debug('Retrieved values from select', select);
|
2018
2047
|
}
|
2019
2048
|
return select;
|
@@ -2136,6 +2165,9 @@ $.fn.dropdown = function(parameters) {
|
|
2136
2165
|
}
|
2137
2166
|
}
|
2138
2167
|
return true;
|
2168
|
+
},
|
2169
|
+
disabled: function(){
|
2170
|
+
$search.attr('tabindex',module.is.disabled() ? -1 : 0);
|
2139
2171
|
}
|
2140
2172
|
},
|
2141
2173
|
|
@@ -2401,8 +2433,8 @@ $.fn.dropdown = function(parameters) {
|
|
2401
2433
|
module.debug('Added tabindex to searchable dropdown');
|
2402
2434
|
$search
|
2403
2435
|
.val('')
|
2404
|
-
.attr('tabindex', 0)
|
2405
2436
|
;
|
2437
|
+
module.check.disabled();
|
2406
2438
|
$menu
|
2407
2439
|
.attr('tabindex', -1)
|
2408
2440
|
;
|
@@ -3533,9 +3565,12 @@ $.fn.dropdown = function(parameters) {
|
|
3533
3565
|
module.set.scrollPosition(module.get.selectedItem(), true);
|
3534
3566
|
}
|
3535
3567
|
if( module.is.hidden($currentMenu) || module.is.animating($currentMenu) ) {
|
3568
|
+
var displayType = $module.hasClass('column') ? 'flex' : false;
|
3536
3569
|
if(transition == 'none') {
|
3537
3570
|
start();
|
3538
|
-
$currentMenu.transition(
|
3571
|
+
$currentMenu.transition({
|
3572
|
+
displayType: displayType
|
3573
|
+
}).transition('show');
|
3539
3574
|
callback.call(element);
|
3540
3575
|
}
|
3541
3576
|
else if($.fn.transition !== undefined && $module.transition('is supported')) {
|
@@ -3547,6 +3582,7 @@ $.fn.dropdown = function(parameters) {
|
|
3547
3582
|
duration : settings.duration,
|
3548
3583
|
queue : true,
|
3549
3584
|
onStart : start,
|
3585
|
+
displayType: displayType,
|
3550
3586
|
onComplete : function() {
|
3551
3587
|
callback.call(element);
|
3552
3588
|
}
|