less-rails-semantic_ui 1.6.2.0 → 1.7.0.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/api.js +9 -9
- data/assets/javascripts/semantic_ui/definitions/behaviors/form.js +23 -23
- data/assets/javascripts/semantic_ui/definitions/behaviors/state.js +6 -6
- data/assets/javascripts/semantic_ui/definitions/behaviors/visibility.js +3 -3
- data/assets/javascripts/semantic_ui/definitions/behaviors/visit.js +7 -7
- data/assets/javascripts/semantic_ui/definitions/globals/site.js +2 -2
- data/assets/javascripts/semantic_ui/definitions/modules/accordion.js +12 -12
- data/assets/javascripts/semantic_ui/definitions/modules/checkbox.js +14 -13
- data/assets/javascripts/semantic_ui/definitions/modules/dimmer.js +9 -9
- data/assets/javascripts/semantic_ui/definitions/modules/dropdown.js +98 -58
- data/assets/javascripts/semantic_ui/definitions/modules/modal.js +14 -14
- data/assets/javascripts/semantic_ui/definitions/modules/popup.js +90 -39
- data/assets/javascripts/semantic_ui/definitions/modules/progress.js +12 -6
- data/assets/javascripts/semantic_ui/definitions/modules/rating.js +6 -6
- data/assets/javascripts/semantic_ui/definitions/modules/search.js +216 -205
- data/assets/javascripts/semantic_ui/definitions/modules/shape.js +8 -8
- data/assets/javascripts/semantic_ui/definitions/modules/sidebar.js +112 -89
- data/assets/javascripts/semantic_ui/definitions/modules/sticky.js +11 -11
- data/assets/javascripts/semantic_ui/definitions/modules/tab.js +12 -12
- data/assets/javascripts/semantic_ui/definitions/modules/transition.js +9 -9
- data/assets/javascripts/semantic_ui/definitions/modules/video.js +4 -4
- data/assets/stylesheets/semantic_ui/definitions/collections/grid.less +65 -10
- data/assets/stylesheets/semantic_ui/definitions/collections/menu.less +10 -6
- data/assets/stylesheets/semantic_ui/definitions/elements/button.less +54 -55
- data/assets/stylesheets/semantic_ui/definitions/elements/label.less +4 -4
- data/assets/stylesheets/semantic_ui/definitions/elements/list.less +4 -2
- data/assets/stylesheets/semantic_ui/definitions/elements/segment.less +0 -7
- data/assets/stylesheets/semantic_ui/definitions/elements/step.less +41 -40
- data/assets/stylesheets/semantic_ui/definitions/globals/site.less +19 -0
- data/assets/stylesheets/semantic_ui/definitions/modules/dropdown.less +108 -23
- data/assets/stylesheets/semantic_ui/definitions/modules/popup.less +0 -2
- data/assets/stylesheets/semantic_ui/definitions/modules/sidebar.less +109 -27
- data/assets/stylesheets/semantic_ui/themes/default/collections/menu.variables +3 -0
- data/assets/stylesheets/semantic_ui/themes/default/elements/button.variables +24 -0
- data/assets/stylesheets/semantic_ui/themes/default/globals/site.variables +5 -2
- data/assets/stylesheets/semantic_ui/themes/default/modules/dropdown.variables +22 -6
- data/assets/stylesheets/semantic_ui/themes/default/modules/sidebar.variables +21 -12
- data/assets/stylesheets/semantic_ui/themes/material/elements/button.overrides +0 -4
- data/assets/stylesheets/semantic_ui/themes/rtl/globals/site.overrides +6 -0
- data/assets/stylesheets/semantic_ui/themes/rtl/globals/site.variables +14 -0
- data/lib/less/rails/semantic_ui/version.rb +1 -1
- metadata +4 -2
@@ -115,7 +115,7 @@ $.fn.shape = function(parameters) {
|
|
115
115
|
module.reset();
|
116
116
|
module.set.active();
|
117
117
|
};
|
118
|
-
|
118
|
+
settings.beforeChange.call($nextSide.get());
|
119
119
|
if(module.get.transitionEvent()) {
|
120
120
|
module.verbose('Starting CSS animation');
|
121
121
|
$module
|
@@ -189,7 +189,7 @@ $.fn.shape = function(parameters) {
|
|
189
189
|
|
190
190
|
defaultSide: function() {
|
191
191
|
$activeSide = $module.find('.' + settings.className.active);
|
192
|
-
$nextSide = ( $activeSide.next(selector.side).
|
192
|
+
$nextSide = ( $activeSide.next(selector.side).length > 0 )
|
193
193
|
? $activeSide.next(selector.side)
|
194
194
|
: $module.find(selector.side).first()
|
195
195
|
;
|
@@ -222,7 +222,7 @@ $.fn.shape = function(parameters) {
|
|
222
222
|
$activeSide = $clone.find('.' + settings.className.active),
|
223
223
|
$nextSide = (nextIndex)
|
224
224
|
? $clone.find(selector.side).eq(nextIndex)
|
225
|
-
: ( $activeSide.next(selector.side).
|
225
|
+
: ( $activeSide.next(selector.side).length > 0 )
|
226
226
|
? $activeSide.next(selector.side)
|
227
227
|
: $clone.find(selector.side).first(),
|
228
228
|
newSize = {}
|
@@ -245,7 +245,7 @@ $.fn.shape = function(parameters) {
|
|
245
245
|
nextIndex = selector;
|
246
246
|
$nextSide = $side.filter(selector);
|
247
247
|
nextIndex = $side.index($nextSide);
|
248
|
-
if($nextSide.
|
248
|
+
if($nextSide.length === 0) {
|
249
249
|
module.set.defaultSide();
|
250
250
|
module.error(error.side);
|
251
251
|
}
|
@@ -260,7 +260,7 @@ $.fn.shape = function(parameters) {
|
|
260
260
|
$nextSide
|
261
261
|
.addClass(className.active)
|
262
262
|
;
|
263
|
-
|
263
|
+
settings.onChange.call($nextSide.get());
|
264
264
|
module.set.defaultSide();
|
265
265
|
}
|
266
266
|
},
|
@@ -458,7 +458,7 @@ $.fn.shape = function(parameters) {
|
|
458
458
|
},
|
459
459
|
|
460
460
|
nextSide: function() {
|
461
|
-
return ( $activeSide.next(selector.side).
|
461
|
+
return ( $activeSide.next(selector.side).length > 0 )
|
462
462
|
? $activeSide.next(selector.side)
|
463
463
|
: $module.find(selector.side).first()
|
464
464
|
;
|
@@ -683,8 +683,8 @@ $.fn.shape = function(parameters) {
|
|
683
683
|
if(moduleSelector) {
|
684
684
|
title += ' \'' + moduleSelector + '\'';
|
685
685
|
}
|
686
|
-
if($allModules.
|
687
|
-
title += ' ' + '(' + $allModules.
|
686
|
+
if($allModules.length > 1) {
|
687
|
+
title += ' ' + '(' + $allModules.length + ')';
|
688
688
|
}
|
689
689
|
if( (console.group !== undefined || console.table !== undefined) && performance.length > 0) {
|
690
690
|
console.groupCollapsed(title);
|
@@ -15,20 +15,20 @@
|
|
15
15
|
|
16
16
|
$.fn.sidebar = function(parameters) {
|
17
17
|
var
|
18
|
-
$allModules
|
19
|
-
$window
|
20
|
-
$document
|
21
|
-
$html
|
22
|
-
$head
|
18
|
+
$allModules = $(this),
|
19
|
+
$window = $(window),
|
20
|
+
$document = $(document),
|
21
|
+
$html = $('html'),
|
22
|
+
$head = $('head'),
|
23
23
|
|
24
|
-
moduleSelector
|
24
|
+
moduleSelector = $allModules.selector || '',
|
25
25
|
|
26
|
-
time
|
27
|
-
performance
|
26
|
+
time = new Date().getTime(),
|
27
|
+
performance = [],
|
28
28
|
|
29
|
-
query
|
30
|
-
methodInvoked
|
31
|
-
queryArguments
|
29
|
+
query = arguments[0],
|
30
|
+
methodInvoked = (typeof query == 'string'),
|
31
|
+
queryArguments = [].slice.call(arguments, 1),
|
32
32
|
|
33
33
|
requestAnimationFrame = window.requestAnimationFrame
|
34
34
|
|| window.mozRequestAnimationFrame
|
@@ -93,7 +93,12 @@ $.fn.sidebar = function(parameters) {
|
|
93
93
|
}
|
94
94
|
|
95
95
|
// avoids locking rendering if initialized in onReady
|
96
|
-
|
96
|
+
if(settings.delaySetup) {
|
97
|
+
requestAnimationFrame(module.setup.layout);
|
98
|
+
}
|
99
|
+
else {
|
100
|
+
module.setup.layout();
|
101
|
+
}
|
97
102
|
|
98
103
|
module.instantiate();
|
99
104
|
},
|
@@ -129,7 +134,7 @@ $.fn.sidebar = function(parameters) {
|
|
129
134
|
|
130
135
|
event: {
|
131
136
|
clickaway: function(event) {
|
132
|
-
if( $(event.target).closest(selector.sidebar).
|
137
|
+
if( $(event.target).closest(selector.sidebar).length === 0 ) {
|
133
138
|
module.verbose('User clicked on dimmed page');
|
134
139
|
module.hide();
|
135
140
|
}
|
@@ -146,7 +151,7 @@ $.fn.sidebar = function(parameters) {
|
|
146
151
|
}
|
147
152
|
},
|
148
153
|
scroll: function(event) {
|
149
|
-
if( $(event.target).closest(selector.sidebar).
|
154
|
+
if( $(event.target).closest(selector.sidebar).length === 0 ) {
|
150
155
|
event.preventDefault();
|
151
156
|
}
|
152
157
|
}
|
@@ -192,73 +197,78 @@ $.fn.sidebar = function(parameters) {
|
|
192
197
|
},
|
193
198
|
|
194
199
|
add: {
|
195
|
-
bodyCSS: function(
|
200
|
+
bodyCSS: function() {
|
196
201
|
var
|
197
|
-
width
|
198
|
-
height
|
202
|
+
width = $module.outerWidth(),
|
203
|
+
height = $module.outerHeight(),
|
204
|
+
direction = module.get.direction(),
|
205
|
+
distance = {
|
206
|
+
left : width,
|
207
|
+
right : -width,
|
208
|
+
top : height,
|
209
|
+
bottom : -height
|
210
|
+
},
|
199
211
|
style
|
200
212
|
;
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
+ ' transform: translate3d(0, -' + height + 'px, 0);'
|
229
|
-
+ ' }'
|
230
|
-
;
|
213
|
+
if( module.is.rtl() ){
|
214
|
+
module.verbose('RTL detected, flipping widths');
|
215
|
+
distance.left = -width;
|
216
|
+
distance.right = width;
|
217
|
+
}
|
218
|
+
|
219
|
+
style = '<style title="' + namespace + '">';
|
220
|
+
|
221
|
+
if(direction === 'left' || direction === 'right') {
|
222
|
+
module.debug('Adding CSS rules for animation distance', width);
|
223
|
+
style += ''
|
224
|
+
+ ' .ui.visible.' + direction + '.sidebar ~ .fixed,'
|
225
|
+
+ ' .ui.visible.' + direction + '.sidebar ~ .pusher {'
|
226
|
+
+ ' -webkit-transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
227
|
+
+ ' transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
228
|
+
+ ' }'
|
229
|
+
;
|
230
|
+
}
|
231
|
+
else if(direction === 'top' || direction == 'bottom') {
|
232
|
+
style += ''
|
233
|
+
+ ' .ui.visible.' + direction + '.sidebar ~ .fixed,'
|
234
|
+
+ ' .ui.visible.' + direction + '.sidebar ~ .pusher {'
|
235
|
+
+ ' -webkit-transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
236
|
+
+ ' transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
237
|
+
+ ' }'
|
238
|
+
;
|
239
|
+
}
|
231
240
|
|
232
241
|
/* IE is only browser not to create context with transforms */
|
233
242
|
/* https://www.w3.org/Bugs/Public/show_bug.cgi?id=16328 */
|
234
243
|
if( module.is.ie() ) {
|
244
|
+
if(direction === 'left' || direction === 'right') {
|
245
|
+
module.debug('Adding CSS rules for animation distance', width);
|
246
|
+
style += ''
|
247
|
+
+ ' .ui.visible.' + direction + '.sidebar ~ .pusher:after {'
|
248
|
+
+ ' -webkit-transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
249
|
+
+ ' transform: translate3d('+ distance[direction] + 'px, 0, 0);'
|
250
|
+
+ ' }'
|
251
|
+
;
|
252
|
+
}
|
253
|
+
else if(direction === 'top' || direction == 'bottom') {
|
254
|
+
style += ''
|
255
|
+
+ ' .ui.visible.' + direction + '.sidebar ~ .pusher:after {'
|
256
|
+
+ ' -webkit-transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
257
|
+
+ ' transform: translate3d(0, ' + distance[direction] + 'px, 0);'
|
258
|
+
+ ' }'
|
259
|
+
;
|
260
|
+
}
|
261
|
+
/* opposite sides visible forces content overlay */
|
235
262
|
style += ''
|
236
|
-
+ ' .ui.visible.left.sidebar ~ .pusher:after {'
|
237
|
-
+ ' -webkit-transform: translate3d('+ width + 'px, 0, 0);'
|
238
|
-
+ ' transform: translate3d('+ width + 'px, 0, 0);'
|
239
|
-
+ ' }'
|
240
|
-
+ ' .ui.visible.right.sidebar ~ .pusher:after {'
|
241
|
-
+ ' -webkit-transform: translate3d(-'+ width + 'px, 0, 0);'
|
242
|
-
+ ' transform: translate3d(-'+ width + 'px, 0, 0);'
|
243
|
-
+ ' }'
|
244
263
|
+ ' .ui.visible.left.sidebar ~ .ui.visible.right.sidebar ~ .pusher:after,'
|
245
264
|
+ ' .ui.visible.right.sidebar ~ .ui.visible.left.sidebar ~ .pusher:after {'
|
246
265
|
+ ' -webkit-transform: translate3d(0px, 0, 0);'
|
247
266
|
+ ' transform: translate3d(0px, 0, 0);'
|
248
267
|
+ ' }'
|
249
|
-
+ ' .ui.visible.top.sidebar ~ .pusher:after {'
|
250
|
-
+ ' -webkit-transform: translate3d(0, ' + height + 'px, 0);'
|
251
|
-
+ ' transform: translate3d(0, ' + height + 'px, 0);'
|
252
|
-
+ ' }'
|
253
|
-
+ ' .ui.visible.bottom.sidebar ~ .pusher:after {'
|
254
|
-
+ ' -webkit-transform: translate3d(0, -' + height + 'px, 0);'
|
255
|
-
+ ' transform: translate3d(0, -' + height + 'px, 0);'
|
256
|
-
+ ' }'
|
257
268
|
;
|
258
269
|
}
|
259
270
|
|
260
|
-
|
261
|
-
|
271
|
+
style += '</style>';
|
262
272
|
$head.append(style);
|
263
273
|
$style = $('style[title=' + namespace + ']');
|
264
274
|
module.debug('Adding sizing css to head', $style);
|
@@ -287,7 +297,7 @@ $.fn.sidebar = function(parameters) {
|
|
287
297
|
|
288
298
|
setup: {
|
289
299
|
layout: function() {
|
290
|
-
if( $context.children(selector.pusher).
|
300
|
+
if( $context.children(selector.pusher).length === 0 ) {
|
291
301
|
module.debug('Adding wrapper element for sidebar');
|
292
302
|
module.error(error.pusher);
|
293
303
|
$pusher = $('<div class="pusher" />');
|
@@ -299,7 +309,7 @@ $.fn.sidebar = function(parameters) {
|
|
299
309
|
;
|
300
310
|
module.refresh();
|
301
311
|
}
|
302
|
-
if($module.nextAll(selector.pusher).
|
312
|
+
if($module.nextAll(selector.pusher).length === 0 || $module.nextAll(selector.pusher)[0] !== $pusher[0]) {
|
303
313
|
module.debug('Moved sidebar to correct parent element');
|
304
314
|
module.error(error.movedSidebar, element);
|
305
315
|
$module.detach().prependTo($context);
|
@@ -318,7 +328,7 @@ $.fn.sidebar = function(parameters) {
|
|
318
328
|
? module[event]
|
319
329
|
: module.toggle
|
320
330
|
;
|
321
|
-
if($toggle.
|
331
|
+
if($toggle.length > 0) {
|
322
332
|
module.debug('Attaching sidebar events to element', selector, event);
|
323
333
|
$toggle
|
324
334
|
.on('click' + eventNamespace, event)
|
@@ -346,18 +356,19 @@ $.fn.sidebar = function(parameters) {
|
|
346
356
|
settings.transition = 'overlay';
|
347
357
|
}
|
348
358
|
module.refresh();
|
349
|
-
if(module.
|
350
|
-
module.debug('Other sidebars currently
|
359
|
+
if(module.othersActive() && module.get.transition() !== 'overlay') {
|
360
|
+
module.debug('Other sidebars currently visible');
|
361
|
+
settings.transition = 'overlay';
|
351
362
|
if(settings.exclusive) {
|
352
363
|
module.hideOthers();
|
353
364
|
}
|
354
365
|
}
|
355
366
|
animateMethod(function() {
|
356
|
-
|
357
|
-
|
367
|
+
callback.call(element);
|
368
|
+
settings.onShow.call(element);
|
358
369
|
});
|
359
|
-
|
360
|
-
|
370
|
+
settings.onChange.call(element);
|
371
|
+
settings.onVisible.call(element);
|
361
372
|
}
|
362
373
|
else {
|
363
374
|
module.debug('Sidebar is already visible');
|
@@ -378,25 +389,32 @@ $.fn.sidebar = function(parameters) {
|
|
378
389
|
module.debug('Hiding sidebar', callback);
|
379
390
|
module.refreshSidebars();
|
380
391
|
animateMethod(function() {
|
381
|
-
|
382
|
-
|
392
|
+
callback.call(element);
|
393
|
+
settings.onHidden.call(element);
|
383
394
|
});
|
384
|
-
|
385
|
-
|
395
|
+
settings.onChange.call(element);
|
396
|
+
settings.onHide.call(element);
|
386
397
|
}
|
387
398
|
},
|
388
399
|
|
400
|
+
othersAnimating: function() {
|
401
|
+
return ($sidebars.not($module).filter('.' + className.animating).length > 0);
|
402
|
+
},
|
389
403
|
othersVisible: function() {
|
390
|
-
return ($sidebars.not($module).filter('.' + className.visible).
|
404
|
+
return ($sidebars.not($module).filter('.' + className.visible).length > 0);
|
405
|
+
},
|
406
|
+
othersActive: function() {
|
407
|
+
return(module.othersVisible() || module.othersAnimating());
|
391
408
|
},
|
392
409
|
|
393
410
|
hideOthers: function(callback) {
|
394
411
|
var
|
395
412
|
$otherSidebars = $sidebars.not($module).filter('.' + className.visible),
|
396
|
-
|
397
|
-
sidebarCount = $otherSidebars.size(),
|
413
|
+
sidebarCount = $otherSidebars.length,
|
398
414
|
callbackCount = 0
|
399
415
|
;
|
416
|
+
callback = callback || function(){};
|
417
|
+
|
400
418
|
$otherSidebars
|
401
419
|
.sidebar('hide', function() {
|
402
420
|
callbackCount++;
|
@@ -422,7 +440,7 @@ $.fn.sidebar = function(parameters) {
|
|
422
440
|
transition = module.get.transition(),
|
423
441
|
$transition = (transition == 'safe')
|
424
442
|
? $context
|
425
|
-
: (transition
|
443
|
+
: (transition === 'overlay' || module.othersActive())
|
426
444
|
? $module
|
427
445
|
: $pusher,
|
428
446
|
animate,
|
@@ -453,7 +471,7 @@ $.fn.sidebar = function(parameters) {
|
|
453
471
|
$transition.off(transitionEvent + elementNamespace, transitionEnd);
|
454
472
|
module.remove.animating();
|
455
473
|
module.bind.scrollLock();
|
456
|
-
|
474
|
+
callback.call(element);
|
457
475
|
}
|
458
476
|
};
|
459
477
|
$transition.off(transitionEvent + elementNamespace);
|
@@ -466,7 +484,7 @@ $.fn.sidebar = function(parameters) {
|
|
466
484
|
transition = module.get.transition(),
|
467
485
|
$transition = (transition == 'safe')
|
468
486
|
? $context
|
469
|
-
: (transition == 'overlay' || module.
|
487
|
+
: (transition == 'overlay' || module.othersActive())
|
470
488
|
? $module
|
471
489
|
: $pusher,
|
472
490
|
animate,
|
@@ -478,6 +496,7 @@ $.fn.sidebar = function(parameters) {
|
|
478
496
|
;
|
479
497
|
module.verbose('Removing context push state', module.get.direction());
|
480
498
|
|
499
|
+
module.set.transition();
|
481
500
|
module.unbind.clickaway();
|
482
501
|
module.unbind.scrollLock();
|
483
502
|
|
@@ -497,7 +516,7 @@ $.fn.sidebar = function(parameters) {
|
|
497
516
|
if(transition == 'scale down' || (settings.returnScroll && module.is.mobile()) ) {
|
498
517
|
module.scrollBack();
|
499
518
|
}
|
500
|
-
|
519
|
+
callback.call(element);
|
501
520
|
}
|
502
521
|
};
|
503
522
|
$transition.off(transitionEvent + elementNamespace);
|
@@ -529,7 +548,7 @@ $.fn.sidebar = function(parameters) {
|
|
529
548
|
.animate(properties, settings.duration, settings.easing, function() {
|
530
549
|
module.remove.animating();
|
531
550
|
module.bind.clickaway();
|
532
|
-
|
551
|
+
callback.call(element);
|
533
552
|
})
|
534
553
|
;
|
535
554
|
},
|
@@ -549,14 +568,14 @@ $.fn.sidebar = function(parameters) {
|
|
549
568
|
module.unbind.clickaway();
|
550
569
|
module.set.animating();
|
551
570
|
module.remove.visible();
|
552
|
-
if(settings.dimPage && !module.
|
571
|
+
if(settings.dimPage && !module.othersActive()) {
|
553
572
|
$pusher.removeClass(className.dimmed);
|
554
573
|
}
|
555
574
|
$context
|
556
575
|
.css('position', 'relative')
|
557
576
|
.animate(properties, settings.duration, settings.easing, function() {
|
558
577
|
module.remove.animating();
|
559
|
-
|
578
|
+
callback.call(element);
|
560
579
|
})
|
561
580
|
;
|
562
581
|
},
|
@@ -613,7 +632,7 @@ $.fn.sidebar = function(parameters) {
|
|
613
632
|
|
614
633
|
bodyCSS: function() {
|
615
634
|
module.debug('Removing body css styles', $style);
|
616
|
-
if($style.
|
635
|
+
if($style && $style.length > 0) {
|
617
636
|
$style.remove();
|
618
637
|
}
|
619
638
|
},
|
@@ -777,6 +796,9 @@ $.fn.sidebar = function(parameters) {
|
|
777
796
|
},
|
778
797
|
animating: function() {
|
779
798
|
return $context.hasClass(className.animating);
|
799
|
+
},
|
800
|
+
rtl: function () {
|
801
|
+
return $module.css('direction') == 'rtl';
|
780
802
|
}
|
781
803
|
},
|
782
804
|
|
@@ -990,6 +1012,7 @@ $.fn.sidebar.settings = {
|
|
990
1012
|
dimPage : true,
|
991
1013
|
scrollLock : false,
|
992
1014
|
returnScroll : false,
|
1015
|
+
delaySetup : false,
|
993
1016
|
|
994
1017
|
useLegacy : 'auto',
|
995
1018
|
duration : 500,
|
@@ -68,7 +68,7 @@ $.fn.sticky = function(parameters) {
|
|
68
68
|
else {
|
69
69
|
$context = $container;
|
70
70
|
}
|
71
|
-
if($context.
|
71
|
+
if($context.length === 0) {
|
72
72
|
module.error(error.invalidContext, settings.context, $module);
|
73
73
|
return;
|
74
74
|
}
|
@@ -155,7 +155,7 @@ $.fn.sticky = function(parameters) {
|
|
155
155
|
scroll: function() {
|
156
156
|
requestAnimationFrame(function() {
|
157
157
|
module.stick();
|
158
|
-
|
158
|
+
settings.onScroll.call(element);
|
159
159
|
});
|
160
160
|
}
|
161
161
|
},
|
@@ -167,7 +167,7 @@ $.fn.sticky = function(parameters) {
|
|
167
167
|
}
|
168
168
|
module.save.positions();
|
169
169
|
module.stick();
|
170
|
-
|
170
|
+
settings.onReposition.call(element);
|
171
171
|
},
|
172
172
|
|
173
173
|
supports: {
|
@@ -226,7 +226,7 @@ $.fn.sticky = function(parameters) {
|
|
226
226
|
}
|
227
227
|
};
|
228
228
|
module.set.containerSize();
|
229
|
-
module.set.
|
229
|
+
module.set.length;
|
230
230
|
module.stick();
|
231
231
|
module.debug('Caching element positions', module.cache);
|
232
232
|
}
|
@@ -458,8 +458,8 @@ $.fn.sticky = function(parameters) {
|
|
458
458
|
.addClass(className.bound)
|
459
459
|
.addClass(className.top)
|
460
460
|
;
|
461
|
-
|
462
|
-
|
461
|
+
settings.onTop.call(element);
|
462
|
+
settings.onUnstick.call(element);
|
463
463
|
},
|
464
464
|
bindBottom: function() {
|
465
465
|
module.debug('Binding element to bottom of parent container');
|
@@ -473,8 +473,8 @@ $.fn.sticky = function(parameters) {
|
|
473
473
|
.addClass(className.bound)
|
474
474
|
.addClass(className.bottom)
|
475
475
|
;
|
476
|
-
|
477
|
-
|
476
|
+
settings.onBottom.call(element);
|
477
|
+
settings.onUnstick.call(element);
|
478
478
|
},
|
479
479
|
|
480
480
|
setInitialPosition: function() {
|
@@ -493,7 +493,7 @@ $.fn.sticky = function(parameters) {
|
|
493
493
|
.addClass(className.fixed)
|
494
494
|
.addClass(className.top)
|
495
495
|
;
|
496
|
-
|
496
|
+
settings.onStick.call(element);
|
497
497
|
},
|
498
498
|
|
499
499
|
fixBottom: function() {
|
@@ -506,7 +506,7 @@ $.fn.sticky = function(parameters) {
|
|
506
506
|
.addClass(className.fixed)
|
507
507
|
.addClass(className.bottom)
|
508
508
|
;
|
509
|
-
|
509
|
+
settings.onStick.call(element);
|
510
510
|
},
|
511
511
|
|
512
512
|
unbind: function() {
|
@@ -527,7 +527,7 @@ $.fn.sticky = function(parameters) {
|
|
527
527
|
.removeClass(className.top)
|
528
528
|
.removeClass(className.bottom)
|
529
529
|
;
|
530
|
-
|
530
|
+
settings.onUnstick.call(element);
|
531
531
|
},
|
532
532
|
|
533
533
|
reset: function() {
|