uikit-sass-rails 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +15 -12
- data/lib/uikit/sass/rails/engine.rb +1 -1
- data/lib/uikit/sass/rails/version.rb +1 -1
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.otf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.svg +525 -464
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/javascripts/uikit.js +30 -3
- data/vendor/assets/javascripts/uikit/components/accordion.js +172 -0
- data/vendor/assets/javascripts/uikit/components/autocomplete.js +48 -27
- data/vendor/assets/javascripts/uikit/components/datepicker.js +2887 -97
- data/vendor/assets/javascripts/uikit/components/form-password.js +24 -19
- data/vendor/assets/javascripts/uikit/components/form-select.js +24 -18
- data/vendor/assets/javascripts/uikit/components/grid.js +524 -0
- data/vendor/assets/javascripts/uikit/components/htmleditor.js +46 -39
- data/vendor/assets/javascripts/uikit/components/lightbox.js +543 -0
- data/vendor/assets/javascripts/uikit/components/nestable.js +125 -98
- data/vendor/assets/javascripts/uikit/components/notify.js +34 -22
- data/vendor/assets/javascripts/uikit/components/pagination.js +24 -21
- data/vendor/assets/javascripts/uikit/components/parallax.js +400 -0
- data/vendor/assets/javascripts/uikit/components/search.js +19 -16
- data/vendor/assets/javascripts/uikit/components/slider.js +482 -0
- data/vendor/assets/javascripts/uikit/components/slideset.js +498 -0
- data/vendor/assets/javascripts/uikit/components/slideshow-fx.js +377 -0
- data/vendor/assets/javascripts/uikit/components/slideshow.js +540 -0
- data/vendor/assets/javascripts/uikit/components/sortable.js +392 -263
- data/vendor/assets/javascripts/uikit/components/sticky.js +127 -68
- data/vendor/assets/javascripts/uikit/components/timepicker.js +65 -42
- data/vendor/assets/javascripts/uikit/components/tooltip.js +220 -0
- data/vendor/assets/javascripts/uikit/components/upload.js +11 -10
- data/vendor/assets/javascripts/uikit/core/alert.js +66 -0
- data/vendor/assets/javascripts/uikit/core/button.js +154 -0
- data/vendor/assets/javascripts/uikit/core/core.js +717 -0
- data/vendor/assets/javascripts/uikit/{components → core}/cover.js +41 -35
- data/vendor/assets/javascripts/uikit/core/dropdown.js +296 -0
- data/vendor/assets/javascripts/uikit/core/grid.js +172 -0
- data/vendor/assets/javascripts/uikit/core/modal.js +323 -0
- data/vendor/assets/javascripts/uikit/core/nav.js +117 -0
- data/vendor/assets/javascripts/uikit/core/offcanvas.js +178 -0
- data/vendor/assets/javascripts/uikit/core/scrollspy.js +208 -0
- data/vendor/assets/javascripts/uikit/core/smooth-scroll.js +62 -0
- data/vendor/assets/javascripts/uikit/core/switcher.js +298 -0
- data/vendor/assets/javascripts/uikit/core/tab.js +159 -0
- data/vendor/assets/javascripts/uikit/core/toggle.js +117 -0
- data/vendor/assets/javascripts/uikit/core/touch.js +173 -0
- data/vendor/assets/javascripts/uikit/core/utility.js +157 -0
- data/vendor/assets/javascripts/uikit/uikit.js +1538 -871
- data/vendor/assets/stylesheets/extra/font-awesome.scss +4 -7
- data/vendor/assets/stylesheets/uikit.scss +22 -1
- data/vendor/assets/stylesheets/uikit/almost-flat.scss +22 -2
- data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.scss +45 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.gradient.scss +45 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.scss +43 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.scss +62 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.scss +62 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.scss +60 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.scss +148 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.scss +158 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.scss +142 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.scss +152 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.scss +152 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.scss +148 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.scss +92 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.scss +92 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.scss +92 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.gradient.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.gradient.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.gradient.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.scss +282 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.scss +290 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.scss +208 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.scss +137 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.gradient.scss +141 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.scss +134 -0
- data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.scss +112 -0
- data/vendor/assets/stylesheets/uikit/components/notify.gradient.scss +112 -0
- data/vendor/assets/stylesheets/uikit/components/notify.scss +106 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.scss +130 -0
- data/vendor/assets/stylesheets/uikit/components/progress.gradient.scss +138 -0
- data/vendor/assets/stylesheets/uikit/components/progress.scss +118 -0
- data/vendor/assets/stylesheets/uikit/components/search.almost-flat.scss +216 -0
- data/vendor/assets/stylesheets/uikit/components/search.gradient.scss +216 -0
- data/vendor/assets/stylesheets/uikit/components/search.scss +214 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.scss +110 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.scss +110 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.scss +110 -0
- data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.scss +105 -0
- data/vendor/assets/stylesheets/uikit/components/slider.gradient.scss +105 -0
- data/vendor/assets/stylesheets/uikit/components/slider.scss +105 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.scss +166 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.scss +166 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.scss +166 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.scss +90 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.gradient.scss +90 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.scss +90 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.scss +39 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.gradient.scss +39 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.scss +39 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.scss +129 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.scss +129 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.scss +127 -0
- data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.scss +11 -0
- data/vendor/assets/stylesheets/uikit/components/upload.gradient.scss +11 -0
- data/vendor/assets/stylesheets/uikit/components/upload.scss +11 -0
- data/vendor/assets/stylesheets/uikit/gradient.scss +22 -2
- data/vendor/assets/stylesheets/uikit/uikit.almost-flat.scss +1768 -498
- data/vendor/assets/stylesheets/uikit/uikit.gradient.scss +1776 -512
- data/vendor/assets/stylesheets/uikit/uikit.scss +1722 -462
- metadata +92 -7
- data/vendor/assets/stylesheets/uikit/components/uikit.components.almost-flat.scss +0 -1586
- data/vendor/assets/stylesheets/uikit/components/uikit.components.gradient.scss +0 -1608
- data/vendor/assets/stylesheets/uikit/components/uikit.components.scss +0 -1489
@@ -0,0 +1,498 @@
|
|
1
|
+
/*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
(function(addon) {
|
3
|
+
|
4
|
+
var component;
|
5
|
+
|
6
|
+
if (window.UIkit) {
|
7
|
+
component = addon(UIkit);
|
8
|
+
}
|
9
|
+
|
10
|
+
if (typeof define == "function" && define.amd) {
|
11
|
+
define("uikit-slideset", ["uikit"], function(){
|
12
|
+
return component || addon(UIkit);
|
13
|
+
});
|
14
|
+
}
|
15
|
+
|
16
|
+
})(function(UI){
|
17
|
+
|
18
|
+
"use strict";
|
19
|
+
|
20
|
+
var Animations;
|
21
|
+
|
22
|
+
UI.component('slideset', {
|
23
|
+
|
24
|
+
defaults: {
|
25
|
+
default : 1,
|
26
|
+
animation : 'fade',
|
27
|
+
duration : 200,
|
28
|
+
filter : '',
|
29
|
+
delay : false,
|
30
|
+
controls : false,
|
31
|
+
autoplay : false,
|
32
|
+
autoplayInterval : 7000,
|
33
|
+
pauseOnHover : true
|
34
|
+
},
|
35
|
+
|
36
|
+
sets: [],
|
37
|
+
|
38
|
+
boot: function() {
|
39
|
+
|
40
|
+
// auto init
|
41
|
+
UI.ready(function(context) {
|
42
|
+
|
43
|
+
UI.$("[data-uk-slideset]", context).each(function(){
|
44
|
+
|
45
|
+
var ele = UI.$(this);
|
46
|
+
|
47
|
+
if(!ele.data("slideset")) {
|
48
|
+
var plugin = UI.slideset(ele, UI.Utils.options(ele.attr("data-uk-slideset")));
|
49
|
+
}
|
50
|
+
});
|
51
|
+
});
|
52
|
+
},
|
53
|
+
|
54
|
+
init: function() {
|
55
|
+
|
56
|
+
var $this = this;
|
57
|
+
|
58
|
+
this.activeSet = false;
|
59
|
+
this.list = this.element.find('.uk-slideset');
|
60
|
+
this.nav = this.element.find('.uk-slideset-nav');
|
61
|
+
|
62
|
+
UI.$win.on("resize load", UI.Utils.debounce(function() {
|
63
|
+
$this.updateSets();
|
64
|
+
}, 100));
|
65
|
+
|
66
|
+
$this.list.addClass('uk-grid-width-1-'+$this.options.default);
|
67
|
+
|
68
|
+
['xlarge', 'large', 'medium', 'small'].forEach(function(bp) {
|
69
|
+
|
70
|
+
if (!$this.options[bp]) {
|
71
|
+
return;
|
72
|
+
}
|
73
|
+
|
74
|
+
$this.list.addClass('uk-grid-width-'+bp+'-1-'+$this.options[bp]);
|
75
|
+
});
|
76
|
+
|
77
|
+
this.on("click.uikit.slideset", '[data-uk-slideset-item]', function(e) {
|
78
|
+
|
79
|
+
e.preventDefault();
|
80
|
+
|
81
|
+
if ($this.animating) {
|
82
|
+
return;
|
83
|
+
}
|
84
|
+
|
85
|
+
var set = UI.$(this).attr('data-uk-slideset-item');
|
86
|
+
|
87
|
+
if ($this.activeSet === set) return;
|
88
|
+
|
89
|
+
switch(set) {
|
90
|
+
case 'next':
|
91
|
+
case 'previous':
|
92
|
+
$this[set=='next' ? 'next':'previous']();
|
93
|
+
break;
|
94
|
+
default:
|
95
|
+
$this.show(set);
|
96
|
+
}
|
97
|
+
|
98
|
+
});
|
99
|
+
|
100
|
+
this.currentFilter = this.options.filter;
|
101
|
+
this.controls = this.options.controls ? UI.$(this.options.controls) : this.element;
|
102
|
+
|
103
|
+
this.controls.on('click.uikit.slideset', '[data-uk-filter]', function(e) {
|
104
|
+
|
105
|
+
var ele = UI.$(this);
|
106
|
+
|
107
|
+
if (ele.parent().hasClass('uk-slideset')) {
|
108
|
+
return;
|
109
|
+
}
|
110
|
+
|
111
|
+
e.preventDefault();
|
112
|
+
|
113
|
+
if ($this.animating || $this.currentFilter == ele.attr('data-uk-filter')) {
|
114
|
+
return;
|
115
|
+
}
|
116
|
+
|
117
|
+
$this._hide().then(function(){
|
118
|
+
$this.currentFilter = ele.attr('data-uk-filter');
|
119
|
+
$this.updateSets(true, true);
|
120
|
+
});
|
121
|
+
});
|
122
|
+
|
123
|
+
|
124
|
+
this.on('swipeRight swipeLeft', function(e) {
|
125
|
+
$this[e.type=='swipeLeft' ? 'next' : 'previous']();
|
126
|
+
});
|
127
|
+
|
128
|
+
this.updateSets();
|
129
|
+
|
130
|
+
this.element.on({
|
131
|
+
mouseenter: function() { if ($this.options.pauseOnHover) $this.hovering = true; },
|
132
|
+
mouseleave: function() { $this.hovering = false; }
|
133
|
+
});
|
134
|
+
|
135
|
+
// Set autoplay
|
136
|
+
if (this.options.autoplay) {
|
137
|
+
this.start();
|
138
|
+
}
|
139
|
+
},
|
140
|
+
|
141
|
+
updateSets: function(animate, force) {
|
142
|
+
|
143
|
+
var $this = this, visible = this.visible, i;
|
144
|
+
|
145
|
+
this.visible = this.getVisibleOnCurrenBreakpoint();
|
146
|
+
|
147
|
+
if (visible == this.visible && !force) {
|
148
|
+
return;
|
149
|
+
}
|
150
|
+
|
151
|
+
this.children = this.list.children().hide();
|
152
|
+
this.items = this.getItems();
|
153
|
+
this.sets = array_chunk(this.items, this.visible);
|
154
|
+
|
155
|
+
for (i=0;i<this.sets.length;i++) {
|
156
|
+
this.sets[i].css({'display': 'none'});
|
157
|
+
}
|
158
|
+
|
159
|
+
// update nav
|
160
|
+
if (this.nav.length && this.nav.empty()) {
|
161
|
+
|
162
|
+
for (i=0;i<this.sets.length;i++) {
|
163
|
+
this.nav.append('<li data-uk-slideset-item="'+i+'"><a></a></li>');
|
164
|
+
}
|
165
|
+
|
166
|
+
this.nav[this.nav.children().length==1 ? 'addClass':'removeClass']('uk-invisible');
|
167
|
+
}
|
168
|
+
|
169
|
+
var filter;
|
170
|
+
|
171
|
+
this.controls.find('[data-uk-filter]').each(function(){
|
172
|
+
|
173
|
+
filter = UI.$(this);
|
174
|
+
|
175
|
+
if (!filter.parent().hasClass('uk-slideset')) {
|
176
|
+
|
177
|
+
if (filter.attr('data-uk-filter') == $this.currentFilter) {
|
178
|
+
filter.addClass('uk-active');
|
179
|
+
} else {
|
180
|
+
filter.removeClass('uk-active');
|
181
|
+
}
|
182
|
+
}
|
183
|
+
});
|
184
|
+
|
185
|
+
this.activeSet = false;
|
186
|
+
this.show(0, !animate);
|
187
|
+
},
|
188
|
+
|
189
|
+
getVisibleOnCurrenBreakpoint: function() {
|
190
|
+
|
191
|
+
var breakpoint = null,
|
192
|
+
tmp = UI.$('<div style="position:absolute;height:1px;top:-1000px;width:100px"><div></div></div>').appendTo('body'),
|
193
|
+
testdiv = tmp.children().eq(0),
|
194
|
+
breakpoints = this.options;
|
195
|
+
|
196
|
+
['xlarge', 'large', 'medium', 'small'].forEach(function(bp) {
|
197
|
+
|
198
|
+
if (!breakpoints[bp] || breakpoint) {
|
199
|
+
return;
|
200
|
+
}
|
201
|
+
|
202
|
+
tmp.attr('class', 'uk-grid-width-'+bp+'-1-2').width();
|
203
|
+
|
204
|
+
if (testdiv.width() == 50) {
|
205
|
+
breakpoint = bp;
|
206
|
+
}
|
207
|
+
});
|
208
|
+
|
209
|
+
tmp.remove();
|
210
|
+
|
211
|
+
return this.options[breakpoint] || this.options['default'];
|
212
|
+
},
|
213
|
+
|
214
|
+
getItems: function() {
|
215
|
+
|
216
|
+
var items = [], filter;
|
217
|
+
|
218
|
+
if (this.currentFilter) {
|
219
|
+
|
220
|
+
filter = this.currentFilter || [];
|
221
|
+
|
222
|
+
if (typeof(filter) === 'string') {
|
223
|
+
filter = filter.split(/,/).map(function(item){ return item.trim(); });
|
224
|
+
}
|
225
|
+
|
226
|
+
this.children.each(function(index){
|
227
|
+
|
228
|
+
var ele = UI.$(this), f = ele.attr('data-uk-filter'), infilter = filter.length ? false : true;
|
229
|
+
|
230
|
+
if (f) {
|
231
|
+
|
232
|
+
f = f.split(/,/).map(function(item){ return item.trim(); });
|
233
|
+
|
234
|
+
filter.forEach(function(item){
|
235
|
+
if (f.indexOf(item) > -1) infilter = true;
|
236
|
+
});
|
237
|
+
}
|
238
|
+
|
239
|
+
if(infilter) items.push(ele[0]);
|
240
|
+
});
|
241
|
+
|
242
|
+
items = UI.$(items);
|
243
|
+
|
244
|
+
} else {
|
245
|
+
items = this.list.children();
|
246
|
+
}
|
247
|
+
|
248
|
+
return items;
|
249
|
+
},
|
250
|
+
|
251
|
+
show: function(setIndex, noanimate, dir) {
|
252
|
+
|
253
|
+
var $this = this;
|
254
|
+
|
255
|
+
if (this.activeSet === setIndex || this.animating) {
|
256
|
+
return;
|
257
|
+
}
|
258
|
+
|
259
|
+
dir = dir || (setIndex < this.activeSet ? -1:1);
|
260
|
+
|
261
|
+
var current = this.sets[this.activeSet] || [],
|
262
|
+
next = this.sets[setIndex],
|
263
|
+
animation = this._getAnimation();
|
264
|
+
|
265
|
+
if (noanimate || !UI.support.animation) {
|
266
|
+
animation = Animations.none;
|
267
|
+
}
|
268
|
+
|
269
|
+
this.animating = true;
|
270
|
+
|
271
|
+
if (this.nav.length) {
|
272
|
+
this.nav.children().removeClass('uk-active').eq(setIndex).addClass('uk-active');
|
273
|
+
}
|
274
|
+
|
275
|
+
animation.apply($this, [current, next, dir]).then(function(){
|
276
|
+
|
277
|
+
UI.Utils.checkDisplay(next, true);
|
278
|
+
|
279
|
+
$this.children.hide().removeClass('uk-active');
|
280
|
+
next.addClass('uk-active').css({'display': '', 'opacity':''});
|
281
|
+
|
282
|
+
$this.animating = false;
|
283
|
+
$this.activeSet = setIndex;
|
284
|
+
|
285
|
+
UI.Utils.checkDisplay(next, true);
|
286
|
+
|
287
|
+
$this.trigger('show.uk.slideset', [next]);
|
288
|
+
});
|
289
|
+
|
290
|
+
},
|
291
|
+
|
292
|
+
_getAnimation: function() {
|
293
|
+
|
294
|
+
var $this = this,
|
295
|
+
animation = Animations[this.options.animation] || Animations.none;
|
296
|
+
|
297
|
+
if (!UI.support.animation) {
|
298
|
+
animation = Animations.none;
|
299
|
+
}
|
300
|
+
|
301
|
+
return animation;
|
302
|
+
},
|
303
|
+
|
304
|
+
_hide: function() {
|
305
|
+
|
306
|
+
var $this = this,
|
307
|
+
current = this.sets[this.activeSet] || [],
|
308
|
+
animation = this._getAnimation();
|
309
|
+
|
310
|
+
this.animating = true;
|
311
|
+
|
312
|
+
return animation.apply($this, [current, [], 1]).then(function(){
|
313
|
+
$this.animating = false;
|
314
|
+
});
|
315
|
+
},
|
316
|
+
|
317
|
+
next: function() {
|
318
|
+
this.show(this.sets[this.activeSet + 1] ? (this.activeSet + 1) : 0, false, 1);
|
319
|
+
},
|
320
|
+
|
321
|
+
previous: function() {
|
322
|
+
this.show(this.sets[this.activeSet - 1] ? (this.activeSet - 1) : (this.sets.length - 1), false, -1);
|
323
|
+
},
|
324
|
+
|
325
|
+
start: function() {
|
326
|
+
|
327
|
+
this.stop();
|
328
|
+
|
329
|
+
var $this = this;
|
330
|
+
|
331
|
+
this.interval = setInterval(function() {
|
332
|
+
if (!$this.hovering && !$this.animating) $this.next();
|
333
|
+
}, this.options.autoplayInterval);
|
334
|
+
|
335
|
+
},
|
336
|
+
|
337
|
+
stop: function() {
|
338
|
+
if (this.interval) clearInterval(this.interval);
|
339
|
+
}
|
340
|
+
});
|
341
|
+
|
342
|
+
Animations = {
|
343
|
+
|
344
|
+
'none': function() {
|
345
|
+
var d = UI.$.Deferred();
|
346
|
+
d.resolve();
|
347
|
+
return d.promise();
|
348
|
+
},
|
349
|
+
|
350
|
+
'fade': function(current, next) {
|
351
|
+
return coreAnimation.apply(this, ['uk-animation-fade', current, next]);
|
352
|
+
},
|
353
|
+
|
354
|
+
'slide-bottom': function(current, next) {
|
355
|
+
return coreAnimation.apply(this, ['uk-animation-slide-bottom', current, next]);
|
356
|
+
},
|
357
|
+
|
358
|
+
'slide-top': function(current, next) {
|
359
|
+
return coreAnimation.apply(this, ['uk-animation-slide-top', current, next]);
|
360
|
+
},
|
361
|
+
|
362
|
+
'slide-vertical': function(current, next, dir) {
|
363
|
+
|
364
|
+
var anim = ['uk-animation-slide-top', 'uk-animation-slide-bottom'];
|
365
|
+
|
366
|
+
if (dir == -1) {
|
367
|
+
anim.reverse();
|
368
|
+
}
|
369
|
+
|
370
|
+
return coreAnimation.apply(this, [anim, current, next]);
|
371
|
+
},
|
372
|
+
|
373
|
+
'slide-horizontal': function(current, next, dir) {
|
374
|
+
|
375
|
+
var anim = ['uk-animation-slide-right', 'uk-animation-slide-left'];
|
376
|
+
|
377
|
+
if (dir == -1) {
|
378
|
+
anim.reverse();
|
379
|
+
}
|
380
|
+
|
381
|
+
return coreAnimation.apply(this, [anim, current, next, dir]);
|
382
|
+
},
|
383
|
+
|
384
|
+
'scale': function(current, next) {
|
385
|
+
return coreAnimation.apply(this, ['uk-animation-scale-up', current, next]);
|
386
|
+
}
|
387
|
+
};
|
388
|
+
|
389
|
+
UI.slideset.animations = Animations;
|
390
|
+
|
391
|
+
// helpers
|
392
|
+
|
393
|
+
function coreAnimation(cls, current, next, dir) {
|
394
|
+
|
395
|
+
var d = UI.$.Deferred(),
|
396
|
+
delay = (this.options.delay === false) ? Math.floor(this.options.duration/2) : this.options.delay,
|
397
|
+
$this = this, clsIn, clsOut, release, i;
|
398
|
+
|
399
|
+
dir = dir || 1;
|
400
|
+
|
401
|
+
this.element.css('min-height', this.element.height());
|
402
|
+
|
403
|
+
if (next[0]===current[0]) {
|
404
|
+
d.resolve();
|
405
|
+
return d.promise();
|
406
|
+
}
|
407
|
+
|
408
|
+
if (typeof(cls) == 'object') {
|
409
|
+
clsIn = cls[0];
|
410
|
+
clsOut = cls[1] || cls[0];
|
411
|
+
} else {
|
412
|
+
clsIn = cls;
|
413
|
+
clsOut = clsIn;
|
414
|
+
}
|
415
|
+
|
416
|
+
release = function() {
|
417
|
+
|
418
|
+
if (current && current.length) {
|
419
|
+
current.hide().removeClass(clsOut+' uk-animation-reverse').css({'opacity':'', 'animation-delay': '', 'animation':''});
|
420
|
+
}
|
421
|
+
|
422
|
+
if (!next.length) {
|
423
|
+
d.resolve();
|
424
|
+
return;
|
425
|
+
}
|
426
|
+
|
427
|
+
for (i=0;i<next.length;i++) {
|
428
|
+
next.eq(dir == 1 ? i:(next.length - i)-1).css('animation-delay', (i*delay)+'ms');
|
429
|
+
}
|
430
|
+
|
431
|
+
next.addClass(clsIn)[dir==1 ? 'last':'first']().one(UI.support.animation.end, function() {
|
432
|
+
|
433
|
+
next.removeClass(''+clsIn+'').css({opacity:'', display:'', 'animation-delay':'', 'animation':''});
|
434
|
+
d.resolve();
|
435
|
+
$this.element.css('min-height', '');
|
436
|
+
|
437
|
+
}).end().css('display', '');
|
438
|
+
};
|
439
|
+
|
440
|
+
if (next.length) {
|
441
|
+
next.css('animation-duration', this.options.duration+'ms');
|
442
|
+
}
|
443
|
+
|
444
|
+
if (current && current.length) {
|
445
|
+
|
446
|
+
current.css('animation-duration', this.options.duration+'ms')[dir==1 ? 'last':'first']().one(UI.support.animation.end, function() {
|
447
|
+
release();
|
448
|
+
});
|
449
|
+
|
450
|
+
for (i=0;i<current.length;i++) {
|
451
|
+
|
452
|
+
(function (index, ele){
|
453
|
+
|
454
|
+
setTimeout(function(){
|
455
|
+
ele.css('display', 'none').css('display', '').css('opacity', 0).addClass(clsOut+' uk-animation-reverse');
|
456
|
+
}.bind(this), i * delay);
|
457
|
+
|
458
|
+
})(i, current.eq(dir == 1 ? i:(current.length - i)-1));
|
459
|
+
}
|
460
|
+
|
461
|
+
} else {
|
462
|
+
release();
|
463
|
+
}
|
464
|
+
|
465
|
+
return d.promise();
|
466
|
+
}
|
467
|
+
|
468
|
+
function array_chunk(input, size) {
|
469
|
+
|
470
|
+
var x, i = 0, c = -1, l = input.length || 0, n = [];
|
471
|
+
|
472
|
+
if (size < 1) return null;
|
473
|
+
|
474
|
+
while (i < l) {
|
475
|
+
|
476
|
+
x = i % size;
|
477
|
+
|
478
|
+
if(x) {
|
479
|
+
n[c][x] = input[i];
|
480
|
+
} else {
|
481
|
+
n[++c] = [input[i]];
|
482
|
+
}
|
483
|
+
|
484
|
+
i++;
|
485
|
+
}
|
486
|
+
|
487
|
+
i = 0;
|
488
|
+
l = n.length;
|
489
|
+
|
490
|
+
while (i < l) {
|
491
|
+
n[i] = jQuery(n[i]);
|
492
|
+
i++;
|
493
|
+
}
|
494
|
+
|
495
|
+
return n;
|
496
|
+
}
|
497
|
+
|
498
|
+
});
|