semantic-ui-sass 2.0.4.0 → 2.0.7.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/javascripts/semantic-ui/api.js +75 -34
- data/app/assets/javascripts/semantic-ui/checkbox.js +14 -3
- data/app/assets/javascripts/semantic-ui/dropdown.js +116 -59
- data/app/assets/javascripts/semantic-ui/form.js +13 -5
- data/app/assets/javascripts/semantic-ui/popup.js +8 -7
- data/app/assets/stylesheets/semantic-ui/collections/_breadcrumb.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/collections/_form.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/collections/_grid.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/collections/_message.scss +4 -4
- data/app/assets/stylesheets/semantic-ui/collections/_table.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_button.scss +7 -3
- 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 +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_image.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_input.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_label.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_list.scss +5 -3
- 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 +1 -1
- data/app/assets/stylesheets/semantic-ui/elements/_step.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/globals/_reset.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/globals/_site.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_accordion.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_checkbox.scss +8 -1
- data/app/assets/stylesheets/semantic-ui/modules/_dimmer.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_dropdown.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_embed.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/modules/_modal.scss +1 -1
- 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 -1
- 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 -1
- 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 +1 -1
- data/app/assets/stylesheets/semantic-ui/views/_comment.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/views/_feed.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/views/_item.scss +1 -1
- data/app/assets/stylesheets/semantic-ui/views/_statistic.scss +1 -1
- data/lib/semantic/ui/sass/version.rb +2 -2
- 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: f2ca3779869ae7ddda9dca7dfb5530efe641a1b0
|
4
|
+
data.tar.gz: 275821d4d4f37e4d2624856829af5afeb5d3b429
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 319d55c63993ea9665a5fe33da5ef0cdebcfe805fde35f8d75bf9e02d6c2dcfb0a624e0002fcefac2665dbe3ae2d4eb768bd93d24d55eb6e49ce03cae99fc0fa
|
7
|
+
data.tar.gz: b87ecbd7acc35e5ce44e1e8a57b8c413fd6b4b024dc8f1e771716217a50022045f1954368e3046282a439fae676744ec6310bed494f46993d1fc9d027388a9ba
|
data/CHANGELOG.md
CHANGED
@@ -115,6 +115,20 @@ $.api = $.fn.api = function(parameters) {
|
|
115
115
|
}
|
116
116
|
},
|
117
117
|
|
118
|
+
decode: {
|
119
|
+
json: function(response) {
|
120
|
+
if(response !== undefined && typeof response == 'string') {
|
121
|
+
try {
|
122
|
+
response = JSON.parse(response);
|
123
|
+
}
|
124
|
+
catch(e) {
|
125
|
+
// isnt json string
|
126
|
+
}
|
127
|
+
}
|
128
|
+
return response;
|
129
|
+
}
|
130
|
+
},
|
131
|
+
|
118
132
|
read: {
|
119
133
|
cachedResponse: function(url) {
|
120
134
|
var
|
@@ -126,15 +140,7 @@ $.api = $.fn.api = function(parameters) {
|
|
126
140
|
}
|
127
141
|
response = sessionStorage.getItem(url);
|
128
142
|
module.debug('Using cached response', url, response);
|
129
|
-
|
130
|
-
try {
|
131
|
-
response = JSON.parse(response);
|
132
|
-
}
|
133
|
-
catch(e) {
|
134
|
-
// didnt store object
|
135
|
-
}
|
136
|
-
return response;
|
137
|
-
}
|
143
|
+
response = module.decode.json(response);
|
138
144
|
return false;
|
139
145
|
}
|
140
146
|
},
|
@@ -287,7 +293,7 @@ $.api = $.fn.api = function(parameters) {
|
|
287
293
|
}
|
288
294
|
},
|
289
295
|
validResponse: function(response) {
|
290
|
-
if( settings.dataType !== 'json' || !$.isFunction(settings.successTest) ) {
|
296
|
+
if( (settings.dataType !== 'json' && settings.dataType !== 'jsonp') || !$.isFunction(settings.successTest) ) {
|
291
297
|
module.verbose('Response is not JSON, skipping validation', settings.successTest, response);
|
292
298
|
return true;
|
293
299
|
}
|
@@ -352,7 +358,7 @@ $.api = $.fn.api = function(parameters) {
|
|
352
358
|
}
|
353
359
|
else {
|
354
360
|
module.verbose('Found required variable', variable, value);
|
355
|
-
url = url.replace(templatedString, value);
|
361
|
+
url = url.replace(templatedString, module.get.urlEncodedValue(value));
|
356
362
|
}
|
357
363
|
});
|
358
364
|
}
|
@@ -445,13 +451,13 @@ $.api = $.fn.api = function(parameters) {
|
|
445
451
|
},
|
446
452
|
xhr: {
|
447
453
|
always: function() {
|
448
|
-
//
|
454
|
+
// nothing special
|
449
455
|
},
|
450
456
|
done: function(response, textStatus, xhr) {
|
451
457
|
var
|
452
|
-
context
|
453
|
-
elapsedTime
|
454
|
-
timeLeft
|
458
|
+
context = this,
|
459
|
+
elapsedTime = (new Date().getTime() - requestStartTime),
|
460
|
+
timeLeft = (settings.loadingDuration - elapsedTime),
|
455
461
|
translatedResponse = ( $.isFunction(settings.onResponse) )
|
456
462
|
? settings.onResponse.call(context, $.extend(true, {}, response))
|
457
463
|
: false
|
@@ -469,7 +475,7 @@ $.api = $.fn.api = function(parameters) {
|
|
469
475
|
}
|
470
476
|
setTimeout(function() {
|
471
477
|
if( module.is.validResponse(response) ) {
|
472
|
-
module.request.resolveWith(context, [response]);
|
478
|
+
module.request.resolveWith(context, [response, xhr]);
|
473
479
|
}
|
474
480
|
else {
|
475
481
|
module.request.rejectWith(context, [xhr, 'invalid']);
|
@@ -500,46 +506,52 @@ $.api = $.fn.api = function(parameters) {
|
|
500
506
|
}
|
501
507
|
},
|
502
508
|
request: {
|
503
|
-
|
504
|
-
module.remove.loading();
|
505
|
-
settings.onComplete.call(context, response, $module);
|
506
|
-
},
|
507
|
-
done: function(response) {
|
509
|
+
done: function(response, xhr) {
|
508
510
|
module.debug('Successful API Response', response);
|
509
511
|
if(settings.cache === 'local' && url) {
|
510
512
|
module.write.cachedResponse(url, response);
|
511
513
|
module.debug('Saving server response locally', module.cache);
|
512
514
|
}
|
513
|
-
settings.onSuccess.call(context, response, $module);
|
515
|
+
settings.onSuccess.call(context, response, $module, xhr);
|
516
|
+
},
|
517
|
+
complete: function(firstParameter, secondParameter) {
|
518
|
+
var
|
519
|
+
xhr,
|
520
|
+
response
|
521
|
+
;
|
522
|
+
// have to guess callback parameters based on request success
|
523
|
+
if( module.was.succesful() ) {
|
524
|
+
response = firstParameter;
|
525
|
+
xhr = secondParameter;
|
526
|
+
}
|
527
|
+
else {
|
528
|
+
xhr = firstParameter;
|
529
|
+
response = module.get.responseFromXHR(xhr);
|
530
|
+
}
|
531
|
+
module.remove.loading();
|
532
|
+
settings.onComplete.call(context, response, $module, xhr);
|
514
533
|
},
|
515
534
|
fail: function(xhr, status, httpMessage) {
|
516
535
|
var
|
517
536
|
// pull response from xhr if available
|
518
|
-
response
|
519
|
-
|
520
|
-
: false,
|
521
|
-
errorMessage = ($.isPlainObject(response) && response.error !== undefined)
|
522
|
-
? response.error // use json error message
|
523
|
-
: (settings.error[status] !== undefined) // use server error message
|
524
|
-
? settings.error[status]
|
525
|
-
: httpMessage
|
537
|
+
response = module.get.responseFromXHR(xhr),
|
538
|
+
errorMessage = module.get.errorFromRequest(response, status, httpMessage)
|
526
539
|
;
|
527
540
|
if(status == 'aborted') {
|
528
541
|
module.debug('XHR Aborted (Most likely caused by page navigation or CORS Policy)', status, httpMessage);
|
529
|
-
settings.onAbort.call(context, status, $module);
|
542
|
+
settings.onAbort.call(context, status, $module, xhr);
|
530
543
|
}
|
531
544
|
else if(status == 'invalid') {
|
532
545
|
module.debug('JSON did not pass success test. A server-side error has most likely occurred', response);
|
533
546
|
}
|
534
547
|
else if(status == 'error') {
|
535
|
-
|
536
548
|
if(xhr !== undefined) {
|
537
549
|
module.debug('XHR produced a server error', status, httpMessage);
|
538
550
|
// make sure we have an error to display to console
|
539
551
|
if( xhr.status != 200 && httpMessage !== undefined && httpMessage !== '') {
|
540
552
|
module.error(error.statusMessage + httpMessage, ajaxSettings.url);
|
541
553
|
}
|
542
|
-
settings.onError.call(context, errorMessage, $module);
|
554
|
+
settings.onError.call(context, errorMessage, $module, xhr);
|
543
555
|
}
|
544
556
|
}
|
545
557
|
|
@@ -549,7 +561,7 @@ $.api = $.fn.api = function(parameters) {
|
|
549
561
|
setTimeout(module.remove.error, settings.errorDuration);
|
550
562
|
}
|
551
563
|
module.debug('API Request failed', errorMessage, xhr);
|
552
|
-
settings.onFailure.call(context, response, $module);
|
564
|
+
settings.onFailure.call(context, response, $module, xhr);
|
553
565
|
}
|
554
566
|
}
|
555
567
|
},
|
@@ -650,6 +662,22 @@ $.api = $.fn.api = function(parameters) {
|
|
650
662
|
},
|
651
663
|
|
652
664
|
get: {
|
665
|
+
responseFromXHR: function(xhr) {
|
666
|
+
return $.isPlainObject(xhr)
|
667
|
+
? (settings.dataType == 'json' || settings.dataType == 'jsonp')
|
668
|
+
? module.decode.json(xhr.responseText)
|
669
|
+
: xhr.responseText
|
670
|
+
: false
|
671
|
+
;
|
672
|
+
},
|
673
|
+
errorFromRequest: function(response, status, httpMessage) {
|
674
|
+
return ($.isPlainObject(response) && response.error !== undefined)
|
675
|
+
? response.error // use json error message
|
676
|
+
: (settings.error[status] !== undefined) // use server error message
|
677
|
+
? settings.error[status]
|
678
|
+
: httpMessage
|
679
|
+
;
|
680
|
+
},
|
653
681
|
request: function() {
|
654
682
|
return module.request || false;
|
655
683
|
},
|
@@ -686,6 +714,19 @@ $.api = $.fn.api = function(parameters) {
|
|
686
714
|
: settings
|
687
715
|
;
|
688
716
|
},
|
717
|
+
urlEncodedValue: function(value) {
|
718
|
+
var
|
719
|
+
decodedValue = window.decodeURIComponent(value),
|
720
|
+
encodedValue = window.encodeURIComponent(value),
|
721
|
+
alreadyEncoded = (decodedValue !== value)
|
722
|
+
;
|
723
|
+
if(alreadyEncoded) {
|
724
|
+
module.debug('URL value is already encoded, avoiding double encoding', value);
|
725
|
+
return value;
|
726
|
+
}
|
727
|
+
module.verbose('Encoding value for url', value, encodedValue);
|
728
|
+
return encodedValue;
|
729
|
+
},
|
689
730
|
defaultData: function() {
|
690
731
|
var
|
691
732
|
data = {}
|
@@ -44,6 +44,8 @@ $.fn.checkbox = function(parameters) {
|
|
44
44
|
$label = $(this).children(selector.label),
|
45
45
|
$input = $(this).children(selector.input),
|
46
46
|
|
47
|
+
shortcutPressed = false,
|
48
|
+
|
47
49
|
instance = $module.data(moduleNamespace),
|
48
50
|
|
49
51
|
observer,
|
@@ -192,11 +194,19 @@ $.fn.checkbox = function(parameters) {
|
|
192
194
|
if(key == keyCode.escape) {
|
193
195
|
module.verbose('Escape key pressed blurring field');
|
194
196
|
$input.blur();
|
195
|
-
|
197
|
+
shortcutPressed = true;
|
196
198
|
}
|
197
|
-
if(!event.ctrlKey && (key == keyCode.enter)) {
|
198
|
-
module.verbose('Enter key pressed, toggling checkbox');
|
199
|
+
else if(!event.ctrlKey && ( key == keyCode.space || key == keyCode.enter) ) {
|
200
|
+
module.verbose('Enter/space key pressed, toggling checkbox');
|
199
201
|
module.toggle();
|
202
|
+
shortcutPressed = true;
|
203
|
+
}
|
204
|
+
else {
|
205
|
+
shortcutPressed = false;
|
206
|
+
}
|
207
|
+
},
|
208
|
+
keyup: function(event) {
|
209
|
+
if(shortcutPressed) {
|
200
210
|
event.preventDefault();
|
201
211
|
}
|
202
212
|
}
|
@@ -455,6 +465,7 @@ $.fn.checkbox = function(parameters) {
|
|
455
465
|
$module
|
456
466
|
.on('click' + eventNamespace, module.event.click)
|
457
467
|
.on('keydown' + eventNamespace, selector.input, module.event.keydown)
|
468
|
+
.on('keyup' + eventNamespace, selector.input, module.event.keyup)
|
458
469
|
;
|
459
470
|
}
|
460
471
|
},
|
@@ -309,15 +309,19 @@ $.fn.dropdown = function(parameters) {
|
|
309
309
|
.html( templates.dropdown(selectValues) )
|
310
310
|
.insertBefore($input)
|
311
311
|
;
|
312
|
+
if($input.hasClass(className.multiple) && $input.prop('multiple') === false) {
|
313
|
+
module.error(error.missingMultiple);
|
314
|
+
$input.prop('multiple', true);
|
315
|
+
}
|
316
|
+
if($input.is('[multiple]')) {
|
317
|
+
module.set.multiple();
|
318
|
+
}
|
312
319
|
$input
|
313
320
|
.removeAttr('class')
|
314
321
|
.detach()
|
315
322
|
.prependTo($module)
|
316
323
|
;
|
317
324
|
}
|
318
|
-
if($input.is('[multiple]')) {
|
319
|
-
module.set.multiple();
|
320
|
-
}
|
321
325
|
module.refresh();
|
322
326
|
},
|
323
327
|
menu: function(values) {
|
@@ -599,7 +603,7 @@ $.fn.dropdown = function(parameters) {
|
|
599
603
|
}
|
600
604
|
}
|
601
605
|
;
|
602
|
-
if(module.has.maxSelections()) {
|
606
|
+
if(settings.useLabels && module.has.maxSelections()) {
|
603
607
|
return;
|
604
608
|
}
|
605
609
|
if(settings.apiSettings) {
|
@@ -891,7 +895,7 @@ $.fn.dropdown = function(parameters) {
|
|
891
895
|
toggleBehavior = (module.is.multiple())
|
892
896
|
? module.show
|
893
897
|
: module.toggle
|
894
|
-
|
898
|
+
;
|
895
899
|
if( module.determine.eventOnElement(event, toggleBehavior) ) {
|
896
900
|
event.preventDefault();
|
897
901
|
}
|
@@ -1293,7 +1297,8 @@ $.fn.dropdown = function(parameters) {
|
|
1293
1297
|
eventOnElement: function(event, callback) {
|
1294
1298
|
var
|
1295
1299
|
$target = $(event.target),
|
1296
|
-
|
1300
|
+
$label = $target.closest(selector.siblingLabel),
|
1301
|
+
notOnLabel = ($module.find($label).length === 0),
|
1297
1302
|
notInMenu = ($target.closest($menu).length === 0)
|
1298
1303
|
;
|
1299
1304
|
callback = $.isFunction(callback)
|
@@ -1321,12 +1326,14 @@ $.fn.dropdown = function(parameters) {
|
|
1321
1326
|
? value
|
1322
1327
|
: text
|
1323
1328
|
;
|
1324
|
-
module.
|
1325
|
-
|
1326
|
-
|
1327
|
-
|
1328
|
-
|
1329
|
-
|
1329
|
+
if( module.can.activate( $(this) ) ) {
|
1330
|
+
module.set.selected(value, $(this));
|
1331
|
+
if(module.is.multiple() && !module.is.allFiltered()) {
|
1332
|
+
return;
|
1333
|
+
}
|
1334
|
+
else {
|
1335
|
+
module.hideAndClear();
|
1336
|
+
}
|
1330
1337
|
}
|
1331
1338
|
},
|
1332
1339
|
|
@@ -1365,9 +1372,10 @@ $.fn.dropdown = function(parameters) {
|
|
1365
1372
|
},
|
1366
1373
|
selectionCount: function() {
|
1367
1374
|
var
|
1368
|
-
values = module.get.values()
|
1375
|
+
values = module.get.values(),
|
1376
|
+
count
|
1369
1377
|
;
|
1370
|
-
|
1378
|
+
count = ( module.is.multiple() )
|
1371
1379
|
? $.isArray(values)
|
1372
1380
|
? values.length
|
1373
1381
|
: 0
|
@@ -1375,6 +1383,7 @@ $.fn.dropdown = function(parameters) {
|
|
1375
1383
|
? 1
|
1376
1384
|
: 0
|
1377
1385
|
;
|
1386
|
+
return count;
|
1378
1387
|
},
|
1379
1388
|
transition: function($subMenu) {
|
1380
1389
|
return (settings.transition == 'auto')
|
@@ -1437,10 +1446,16 @@ $.fn.dropdown = function(parameters) {
|
|
1437
1446
|
};
|
1438
1447
|
},
|
1439
1448
|
value: function() {
|
1440
|
-
|
1441
|
-
|
1442
|
-
|
1449
|
+
var
|
1450
|
+
value = ($input.length > 0)
|
1451
|
+
? $input.val()
|
1452
|
+
: $module.data(metadata.value)
|
1443
1453
|
;
|
1454
|
+
// prevents placeholder element from being selected when multiple
|
1455
|
+
if($.isArray(value) && value.length === 1 && value[0] === '') {
|
1456
|
+
return '';
|
1457
|
+
}
|
1458
|
+
return value;
|
1444
1459
|
},
|
1445
1460
|
values: function() {
|
1446
1461
|
var
|
@@ -1449,8 +1464,8 @@ $.fn.dropdown = function(parameters) {
|
|
1449
1464
|
if(value === '') {
|
1450
1465
|
return '';
|
1451
1466
|
}
|
1452
|
-
return (
|
1453
|
-
? typeof value == 'string'
|
1467
|
+
return ( !module.has.selectInput() && module.is.multiple() )
|
1468
|
+
? (typeof value == 'string') // delimited string
|
1454
1469
|
? value.split(settings.delimiter)
|
1455
1470
|
: ''
|
1456
1471
|
: value
|
@@ -1668,8 +1683,10 @@ $.fn.dropdown = function(parameters) {
|
|
1668
1683
|
;
|
1669
1684
|
if(selectionCount >= settings.maxSelections) {
|
1670
1685
|
module.debug('Maximum selection count reached');
|
1671
|
-
|
1672
|
-
|
1686
|
+
if(settings.useLabels) {
|
1687
|
+
$item.addClass(className.filtered);
|
1688
|
+
module.add.message(message.maxSelections);
|
1689
|
+
}
|
1673
1690
|
return true;
|
1674
1691
|
}
|
1675
1692
|
else {
|
@@ -2091,11 +2108,10 @@ $.fn.dropdown = function(parameters) {
|
|
2091
2108
|
}
|
2092
2109
|
}
|
2093
2110
|
|
2094
|
-
if(
|
2095
|
-
module.debug('Adding
|
2111
|
+
if( module.is.single() && module.has.selectInput() && module.can.extendSelect() ) {
|
2112
|
+
module.debug('Adding user option', value);
|
2096
2113
|
module.add.optionValue(value);
|
2097
2114
|
}
|
2098
|
-
|
2099
2115
|
module.debug('Updating input value', value, currentValue);
|
2100
2116
|
$input
|
2101
2117
|
.val(value)
|
@@ -2126,6 +2142,11 @@ $.fn.dropdown = function(parameters) {
|
|
2126
2142
|
visible: function() {
|
2127
2143
|
$module.addClass(className.visible);
|
2128
2144
|
},
|
2145
|
+
exactly: function(value, $selectedItem) {
|
2146
|
+
module.debug('Setting selected to exact values');
|
2147
|
+
module.clear();
|
2148
|
+
module.set.selected(value, $selectedItem);
|
2149
|
+
},
|
2129
2150
|
selected: function(value, $selectedItem) {
|
2130
2151
|
var
|
2131
2152
|
isMultiple = module.is.multiple(),
|
@@ -2172,8 +2193,8 @@ $.fn.dropdown = function(parameters) {
|
|
2172
2193
|
module.select.nextAvailable($selectedItem);
|
2173
2194
|
}
|
2174
2195
|
else {
|
2175
|
-
module.set.text(module.add.variables(message.count));
|
2176
2196
|
module.add.value(selectedValue, selectedText, $selected);
|
2197
|
+
module.set.text(module.add.variables(message.count));
|
2177
2198
|
$selected.addClass(className.active);
|
2178
2199
|
}
|
2179
2200
|
}
|
@@ -2266,8 +2287,13 @@ $.fn.dropdown = function(parameters) {
|
|
2266
2287
|
selectObserver.disconnect();
|
2267
2288
|
module.verbose('Temporarily disconnecting mutation observer', value);
|
2268
2289
|
}
|
2290
|
+
if( module.is.single() ) {
|
2291
|
+
module.verbose('Removing previous user addition');
|
2292
|
+
$input.find('option.' + className.addition).remove();
|
2293
|
+
}
|
2269
2294
|
$('<option/>')
|
2270
2295
|
.prop('value', value)
|
2296
|
+
.addClass(className.addition)
|
2271
2297
|
.html(value)
|
2272
2298
|
.appendTo($input)
|
2273
2299
|
;
|
@@ -2286,7 +2312,7 @@ $.fn.dropdown = function(parameters) {
|
|
2286
2312
|
hasUserSuggestion = $addition.length > 0,
|
2287
2313
|
html
|
2288
2314
|
;
|
2289
|
-
if(module.has.maxSelections()) {
|
2315
|
+
if(settings.useLabels && module.has.maxSelections()) {
|
2290
2316
|
return;
|
2291
2317
|
}
|
2292
2318
|
if(value === '' || alreadyHasValue) {
|
@@ -2348,7 +2374,7 @@ $.fn.dropdown = function(parameters) {
|
|
2348
2374
|
module.debug('Cannot select blank values from multiselect');
|
2349
2375
|
return;
|
2350
2376
|
}
|
2351
|
-
// extend
|
2377
|
+
// extend current array
|
2352
2378
|
if($.isArray(currentValue)) {
|
2353
2379
|
newValue = currentValue.concat([addedValue]);
|
2354
2380
|
newValue = module.get.uniqueArray(newValue);
|
@@ -2357,8 +2383,8 @@ $.fn.dropdown = function(parameters) {
|
|
2357
2383
|
newValue = [addedValue];
|
2358
2384
|
}
|
2359
2385
|
// add values
|
2360
|
-
if(
|
2361
|
-
if(
|
2386
|
+
if( module.has.selectInput() ) {
|
2387
|
+
if(module.can.extendSelect()) {
|
2362
2388
|
module.debug('Adding value to select', addedValue, newValue, $input);
|
2363
2389
|
module.add.optionValue(addedValue);
|
2364
2390
|
}
|
@@ -2403,7 +2429,7 @@ $.fn.dropdown = function(parameters) {
|
|
2403
2429
|
$item.removeClass(className.active);
|
2404
2430
|
},
|
2405
2431
|
filteredItem: function() {
|
2406
|
-
if( module.has.maxSelections() ) {
|
2432
|
+
if(settings.useLabels && module.has.maxSelections() ) {
|
2407
2433
|
return;
|
2408
2434
|
}
|
2409
2435
|
if(settings.useLabels) {
|
@@ -2413,6 +2439,28 @@ $.fn.dropdown = function(parameters) {
|
|
2413
2439
|
$item.removeClass(className.filtered);
|
2414
2440
|
}
|
2415
2441
|
},
|
2442
|
+
optionValue: function(value) {
|
2443
|
+
var
|
2444
|
+
$option = $input.find('option[value="' + value + '"]'),
|
2445
|
+
hasOption = ($option.length > 0)
|
2446
|
+
;
|
2447
|
+
if(!hasOption || !$option.hasClass(className.addition)) {
|
2448
|
+
return;
|
2449
|
+
}
|
2450
|
+
// temporarily disconnect observer
|
2451
|
+
if(selectObserver) {
|
2452
|
+
selectObserver.disconnect();
|
2453
|
+
module.verbose('Temporarily disconnecting mutation observer', value);
|
2454
|
+
}
|
2455
|
+
$option.remove();
|
2456
|
+
module.verbose('Removing user addition as an <option>', value);
|
2457
|
+
if(selectObserver) {
|
2458
|
+
selectObserver.observe($input[0], {
|
2459
|
+
childList : true,
|
2460
|
+
subtree : true
|
2461
|
+
});
|
2462
|
+
}
|
2463
|
+
},
|
2416
2464
|
message: function() {
|
2417
2465
|
$menu.children(selector.message).remove();
|
2418
2466
|
},
|
@@ -2466,16 +2514,16 @@ $.fn.dropdown = function(parameters) {
|
|
2466
2514
|
},
|
2467
2515
|
value: function(removedValue, removedText, $removedItem) {
|
2468
2516
|
var
|
2469
|
-
values
|
2517
|
+
values = module.get.values(),
|
2470
2518
|
newValue
|
2471
2519
|
;
|
2472
|
-
if(
|
2520
|
+
if( module.has.selectInput() ) {
|
2473
2521
|
module.verbose('Input is <select> removing selected option', removedValue);
|
2474
2522
|
newValue = module.remove.arrayValue(removedValue, values);
|
2523
|
+
module.remove.optionValue(removedValue);
|
2475
2524
|
}
|
2476
2525
|
else {
|
2477
2526
|
module.verbose('Removing from delimited values', removedValue);
|
2478
|
-
values = values.split(settings.delimiter);
|
2479
2527
|
newValue = module.remove.arrayValue(removedValue, values);
|
2480
2528
|
newValue = newValue.join(settings.delimiter);
|
2481
2529
|
}
|
@@ -2489,32 +2537,22 @@ $.fn.dropdown = function(parameters) {
|
|
2489
2537
|
module.check.maxSelections();
|
2490
2538
|
},
|
2491
2539
|
arrayValue: function(removedValue, values) {
|
2540
|
+
if( !$.isArray(values) ) {
|
2541
|
+
values = [values];
|
2542
|
+
}
|
2492
2543
|
values = $.grep(values, function(value){
|
2493
2544
|
return (removedValue != value);
|
2494
2545
|
});
|
2495
2546
|
module.verbose('Removed value from delimited string', removedValue, values);
|
2496
2547
|
return values;
|
2497
2548
|
},
|
2498
|
-
label: function(value) {
|
2549
|
+
label: function(value, shouldAnimate) {
|
2499
2550
|
var
|
2500
2551
|
$labels = $module.find(selector.label),
|
2501
|
-
$removedLabel = $labels.filter('[data-value="' + value +'"]')
|
2502
|
-
|
2503
|
-
|
2504
|
-
|
2505
|
-
;
|
2506
|
-
if(shouldAnimate) {
|
2507
|
-
module.verbose('Animating and removing label', $removedLabel);
|
2508
|
-
$removedLabel
|
2509
|
-
.transition(settings.label.transition, settings.label.duration, function() {
|
2510
|
-
$removedLabel.remove();
|
2511
|
-
})
|
2512
|
-
;
|
2513
|
-
}
|
2514
|
-
else {
|
2515
|
-
module.verbose('Removing label', $removedLabel);
|
2516
|
-
$removedLabel.remove();
|
2517
|
-
}
|
2552
|
+
$removedLabel = $labels.filter('[data-value="' + value +'"]')
|
2553
|
+
;
|
2554
|
+
module.verbose('Removing label', $removedLabel);
|
2555
|
+
$removedLabel.remove();
|
2518
2556
|
},
|
2519
2557
|
activeLabels: function($activeLabels) {
|
2520
2558
|
$activeLabels = $activeLabels || $module.find(selector.label).filter('.' + className.active);
|
@@ -2567,6 +2605,9 @@ $.fn.dropdown = function(parameters) {
|
|
2567
2605
|
search: function() {
|
2568
2606
|
return ($search.length > 0);
|
2569
2607
|
},
|
2608
|
+
selectInput: function() {
|
2609
|
+
return ( $input.is('select') );
|
2610
|
+
},
|
2570
2611
|
firstLetter: function($item, letter) {
|
2571
2612
|
var
|
2572
2613
|
text,
|
@@ -2632,7 +2673,7 @@ $.fn.dropdown = function(parameters) {
|
|
2632
2673
|
;
|
2633
2674
|
},
|
2634
2675
|
disabled: function() {
|
2635
|
-
$module.hasClass(className.disabled);
|
2676
|
+
return $module.hasClass(className.disabled);
|
2636
2677
|
},
|
2637
2678
|
focused: function() {
|
2638
2679
|
return (document.activeElement === $module[0]);
|
@@ -2741,9 +2782,24 @@ $.fn.dropdown = function(parameters) {
|
|
2741
2782
|
},
|
2742
2783
|
|
2743
2784
|
can: {
|
2785
|
+
activate: function($item) {
|
2786
|
+
if(settings.useLabels) {
|
2787
|
+
return true;
|
2788
|
+
}
|
2789
|
+
if(!module.has.maxSelections()) {
|
2790
|
+
return true;
|
2791
|
+
}
|
2792
|
+
if(module.has.maxSelections() && $item.hasClass(className.active)) {
|
2793
|
+
return true;
|
2794
|
+
}
|
2795
|
+
return false;
|
2796
|
+
},
|
2744
2797
|
click: function() {
|
2745
2798
|
return (hasTouch || settings.on == 'click');
|
2746
2799
|
},
|
2800
|
+
extendSelect: function() {
|
2801
|
+
return settings.allowAdditions || settings.apiSettings;
|
2802
|
+
},
|
2747
2803
|
show: function() {
|
2748
2804
|
return !module.is.disabled() && (module.has.items() || module.has.message());
|
2749
2805
|
},
|
@@ -3147,13 +3203,14 @@ $.fn.dropdown.settings = {
|
|
3147
3203
|
},
|
3148
3204
|
|
3149
3205
|
error : {
|
3150
|
-
action
|
3151
|
-
alreadySetup
|
3152
|
-
labels
|
3153
|
-
|
3154
|
-
|
3155
|
-
|
3156
|
-
|
3206
|
+
action : 'You called a dropdown action that was not defined',
|
3207
|
+
alreadySetup : 'Once a select has been initialized behaviors must be called on the created ui dropdown',
|
3208
|
+
labels : 'Allowing user additions currently requires the use of labels.',
|
3209
|
+
missingMultiple : '<select> requires multiple property to be set to correctly preserve multiple values',
|
3210
|
+
method : 'The method you called is not defined.',
|
3211
|
+
noAPI : 'The API module is required to load resources remotely',
|
3212
|
+
noStorage : 'Saving remote data requires session storage',
|
3213
|
+
noTransition : 'This module requires ui transitions <https://github.com/Semantic-Org/UI-Transition>'
|
3157
3214
|
},
|
3158
3215
|
|
3159
3216
|
regExp : {
|
@@ -1191,22 +1191,30 @@ $.fn.form.settings = {
|
|
1191
1191
|
return (value.search( new RegExp(text) ) === -1);
|
1192
1192
|
},
|
1193
1193
|
|
1194
|
-
// is
|
1195
|
-
|
1194
|
+
// is at least string length
|
1195
|
+
minLength: function(value, requiredLength) {
|
1196
1196
|
return (value !== undefined)
|
1197
|
-
? (value.length
|
1197
|
+
? (value.length >= requiredLength)
|
1198
1198
|
: false
|
1199
1199
|
;
|
1200
1200
|
},
|
1201
1201
|
|
1202
|
-
// is
|
1203
|
-
|
1202
|
+
// see rls notes for 2.0.6 (this is a duplicate of minLength)
|
1203
|
+
length: function(value, requiredLength) {
|
1204
1204
|
return (value !== undefined)
|
1205
1205
|
? (value.length >= requiredLength)
|
1206
1206
|
: false
|
1207
1207
|
;
|
1208
1208
|
},
|
1209
1209
|
|
1210
|
+
// is exactly length
|
1211
|
+
exactLength: function(value, requiredLength) {
|
1212
|
+
return (value !== undefined)
|
1213
|
+
? (value.length == requiredLength)
|
1214
|
+
: false
|
1215
|
+
;
|
1216
|
+
},
|
1217
|
+
|
1210
1218
|
// is less than length
|
1211
1219
|
maxLength: function(value, maxLength) {
|
1212
1220
|
return (value !== undefined)
|
@@ -22,7 +22,7 @@ $.fn.popup = function(parameters) {
|
|
22
22
|
|
23
23
|
moduleSelector = $allModules.selector || '',
|
24
24
|
|
25
|
-
hasTouch = (
|
25
|
+
hasTouch = (true),
|
26
26
|
time = new Date().getTime(),
|
27
27
|
performance = [],
|
28
28
|
|
@@ -156,7 +156,9 @@ $.fn.popup = function(parameters) {
|
|
156
156
|
: settings.delay
|
157
157
|
;
|
158
158
|
clearTimeout(module.hideTimer);
|
159
|
-
|
159
|
+
if(!openedWithTouch) {
|
160
|
+
module.showTimer = setTimeout(module.show, delay);
|
161
|
+
}
|
160
162
|
},
|
161
163
|
end: function() {
|
162
164
|
var
|
@@ -169,7 +171,7 @@ $.fn.popup = function(parameters) {
|
|
169
171
|
},
|
170
172
|
touchstart: function(event) {
|
171
173
|
openedWithTouch = true;
|
172
|
-
module.
|
174
|
+
module.show();
|
173
175
|
},
|
174
176
|
resize: function() {
|
175
177
|
if( module.is.visible() ) {
|
@@ -279,7 +281,6 @@ $.fn.popup = function(parameters) {
|
|
279
281
|
show: function(callback) {
|
280
282
|
callback = callback || function(){};
|
281
283
|
module.debug('Showing pop-up', settings.transition);
|
282
|
-
|
283
284
|
if(module.is.hidden() && !( module.is.active() && module.is.dropdown()) ) {
|
284
285
|
if( !module.exists() ) {
|
285
286
|
module.create();
|
@@ -398,8 +399,8 @@ $.fn.popup = function(parameters) {
|
|
398
399
|
hide: function(callback) {
|
399
400
|
callback = $.isFunction(callback) ? callback : function(){};
|
400
401
|
module.debug('Hiding pop-up');
|
401
|
-
if(settings.
|
402
|
-
module.debug('
|
402
|
+
if(settings.onHide.call($popup, element) === false) {
|
403
|
+
module.debug('onHide callback returned false, cancelling popup animation');
|
403
404
|
return;
|
404
405
|
}
|
405
406
|
if(settings.transition && $.fn.transition !== undefined && $module.transition('is supported')) {
|
@@ -884,7 +885,7 @@ $.fn.popup = function(parameters) {
|
|
884
885
|
.on('touchstart' + eventNamespace, module.event.touchstart)
|
885
886
|
;
|
886
887
|
}
|
887
|
-
|
888
|
+
if( module.get.startEvent() ) {
|
888
889
|
$module
|
889
890
|
.on(module.get.startEvent() + eventNamespace, module.event.start)
|
890
891
|
.on(module.get.endEvent() + eventNamespace, module.event.end)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Semantic UI 2.0.
|
2
|
+
* # Semantic UI 2.0.7 - Message
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
@@ -222,9 +222,9 @@
|
|
222
222
|
.ui.icon.message > .icon:not(.close) {
|
223
223
|
display: block;
|
224
224
|
-webkit-box-flex: 0;
|
225
|
-
-webkit-flex: 0
|
226
|
-
-ms-flex: 0
|
227
|
-
flex: 0
|
225
|
+
-webkit-flex: 0 0 auto;
|
226
|
+
-ms-flex: 0 0 auto;
|
227
|
+
flex: 0 0 auto;
|
228
228
|
width: auto;
|
229
229
|
line-height: 1;
|
230
230
|
vertical-align: middle;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Semantic UI 2.0.
|
2
|
+
* # Semantic UI 2.0.7 - Button
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
@@ -773,11 +773,13 @@
|
|
773
773
|
position: absolute;
|
774
774
|
height: 100%;
|
775
775
|
line-height: 1;
|
776
|
+
border-radius: 0px;
|
777
|
+
border-top-left-radius: inherit;
|
778
|
+
border-bottom-left-radius: inherit;
|
776
779
|
width: 2.57142857em;
|
777
780
|
background-color: rgba(0, 0, 0, 0.05);
|
778
781
|
text-align: center;
|
779
782
|
color: '';
|
780
|
-
border-radius: 0.28571429rem 0px 0px 0.28571429rem;
|
781
783
|
box-shadow: -1px 0px 0px 0px transparent inset;
|
782
784
|
}
|
783
785
|
|
@@ -796,7 +798,9 @@
|
|
796
798
|
.ui[class*="right labeled"].icon.button > .icon {
|
797
799
|
left: auto;
|
798
800
|
right: 0em;
|
799
|
-
border-radius:
|
801
|
+
border-radius: 0px;
|
802
|
+
border-top-right-radius: inherit;
|
803
|
+
border-bottom-right-radius: inherit;
|
800
804
|
box-shadow: 1px 0px 0px 0px transparent inset;
|
801
805
|
}
|
802
806
|
.ui.labeled.icon.buttons > .button > .icon:before,
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Semantic UI 2.0.
|
2
|
+
* # Semantic UI 2.0.7 - List
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
@@ -115,9 +115,12 @@ ol.ui.list ol li,
|
|
115
115
|
display: table-cell;
|
116
116
|
background-color: transparent;
|
117
117
|
margin: 0em;
|
118
|
-
padding-right: 0.5em;
|
119
118
|
vertical-align: top;
|
120
119
|
}
|
120
|
+
.ui.list .list > .item > .image:not(:only-child):not(img),
|
121
|
+
.ui.list > .item > .image:not(:only-child):not(img) {
|
122
|
+
padding-right: 0.5em;
|
123
|
+
}
|
121
124
|
.ui.list .list > .item > .image img,
|
122
125
|
.ui.list > .item > .image img {
|
123
126
|
vertical-align: top;
|
@@ -127,7 +130,6 @@ ol.ui.list ol li,
|
|
127
130
|
.ui.list > .item > img.image,
|
128
131
|
.ui.list > .item > .image:only-child {
|
129
132
|
display: inline-block;
|
130
|
-
padding-right: 0em;
|
131
133
|
}
|
132
134
|
|
133
135
|
/* Content */
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* # Semantic UI 2.0.
|
2
|
+
* # Semantic UI 2.0.7 - Checkbox
|
3
3
|
* http://github.com/semantic-org/semantic-ui/
|
4
4
|
*
|
5
5
|
*
|
@@ -26,6 +26,7 @@
|
|
26
26
|
backface-visibility: hidden;
|
27
27
|
outline: none;
|
28
28
|
vertical-align: baseline;
|
29
|
+
font-style: normal;
|
29
30
|
min-height: 17px;
|
30
31
|
font-size: 1rem;
|
31
32
|
line-height: 17px;
|
@@ -321,6 +322,12 @@
|
|
321
322
|
background-color: rgba(0, 0, 0, 0.95);
|
322
323
|
}
|
323
324
|
|
325
|
+
/* Indeterminate */
|
326
|
+
.ui.radio.checkbox input:indeterminate ~ .box:after,
|
327
|
+
.ui.radio.checkbox input:indeterminate ~ label:after {
|
328
|
+
opacity: 0;
|
329
|
+
}
|
330
|
+
|
324
331
|
/* Active */
|
325
332
|
.ui.radio.checkbox input:checked ~ .box:before,
|
326
333
|
.ui.radio.checkbox input:checked ~ label:before {
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic-ui-sass
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- doabit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|