less-rails-semantic_ui 1.10.4.0 → 1.11.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/assets/javascripts/semantic_ui/definitions/behaviors/visibility.js +84 -70
- data/assets/javascripts/semantic_ui/definitions/modules/dimmer.js +40 -2
- data/assets/javascripts/semantic_ui/definitions/modules/dropdown.js +34 -20
- data/assets/javascripts/semantic_ui/definitions/modules/modal.js +18 -14
- data/assets/javascripts/semantic_ui/definitions/modules/popup.js +70 -33
- data/assets/javascripts/semantic_ui/definitions/modules/search.js +27 -15
- data/assets/javascripts/semantic_ui/definitions/modules/sidebar.js +2 -5
- data/assets/javascripts/semantic_ui/definitions/modules/sticky.js +64 -48
- data/assets/javascripts/semantic_ui/definitions/modules/transition.js +57 -24
- data/assets/stylesheets/semantic_ui/definitions/collections/form.less +16 -2
- data/assets/stylesheets/semantic_ui/definitions/collections/grid.less +9 -10
- data/assets/stylesheets/semantic_ui/definitions/collections/menu.less +6 -5
- data/assets/stylesheets/semantic_ui/definitions/collections/table.less +4 -2
- data/assets/stylesheets/semantic_ui/definitions/elements/button.less +1 -0
- data/assets/stylesheets/semantic_ui/definitions/elements/icon.less +2 -8
- data/assets/stylesheets/semantic_ui/definitions/elements/image.less +9 -0
- data/assets/stylesheets/semantic_ui/definitions/elements/list.less +2 -2
- data/assets/stylesheets/semantic_ui/definitions/elements/segment.less +10 -1
- data/assets/stylesheets/semantic_ui/definitions/modules/dropdown.less +12 -4
- data/assets/stylesheets/semantic_ui/definitions/views/item.less +1 -2
- data/assets/stylesheets/semantic_ui/themes/basic/elements/icon.overrides +156 -156
- data/assets/stylesheets/semantic_ui/themes/basic/elements/icon.variables +7 -0
- data/assets/stylesheets/semantic_ui/themes/default/collections/menu.variables +5 -0
- data/assets/stylesheets/semantic_ui/themes/default/elements/icon.overrides +0 -12
- data/assets/stylesheets/semantic_ui/themes/default/elements/icon.variables +10 -1
- data/assets/stylesheets/semantic_ui/themes/default/globals/site.variables +3 -0
- data/assets/stylesheets/semantic_ui/themes/default/modules/dropdown.variables +4 -1
- data/assets/stylesheets/semantic_ui/themes/default/modules/transition.overrides +50 -50
- data/assets/stylesheets/semantic_ui/themes/default/views/item.variables +3 -3
- data/assets/stylesheets/semantic_ui/themes/material/elements/button.overrides +3 -0
- data/lib/generators/semantic_ui/install/templates/theme.config +0 -12
- data/lib/less/rails/semantic_ui/version.rb +1 -1
- data/tasks/update.rake +4 -0
- metadata +2 -2
@@ -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
|
|
@@ -192,7 +192,7 @@ $.fn.modal = function(parameters) {
|
|
192
192
|
},
|
193
193
|
|
194
194
|
get: {
|
195
|
-
|
195
|
+
id: function() {
|
196
196
|
return (Math.random().toString(16) + '000000000').substr(2,8);
|
197
197
|
}
|
198
198
|
},
|
@@ -302,7 +302,7 @@ $.fn.modal = function(parameters) {
|
|
302
302
|
module.set.type();
|
303
303
|
module.set.clickaway();
|
304
304
|
|
305
|
-
if( !settings.allowMultiple && $otherModals.filter('
|
305
|
+
if( !settings.allowMultiple && $otherModals.filter('.' + className.active).length > 0) {
|
306
306
|
module.debug('Other modals visible, queueing show animation');
|
307
307
|
module.hideOthers(module.showModal);
|
308
308
|
}
|
@@ -347,7 +347,7 @@ $.fn.modal = function(parameters) {
|
|
347
347
|
}
|
348
348
|
},
|
349
349
|
|
350
|
-
hideModal: function(callback) {
|
350
|
+
hideModal: function(callback, keepDimmed) {
|
351
351
|
callback = $.isFunction(callback)
|
352
352
|
? callback
|
353
353
|
: function(){}
|
@@ -366,7 +366,7 @@ $.fn.modal = function(parameters) {
|
|
366
366
|
duration : settings.duration,
|
367
367
|
useFailSafe : true,
|
368
368
|
onStart : function() {
|
369
|
-
if(
|
369
|
+
if(!module.othersActive() && !keepDimmed) {
|
370
370
|
module.hideDimmer();
|
371
371
|
}
|
372
372
|
module.remove.keyboardShortcuts();
|
@@ -422,30 +422,34 @@ $.fn.modal = function(parameters) {
|
|
422
422
|
},
|
423
423
|
|
424
424
|
hideAll: function(callback) {
|
425
|
+
var
|
426
|
+
$visibleModals = $allModals.filter(':visible')
|
427
|
+
;
|
425
428
|
callback = $.isFunction(callback)
|
426
429
|
? callback
|
427
430
|
: function(){}
|
428
431
|
;
|
429
|
-
if( $
|
432
|
+
if( $visibleModals.length > 0 ) {
|
430
433
|
module.debug('Hiding all visible modals');
|
431
434
|
module.hideDimmer();
|
432
|
-
$
|
433
|
-
.
|
434
|
-
.modal('hide modal', callback)
|
435
|
+
$visibleModals
|
436
|
+
.modal('hide modal', callback)
|
435
437
|
;
|
436
438
|
}
|
437
439
|
},
|
438
440
|
|
439
441
|
hideOthers: function(callback) {
|
442
|
+
var
|
443
|
+
$visibleModals = $otherModals.filter(':visible')
|
444
|
+
;
|
440
445
|
callback = $.isFunction(callback)
|
441
446
|
? callback
|
442
447
|
: function(){}
|
443
448
|
;
|
444
|
-
if( $
|
449
|
+
if( $visibleModals.length > 0 ) {
|
445
450
|
module.debug('Hiding other modals', $otherModals);
|
446
|
-
$
|
447
|
-
.
|
448
|
-
.modal('hide modal', callback)
|
451
|
+
$visibleModals
|
452
|
+
.modal('hide modal', callback, true)
|
449
453
|
;
|
450
454
|
}
|
451
455
|
},
|
@@ -62,6 +62,9 @@ $.fn.popup = function(parameters) {
|
|
62
62
|
|
63
63
|
element = this,
|
64
64
|
instance = $module.data(moduleNamespace),
|
65
|
+
|
66
|
+
elementNamespace,
|
67
|
+
id,
|
65
68
|
module
|
66
69
|
;
|
67
70
|
|
@@ -69,24 +72,9 @@ $.fn.popup = function(parameters) {
|
|
69
72
|
|
70
73
|
// binds events
|
71
74
|
initialize: function() {
|
72
|
-
module.debug('Initializing
|
73
|
-
|
74
|
-
|
75
|
-
.on('click' + eventNamespace, module.toggle)
|
76
|
-
;
|
77
|
-
}
|
78
|
-
else if( module.get.startEvent() ) {
|
79
|
-
$module
|
80
|
-
.on(module.get.startEvent() + eventNamespace, module.event.start)
|
81
|
-
.on(module.get.endEvent() + eventNamespace, module.event.end)
|
82
|
-
;
|
83
|
-
}
|
84
|
-
if(settings.target) {
|
85
|
-
module.debug('Target set to element', $target);
|
86
|
-
}
|
87
|
-
$window
|
88
|
-
.on('resize' + eventNamespace, module.event.resize)
|
89
|
-
;
|
75
|
+
module.debug('Initializing', $module);
|
76
|
+
module.createID();
|
77
|
+
module.bind.events();
|
90
78
|
if( !module.exists() && settings.preserve) {
|
91
79
|
module.create();
|
92
80
|
}
|
@@ -94,7 +82,7 @@ $.fn.popup = function(parameters) {
|
|
94
82
|
},
|
95
83
|
|
96
84
|
instantiate: function() {
|
97
|
-
module.verbose('Storing instance
|
85
|
+
module.verbose('Storing instance', module);
|
98
86
|
instance = module;
|
99
87
|
$module
|
100
88
|
.data(moduleNamespace, instance)
|
@@ -143,11 +131,15 @@ $.fn.popup = function(parameters) {
|
|
143
131
|
|
144
132
|
destroy: function() {
|
145
133
|
module.debug('Destroying previous module');
|
134
|
+
// remove element only if was created dynamically
|
146
135
|
if($popup && !settings.preserve) {
|
147
136
|
module.removePopup();
|
148
137
|
}
|
138
|
+
// clear all timeouts
|
149
139
|
clearTimeout(module.hideTimer);
|
150
140
|
clearTimeout(module.showTimer);
|
141
|
+
// remove events
|
142
|
+
$window.off(elementNamespace);
|
151
143
|
$module
|
152
144
|
.off(eventNamespace)
|
153
145
|
.removeData(moduleNamespace)
|
@@ -207,6 +199,7 @@ $.fn.popup = function(parameters) {
|
|
207
199
|
$popup = $('<div/>')
|
208
200
|
.addClass(className.popup)
|
209
201
|
.addClass(variation)
|
202
|
+
.data(metadata.activator, $module)
|
210
203
|
.html(html)
|
211
204
|
;
|
212
205
|
if(variation) {
|
@@ -235,13 +228,14 @@ $.fn.popup = function(parameters) {
|
|
235
228
|
else if($target.next(selector.popup).length !== 0) {
|
236
229
|
module.verbose('Pre-existing popup found');
|
237
230
|
settings.inline = true;
|
238
|
-
settings.popup = $target.next(selector.popup);
|
231
|
+
settings.popup = $target.next(selector.popup).data(metadata.activator, $module);
|
239
232
|
module.refresh();
|
240
233
|
if(settings.hoverable) {
|
241
234
|
module.bind.popup();
|
242
235
|
}
|
243
236
|
}
|
244
237
|
else if(settings.popup) {
|
238
|
+
settings.popup.data(metadata.activator, $module);
|
245
239
|
module.verbose('Used popup specified in settings');
|
246
240
|
module.refresh();
|
247
241
|
if(settings.hoverable) {
|
@@ -253,13 +247,18 @@ $.fn.popup = function(parameters) {
|
|
253
247
|
}
|
254
248
|
},
|
255
249
|
|
250
|
+
createID: function() {
|
251
|
+
id = (Math.random().toString(16) + '000000000').substr(2,8);
|
252
|
+
elementNamespace = '.' + id;
|
253
|
+
module.verbose('Creating unique id for element', id);
|
254
|
+
},
|
255
|
+
|
256
256
|
// determines popup state
|
257
257
|
toggle: function() {
|
258
258
|
module.debug('Toggling pop-up');
|
259
259
|
if( module.is.hidden() ) {
|
260
260
|
module.debug('Popup is hidden, showing pop-up');
|
261
261
|
module.unbind.close();
|
262
|
-
module.hideAll();
|
263
262
|
module.show();
|
264
263
|
}
|
265
264
|
else {
|
@@ -279,6 +278,9 @@ $.fn.popup = function(parameters) {
|
|
279
278
|
}
|
280
279
|
if( $popup && module.set.position() ) {
|
281
280
|
module.save.conditions();
|
281
|
+
if(settings.exclusive) {
|
282
|
+
module.hideAll();
|
283
|
+
}
|
282
284
|
module.animate.show(callback);
|
283
285
|
}
|
284
286
|
},
|
@@ -296,8 +298,13 @@ $.fn.popup = function(parameters) {
|
|
296
298
|
|
297
299
|
hideAll: function() {
|
298
300
|
$(selector.popup)
|
299
|
-
.filter('
|
300
|
-
|
301
|
+
.filter('.' + className.visible)
|
302
|
+
.each(function() {
|
303
|
+
$(this)
|
304
|
+
.data(metadata.activator)
|
305
|
+
.popup('hide')
|
306
|
+
;
|
307
|
+
})
|
301
308
|
;
|
302
309
|
},
|
303
310
|
|
@@ -423,15 +430,27 @@ $.fn.popup = function(parameters) {
|
|
423
430
|
},
|
424
431
|
|
425
432
|
get: {
|
433
|
+
id: function() {
|
434
|
+
return id;
|
435
|
+
},
|
426
436
|
startEvent: function() {
|
427
437
|
if(settings.on == 'hover') {
|
428
|
-
return
|
438
|
+
return (hasTouch)
|
439
|
+
? 'touchstart mouseenter'
|
440
|
+
: 'mouseenter'
|
441
|
+
;
|
429
442
|
}
|
430
443
|
else if(settings.on == 'focus') {
|
431
444
|
return 'focus';
|
432
445
|
}
|
433
446
|
return false;
|
434
447
|
},
|
448
|
+
scrollEvent: function() {
|
449
|
+
return (hasTouch)
|
450
|
+
? 'touchmove scroll'
|
451
|
+
: 'scroll'
|
452
|
+
;
|
453
|
+
},
|
435
454
|
endEvent: function() {
|
436
455
|
if(settings.on == 'hover') {
|
437
456
|
return 'mouseleave';
|
@@ -741,7 +760,7 @@ $.fn.popup = function(parameters) {
|
|
741
760
|
}
|
742
761
|
else if(!settings.lastResort) {
|
743
762
|
module.debug('Popup could not find a position in view', $popup);
|
744
|
-
module.error(error.cannotPlace);
|
763
|
+
module.error(error.cannotPlace, element);
|
745
764
|
module.remove.attempts();
|
746
765
|
module.remove.loading();
|
747
766
|
module.reset();
|
@@ -782,6 +801,24 @@ $.fn.popup = function(parameters) {
|
|
782
801
|
},
|
783
802
|
|
784
803
|
bind: {
|
804
|
+
events: function() {
|
805
|
+
module.debug('Binding popup events to module');
|
806
|
+
if(settings.on == 'click') {
|
807
|
+
$module
|
808
|
+
.on('click' + eventNamespace, module.toggle)
|
809
|
+
;
|
810
|
+
}
|
811
|
+
else if( module.get.startEvent() ) {
|
812
|
+
$module
|
813
|
+
.on(module.get.startEvent() + eventNamespace, module.event.start)
|
814
|
+
.on(module.get.endEvent() + eventNamespace, module.event.end)
|
815
|
+
;
|
816
|
+
}
|
817
|
+
if(settings.target) {
|
818
|
+
module.debug('Target set to element', $target);
|
819
|
+
}
|
820
|
+
$window.on('resize' + elementNamespace, module.event.resize);
|
821
|
+
},
|
785
822
|
popup: function() {
|
786
823
|
module.verbose('Allowing hover events on popup to prevent closing');
|
787
824
|
if( $popup && module.has.popup() ) {
|
@@ -794,18 +831,16 @@ $.fn.popup = function(parameters) {
|
|
794
831
|
close:function() {
|
795
832
|
if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') {
|
796
833
|
$document
|
797
|
-
.one(
|
798
|
-
.one('scroll' + eventNamespace, module.hideGracefully)
|
834
|
+
.one(module.get.scrollEvent() + elementNamespace, module.hideGracefully)
|
799
835
|
;
|
800
836
|
$context
|
801
|
-
.one(
|
802
|
-
.one('scroll' + eventNamespace, module.hideGracefully)
|
837
|
+
.one(module.get.scrollEvent() + elementNamespace, module.hideGracefully)
|
803
838
|
;
|
804
839
|
}
|
805
840
|
if(settings.on == 'click' && settings.closable) {
|
806
841
|
module.verbose('Binding popup close event to document');
|
807
842
|
$document
|
808
|
-
.on('click' +
|
843
|
+
.on('click' + elementNamespace, function(event) {
|
809
844
|
module.verbose('Pop-up clickaway intent detected');
|
810
845
|
module.hideGracefully.call(element, event);
|
811
846
|
})
|
@@ -818,16 +853,16 @@ $.fn.popup = function(parameters) {
|
|
818
853
|
close: function() {
|
819
854
|
if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') {
|
820
855
|
$document
|
821
|
-
.off('scroll' +
|
856
|
+
.off('scroll' + elementNamespace, module.hide)
|
822
857
|
;
|
823
858
|
$context
|
824
|
-
.off('scroll' +
|
859
|
+
.off('scroll' + elementNamespace, module.hide)
|
825
860
|
;
|
826
861
|
}
|
827
862
|
if(settings.on == 'click' && settings.closable) {
|
828
863
|
module.verbose('Removing close event from document');
|
829
864
|
$document
|
830
|
-
.off('click' +
|
865
|
+
.off('click' + elementNamespace)
|
831
866
|
;
|
832
867
|
}
|
833
868
|
}
|
@@ -1074,6 +1109,7 @@ $.fn.popup.settings = {
|
|
1074
1109
|
on : 'hover',
|
1075
1110
|
closable : true,
|
1076
1111
|
hideOnScroll : 'auto',
|
1112
|
+
exclusive : true,
|
1077
1113
|
|
1078
1114
|
context : 'body',
|
1079
1115
|
|
@@ -1110,6 +1146,7 @@ $.fn.popup.settings = {
|
|
1110
1146
|
},
|
1111
1147
|
|
1112
1148
|
metadata: {
|
1149
|
+
activator : 'activator',
|
1113
1150
|
content : 'content',
|
1114
1151
|
html : 'html',
|
1115
1152
|
offset : 'offset',
|
@@ -68,6 +68,7 @@ $.fn.search = function(parameters) {
|
|
68
68
|
if(settings.automatic) {
|
69
69
|
$prompt
|
70
70
|
.on(inputEvent + eventNamespace, module.throttle)
|
71
|
+
.attr('autocomplete', 'off')
|
71
72
|
;
|
72
73
|
}
|
73
74
|
$prompt
|
@@ -356,11 +357,12 @@ $.fn.search = function(parameters) {
|
|
356
357
|
query: function() {
|
357
358
|
var
|
358
359
|
searchTerm = module.get.value(),
|
359
|
-
|
360
|
+
cache = module.read.cache(searchTerm)
|
360
361
|
;
|
361
|
-
if(
|
362
|
+
if(cache) {
|
362
363
|
module.debug('Reading result for ' + searchTerm + ' from cache');
|
363
|
-
module.
|
364
|
+
module.save.results(cache.results);
|
365
|
+
module.addResults(cache.html);
|
364
366
|
}
|
365
367
|
else {
|
366
368
|
module.debug('Querying for ' + searchTerm);
|
@@ -376,6 +378,9 @@ $.fn.search = function(parameters) {
|
|
376
378
|
module.debug('Searching with default search API endpoint');
|
377
379
|
module.search.remote(searchTerm);
|
378
380
|
}
|
381
|
+
else {
|
382
|
+
module.error(error.noEndpoint);
|
383
|
+
}
|
379
384
|
}
|
380
385
|
else {
|
381
386
|
module.error(error.source);
|
@@ -398,7 +403,10 @@ $.fn.search = function(parameters) {
|
|
398
403
|
results: searchResults
|
399
404
|
});
|
400
405
|
module.remove.loading();
|
401
|
-
module.write.
|
406
|
+
module.write.cache(searchTerm, {
|
407
|
+
html : searchHTML,
|
408
|
+
results : searchResults
|
409
|
+
});
|
402
410
|
module.addResults(searchHTML);
|
403
411
|
},
|
404
412
|
remote: function(searchTerm) {
|
@@ -430,8 +438,9 @@ $.fn.search = function(parameters) {
|
|
430
438
|
searchFields = $.isArray(settings.searchFields)
|
431
439
|
? settings.searchFields
|
432
440
|
: [settings.searchFields],
|
433
|
-
|
434
|
-
|
441
|
+
searchExp = searchTerm.replace(regExp.escape, '\\$&'),
|
442
|
+
searchRegExp = new RegExp(regExp.exact + searchExp, 'i'),
|
443
|
+
fullTextRegExp = new RegExp(searchExp, 'i')
|
435
444
|
;
|
436
445
|
|
437
446
|
source = source || settings.source;
|
@@ -470,13 +479,14 @@ $.fn.search = function(parameters) {
|
|
470
479
|
;
|
471
480
|
module.verbose('Parsing server response', response);
|
472
481
|
if(response !== undefined) {
|
473
|
-
if(searchTerm) {
|
474
|
-
module.write.
|
475
|
-
|
476
|
-
|
477
|
-
}
|
482
|
+
if(searchTerm !== undefined && response.results !== undefined) {
|
483
|
+
module.write.cache(searchTerm, {
|
484
|
+
html : searchHTML,
|
485
|
+
results : response.results
|
486
|
+
});
|
487
|
+
module.save.results(response.results);
|
488
|
+
module.addResults(searchHTML);
|
478
489
|
}
|
479
|
-
module.addResults(searchHTML);
|
480
490
|
}
|
481
491
|
}
|
482
492
|
},
|
@@ -510,7 +520,7 @@ $.fn.search = function(parameters) {
|
|
510
520
|
},
|
511
521
|
|
512
522
|
read: {
|
513
|
-
|
523
|
+
cache: function(name) {
|
514
524
|
var
|
515
525
|
cache = $module.data(metadata.cache)
|
516
526
|
;
|
@@ -533,7 +543,7 @@ $.fn.search = function(parameters) {
|
|
533
543
|
},
|
534
544
|
|
535
545
|
write: {
|
536
|
-
|
546
|
+
cache: function(name, value) {
|
537
547
|
var
|
538
548
|
cache = ($module.data(metadata.cache) !== undefined)
|
539
549
|
? $module.data(metadata.cache)
|
@@ -878,6 +888,7 @@ $.fn.search.settings = {
|
|
878
888
|
source : 'Cannot search. No source used, and Semantic API module was not included',
|
879
889
|
noResults : 'Your search returned no results',
|
880
890
|
logging : 'Error in debug logging, exiting.',
|
891
|
+
noEndpoint : 'No search endpoint was specified',
|
881
892
|
noTemplate : 'A valid template name was not specified.',
|
882
893
|
serverError : 'There was an issue with querying the server.',
|
883
894
|
maxResults : 'Results must be an array to use maxResults setting',
|
@@ -890,7 +901,8 @@ $.fn.search.settings = {
|
|
890
901
|
},
|
891
902
|
|
892
903
|
regExp: {
|
893
|
-
|
904
|
+
escape : /[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,
|
905
|
+
exact : '(?:\s|^)'
|
894
906
|
},
|
895
907
|
|
896
908
|
selector : {
|
@@ -114,9 +114,9 @@ $.fn.sidebar = function(parameters) {
|
|
114
114
|
|
115
115
|
create: {
|
116
116
|
id: function() {
|
117
|
-
|
118
|
-
id = module.get.uniqueID();
|
117
|
+
id = (Math.random().toString(16) + '000000000').substr(2,8);
|
119
118
|
elementNamespace = '.' + id;
|
119
|
+
module.verbose('Creating unique id for element', id);
|
120
120
|
}
|
121
121
|
},
|
122
122
|
|
@@ -730,9 +730,6 @@ $.fn.sidebar = function(parameters) {
|
|
730
730
|
return transitions[transition];
|
731
731
|
}
|
732
732
|
}
|
733
|
-
},
|
734
|
-
uniqueID: function() {
|
735
|
-
return (Math.random().toString(16) + '000000000').substr(2,8);
|
736
733
|
}
|
737
734
|
},
|
738
735
|
|