uikit-sass-rails 1.0.0 → 1.1.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 +1 -1
- data/lib/uikit/sass/rails/version.rb +1 -1
- data/uikit-sass-rails.gemspec +2 -2
- data/vendor/assets/javascripts/uikit.js +1 -0
- data/vendor/assets/javascripts/uikit/addons/autocomplete.js +5 -6
- data/vendor/assets/javascripts/uikit/addons/cover.js +90 -0
- data/vendor/assets/javascripts/uikit/addons/datepicker.js +19 -5
- data/vendor/assets/javascripts/uikit/addons/form-password.js +2 -2
- data/vendor/assets/javascripts/uikit/addons/form-select.js +3 -3
- data/vendor/assets/javascripts/uikit/addons/htmleditor.js +35 -14
- data/vendor/assets/javascripts/uikit/addons/nestable.js +9 -8
- data/vendor/assets/javascripts/uikit/addons/notify.js +5 -2
- data/vendor/assets/javascripts/uikit/addons/pagination.js +3 -3
- data/vendor/assets/javascripts/uikit/addons/search.js +2 -2
- data/vendor/assets/javascripts/uikit/addons/sortable.js +48 -28
- data/vendor/assets/javascripts/uikit/addons/sticky.js +148 -37
- data/vendor/assets/javascripts/uikit/addons/timepicker.js +11 -9
- data/vendor/assets/javascripts/uikit/addons/upload.js +20 -6
- data/vendor/assets/javascripts/uikit/uikit.js +309 -288
- data/vendor/assets/stylesheets/uikit/addons/uikit.addons.scss +175 -62
- data/vendor/assets/stylesheets/uikit/addons/uikit.almost-flat.addons.scss +175 -62
- data/vendor/assets/stylesheets/uikit/addons/uikit.gradient.addons.scss +175 -62
- data/vendor/assets/stylesheets/uikit/uikit.almost-flat.scss +389 -132
- data/vendor/assets/stylesheets/uikit/uikit.gradient.scss +389 -132
- data/vendor/assets/stylesheets/uikit/uikit.scss +389 -132
- metadata +6 -5
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! UIkit 2.
|
1
|
+
/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
2
|
|
3
3
|
(function(addon) {
|
4
4
|
|
@@ -47,6 +47,7 @@
|
|
47
47
|
e.preventDefault();
|
48
48
|
|
49
49
|
$this.element.removeClass($this.options.dragoverClass);
|
50
|
+
$this.element.trigger('uk.dropped', [e.dataTransfer.files]);
|
50
51
|
|
51
52
|
xhrupload(e.dataTransfer.files, $this.options);
|
52
53
|
}
|
@@ -126,12 +127,22 @@
|
|
126
127
|
if (settings.single){
|
127
128
|
|
128
129
|
var count = files.length,
|
129
|
-
uploaded = 0
|
130
|
+
uploaded = 0,
|
131
|
+
allow = true;
|
132
|
+
|
133
|
+
settings.beforeAll(files);
|
130
134
|
|
131
135
|
settings.complete = function(response, xhr){
|
132
|
-
|
136
|
+
|
137
|
+
uploaded = uploaded + 1;
|
138
|
+
|
133
139
|
complete(response, xhr);
|
134
|
-
|
140
|
+
|
141
|
+
if (settings.filelimit && uploaded >= settings.filelimit){
|
142
|
+
allow = false;
|
143
|
+
}
|
144
|
+
|
145
|
+
if (allow && uploaded<count){
|
135
146
|
upload([files[uploaded]], settings);
|
136
147
|
} else {
|
137
148
|
settings.allcomplete(response, xhr);
|
@@ -193,7 +204,7 @@
|
|
193
204
|
settings.complete(response, xhr);
|
194
205
|
}
|
195
206
|
};
|
196
|
-
|
207
|
+
settings.beforeSend(xhr);
|
197
208
|
xhr.send(formData);
|
198
209
|
}
|
199
210
|
}
|
@@ -206,9 +217,12 @@
|
|
206
217
|
'params': {},
|
207
218
|
'allow' : '*.*',
|
208
219
|
'type' : 'text',
|
220
|
+
'filelimit': false,
|
209
221
|
|
210
222
|
// events
|
211
223
|
'before' : function(o){},
|
224
|
+
'beforeSend' : function(xhr){},
|
225
|
+
'beforeAll' : function(){},
|
212
226
|
'loadstart' : function(){},
|
213
227
|
'load' : function(){},
|
214
228
|
'loadend' : function(){},
|
@@ -236,4 +250,4 @@
|
|
236
250
|
UI.Utils.xhrupload = xhrupload;
|
237
251
|
|
238
252
|
return xhrupload;
|
239
|
-
});
|
253
|
+
});
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! UIkit 2.
|
1
|
+
/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
2
|
|
3
3
|
(function(core) {
|
4
4
|
|
@@ -12,7 +12,7 @@
|
|
12
12
|
var resources = res.split(','), load = [], i, base = (config.config && config.config.uikit && config.config.uikit.base ? config.config.uikit.base : "").replace(/\/+$/g, "");
|
13
13
|
|
14
14
|
if (!base) {
|
15
|
-
throw new Error( "Please define base path to
|
15
|
+
throw new Error( "Please define base path to UIkit in the requirejs config." );
|
16
16
|
}
|
17
17
|
|
18
18
|
for (i = 0; i < resources.length; i += 1) {
|
@@ -48,7 +48,7 @@
|
|
48
48
|
return UI;
|
49
49
|
}
|
50
50
|
|
51
|
-
UI.version = '2.
|
51
|
+
UI.version = '2.9.0';
|
52
52
|
UI.$doc = $doc;
|
53
53
|
UI.$win = $win;
|
54
54
|
|
@@ -118,7 +118,7 @@
|
|
118
118
|
(global.navigator['pointerEnabled'] && global.navigator['maxTouchPoints'] > 0) || //IE >=11
|
119
119
|
false
|
120
120
|
);
|
121
|
-
UI.support.mutationobserver
|
121
|
+
UI.support.mutationobserver = (global.MutationObserver || global.WebKitMutationObserver || null);
|
122
122
|
|
123
123
|
UI.Utils = {};
|
124
124
|
|
@@ -182,6 +182,10 @@
|
|
182
182
|
}
|
183
183
|
};
|
184
184
|
|
185
|
+
UI.Utils.checkDisplay = function(context) {
|
186
|
+
$('[data-uk-margin], [data-uk-grid-match], [data-uk-grid-margin], [data-uk-check-display]', context || document).trigger('uk-check-display');
|
187
|
+
};
|
188
|
+
|
185
189
|
UI.Utils.options = function(string) {
|
186
190
|
|
187
191
|
if ($.isPlainObject(string)) return string;
|
@@ -267,19 +271,56 @@
|
|
267
271
|
|
268
272
|
$.UIkit.langdirection = $html.attr("dir") == "rtl" ? "right" : "left";
|
269
273
|
|
270
|
-
$(function(){
|
271
274
|
|
272
|
-
|
275
|
+
// DOM mutation save ready helper function
|
276
|
+
|
277
|
+
UI.domObservers = [];
|
278
|
+
|
279
|
+
UI.domObserve = function(selector, fn) {
|
280
|
+
|
281
|
+
if(!UI.support.mutationobserver) return;
|
282
|
+
|
283
|
+
$(selector).each(function() {
|
284
|
+
|
285
|
+
var element = this;
|
286
|
+
|
287
|
+
try {
|
288
|
+
|
289
|
+
var observer = new UI.support.mutationobserver(UI.Utils.debounce(function(mutations) {
|
290
|
+
fn.apply(element, []);
|
291
|
+
$(element).trigger('uk.dom.changed');
|
292
|
+
}, 50));
|
293
|
+
|
294
|
+
// pass in the target node, as well as the observer options
|
295
|
+
observer.observe(element, { childList: true, subtree: true });
|
296
|
+
|
297
|
+
} catch(e) {}
|
298
|
+
});
|
299
|
+
};
|
300
|
+
|
301
|
+
UI.ready = function(fn) {
|
302
|
+
$(function() { fn(document); });
|
303
|
+
UI.domObservers.push(fn);
|
304
|
+
};
|
305
|
+
|
306
|
+
$doc.on('uk.domready', function(){
|
307
|
+
UI.domObservers.forEach(function(fn){
|
308
|
+
fn(document);
|
309
|
+
});
|
310
|
+
$doc.trigger('uk.dom.changed');
|
311
|
+
});
|
312
|
+
|
313
|
+
$(function(){
|
273
314
|
|
274
315
|
// custom scroll observer
|
275
316
|
setInterval((function(){
|
276
317
|
|
277
|
-
var memory = {x: window.
|
318
|
+
var memory = {x: window.pageXOffset, y:window.pageYOffset};
|
278
319
|
|
279
320
|
var fn = function(){
|
280
321
|
|
281
|
-
if (memory.x != window.
|
282
|
-
memory = {x: window.
|
322
|
+
if (memory.x != window.pageXOffset || memory.y != window.pageYOffset) {
|
323
|
+
memory = {x: window.pageXOffset, y:window.pageYOffset};
|
283
324
|
$doc.trigger('uk-scroll', [memory]);
|
284
325
|
}
|
285
326
|
};
|
@@ -294,24 +335,36 @@
|
|
294
335
|
|
295
336
|
})(), 15);
|
296
337
|
|
297
|
-
|
298
338
|
// Check for dom modifications
|
299
|
-
|
300
|
-
|
301
|
-
try{
|
339
|
+
UI.domObserve('[data-uk-observe]', function() {
|
302
340
|
|
303
|
-
var
|
304
|
-
$doc.trigger("uk-domready");
|
305
|
-
}, 150));
|
341
|
+
var ele = this;
|
306
342
|
|
307
|
-
|
308
|
-
|
343
|
+
UI.domObservers.forEach(function(fn){
|
344
|
+
fn(ele);
|
345
|
+
});
|
346
|
+
});
|
309
347
|
|
310
|
-
} catch(e) {}
|
311
348
|
|
312
|
-
// remove css hover rules for touch devices
|
313
349
|
if (UI.support.touch) {
|
314
|
-
|
350
|
+
|
351
|
+
// remove css hover rules for touch devices
|
352
|
+
// UI.Utils.removeCssRules(/\.uk-(?!navbar).*:hover/);
|
353
|
+
|
354
|
+
// viewport unit fix for uk-height-viewport - should be fixed in iOS 8
|
355
|
+
if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) {
|
356
|
+
|
357
|
+
UI.$win.on('load orientationchange resize', UI.Utils.debounce((function(){
|
358
|
+
|
359
|
+
var fn = function() {
|
360
|
+
$('.uk-height-viewport').css('height', window.innerHeight);
|
361
|
+
return fn;
|
362
|
+
};
|
363
|
+
|
364
|
+
return fn();
|
365
|
+
|
366
|
+
})(), 100));
|
367
|
+
}
|
315
368
|
}
|
316
369
|
});
|
317
370
|
|
@@ -340,149 +393,6 @@
|
|
340
393
|
return UI;
|
341
394
|
});
|
342
395
|
|
343
|
-
/**
|
344
|
-
* Promises/A+ spec. polyfill
|
345
|
-
* promiscuous - https://github.com/RubenVerborgh/promiscuous
|
346
|
-
* @license MIT
|
347
|
-
* Ruben Verborgh
|
348
|
-
*/
|
349
|
-
|
350
|
-
(function(global){
|
351
|
-
|
352
|
-
global.Promise = global.Promise || (function (func, obj) {
|
353
|
-
|
354
|
-
// Type checking utility function
|
355
|
-
function is(type, item) { return (typeof item)[0] == type; }
|
356
|
-
|
357
|
-
// Creates a promise, calling callback(resolve, reject), ignoring other parameters.
|
358
|
-
function Promise(callback, handler) {
|
359
|
-
// The `handler` variable points to the function that will
|
360
|
-
// 1) handle a .then(resolved, rejected) call
|
361
|
-
// 2) handle a resolve or reject call (if the first argument === `is`)
|
362
|
-
// Before 2), `handler` holds a queue of callbacks.
|
363
|
-
// After 2), `handler` is a finalized .then handler.
|
364
|
-
handler = function pendingHandler(resolved, rejected, value, queue, then, i) {
|
365
|
-
queue = pendingHandler.q;
|
366
|
-
|
367
|
-
// Case 1) handle a .then(resolved, rejected) call
|
368
|
-
if (resolved != is) {
|
369
|
-
return Promise(function (resolve, reject) {
|
370
|
-
queue.push({ p: this, r: resolve, j: reject, 1: resolved, 0: rejected });
|
371
|
-
});
|
372
|
-
}
|
373
|
-
|
374
|
-
// Case 2) handle a resolve or reject call
|
375
|
-
// (`resolved` === `is` acts as a sentinel)
|
376
|
-
// The actual function signature is
|
377
|
-
// .re[ject|solve](<is>, success, value)
|
378
|
-
|
379
|
-
// Check if the value is a promise and try to obtain its `then` method
|
380
|
-
if (value && (is(func, value) | is(obj, value))) {
|
381
|
-
try { then = value.then; }
|
382
|
-
catch (reason) { rejected = 0; value = reason; }
|
383
|
-
}
|
384
|
-
// If the value is a promise, take over its state
|
385
|
-
if (is(func, then)) {
|
386
|
-
var valueHandler = function (resolved) {
|
387
|
-
return function (value) { return then && (then = 0, pendingHandler(is, resolved, value)); };
|
388
|
-
};
|
389
|
-
try { then.call(value, valueHandler(1), rejected = valueHandler(0)); }
|
390
|
-
catch (reason) { rejected(reason); }
|
391
|
-
}
|
392
|
-
// The value is not a promise; handle resolve/reject
|
393
|
-
else {
|
394
|
-
// Replace this handler with a finalized resolved/rejected handler
|
395
|
-
handler = function (Resolved, Rejected) {
|
396
|
-
// If the Resolved or Rejected parameter is not a function,
|
397
|
-
// return the original promise (now stored in the `callback` variable)
|
398
|
-
if (!is(func, (Resolved = rejected ? Resolved : Rejected))) return callback;
|
399
|
-
// Otherwise, return a finalized promise, transforming the value with the function
|
400
|
-
return Promise(function (resolve, reject) { finalize(this, resolve, reject, value, Resolved); });
|
401
|
-
};
|
402
|
-
// Resolve/reject pending callbacks
|
403
|
-
i = 0;
|
404
|
-
while (i < queue.length) {
|
405
|
-
then = queue[i++];
|
406
|
-
// If no callback, just resolve/reject the promise
|
407
|
-
if (!is(func, resolved = then[rejected])) {
|
408
|
-
(rejected ? then.r : then.j)(value);
|
409
|
-
// Otherwise, resolve/reject the promise with the result of the callback
|
410
|
-
} else {
|
411
|
-
finalize(then.p, then.r, then.j, value, resolved);
|
412
|
-
}
|
413
|
-
}
|
414
|
-
}
|
415
|
-
};
|
416
|
-
|
417
|
-
// The queue of pending callbacks; garbage-collected when handler is resolved/rejected
|
418
|
-
handler.q = [];
|
419
|
-
|
420
|
-
// Create and return the promise (reusing the callback variable)
|
421
|
-
callback.call(callback = {
|
422
|
-
then: function (resolved, rejected) { return handler(resolved, rejected); },
|
423
|
-
catch: function (rejected) { return handler(0, rejected); }
|
424
|
-
},
|
425
|
-
function (value) { handler(is, 1, value); },
|
426
|
-
function (reason) { handler(is, 0, reason); }
|
427
|
-
);
|
428
|
-
|
429
|
-
return callback;
|
430
|
-
}
|
431
|
-
|
432
|
-
// Finalizes the promise by resolving/rejecting it with the transformed value
|
433
|
-
function finalize(promise, resolve, reject, value, transform) {
|
434
|
-
setTimeout(function () {
|
435
|
-
try {
|
436
|
-
// Transform the value through and check whether it's a promise
|
437
|
-
value = transform(value);
|
438
|
-
transform = value && (is(obj, value) | is(func, value)) && value.then;
|
439
|
-
// Return the result if it's not a promise
|
440
|
-
if (!is(func, transform))
|
441
|
-
resolve(value);
|
442
|
-
// If it's a promise, make sure it's not circular
|
443
|
-
else if (value == promise)
|
444
|
-
reject(TypeError());
|
445
|
-
// Take over the promise's state
|
446
|
-
else
|
447
|
-
transform.call(value, resolve, reject);
|
448
|
-
}
|
449
|
-
catch (error) { reject(error); }
|
450
|
-
}, 0);
|
451
|
-
}
|
452
|
-
|
453
|
-
// Creates a resolved promise
|
454
|
-
Promise.resolve = ResolvedPromise;
|
455
|
-
function ResolvedPromise(value) { return Promise(function (resolve) { resolve(value); }); }
|
456
|
-
|
457
|
-
// Creates a rejected promise
|
458
|
-
Promise.reject = function (reason) { return Promise(function (resolve, reject) { reject(reason); }); };
|
459
|
-
|
460
|
-
// Transforms an array of promises into a promise for an array
|
461
|
-
Promise.all = function (promises) {
|
462
|
-
return Promise(function (resolve, reject, count, values) {
|
463
|
-
// Array of collected values
|
464
|
-
values = [];
|
465
|
-
// Resolve immediately if there are no promises
|
466
|
-
count = promises.length || resolve(values);
|
467
|
-
// Transform all elements (`map` is shorter than `forEach`)
|
468
|
-
promises.map(function (promise, index) {
|
469
|
-
ResolvedPromise(promise).then(
|
470
|
-
// Store the value and resolve if it was the last
|
471
|
-
function (value) {
|
472
|
-
values[index] = value;
|
473
|
-
count = count -1;
|
474
|
-
if(!count) resolve(values);
|
475
|
-
},
|
476
|
-
// Reject if one element fails
|
477
|
-
reject);
|
478
|
-
});
|
479
|
-
});
|
480
|
-
};
|
481
|
-
|
482
|
-
return Promise;
|
483
|
-
})('f', 'o');
|
484
|
-
})(this);
|
485
|
-
|
486
396
|
(function($, UI) {
|
487
397
|
|
488
398
|
"use strict";
|
@@ -610,7 +520,7 @@
|
|
610
520
|
|
611
521
|
"use strict";
|
612
522
|
|
613
|
-
var
|
523
|
+
var stacks = [];
|
614
524
|
|
615
525
|
UI.component('stackMargin', {
|
616
526
|
|
@@ -626,24 +536,29 @@
|
|
626
536
|
|
627
537
|
if (!this.columns.length) return;
|
628
538
|
|
629
|
-
win.on(
|
539
|
+
UI.$win.on('resize orientationchange', (function() {
|
540
|
+
|
630
541
|
var fn = function() {
|
631
542
|
$this.process();
|
632
543
|
};
|
633
544
|
|
634
545
|
$(function() {
|
635
546
|
fn();
|
636
|
-
win.on("load", fn);
|
547
|
+
UI.$win.on("load", fn);
|
637
548
|
});
|
638
549
|
|
639
|
-
return UI.Utils.debounce(fn,
|
550
|
+
return UI.Utils.debounce(fn, 50);
|
640
551
|
})());
|
641
552
|
|
642
|
-
|
553
|
+
UI.$doc.on("uk.dom.changed", function(e) {
|
643
554
|
$this.columns = $this.element.children();
|
644
555
|
$this.process();
|
645
556
|
});
|
646
557
|
|
558
|
+
this.on("uk-check-display", function(e) {
|
559
|
+
if(this.element.is(":visible")) this.process();
|
560
|
+
}.bind(this));
|
561
|
+
|
647
562
|
stacks.push(this);
|
648
563
|
},
|
649
564
|
|
@@ -686,8 +601,9 @@
|
|
686
601
|
});
|
687
602
|
|
688
603
|
// init code
|
689
|
-
|
690
|
-
|
604
|
+
UI.ready(function(context) {
|
605
|
+
|
606
|
+
$("[data-uk-margin]", context).each(function() {
|
691
607
|
var ele = $(this), obj;
|
692
608
|
|
693
609
|
if (!ele.data("stackMargin")) {
|
@@ -696,13 +612,6 @@
|
|
696
612
|
});
|
697
613
|
});
|
698
614
|
|
699
|
-
|
700
|
-
$(document).on("uk-check-display", function(e) {
|
701
|
-
stacks.forEach(function(item) {
|
702
|
-
if(item.element.is(":visible")) item.process();
|
703
|
-
});
|
704
|
-
});
|
705
|
-
|
706
615
|
})(jQuery, jQuery.UIkit);
|
707
616
|
|
708
617
|
// Based on Zeptos touch.js
|
@@ -912,7 +821,7 @@
|
|
912
821
|
});
|
913
822
|
|
914
823
|
// init code
|
915
|
-
|
824
|
+
UI.$doc.on("click.alert.uikit", "[data-uk-alert]", function(e) {
|
916
825
|
|
917
826
|
var ele = $(this);
|
918
827
|
|
@@ -954,7 +863,7 @@
|
|
954
863
|
},
|
955
864
|
|
956
865
|
getSelected: function() {
|
957
|
-
this.find(".uk-active");
|
866
|
+
return this.find(".uk-active");
|
958
867
|
}
|
959
868
|
});
|
960
869
|
|
@@ -978,7 +887,7 @@
|
|
978
887
|
},
|
979
888
|
|
980
889
|
getSelected: function() {
|
981
|
-
this.find(".uk-active");
|
890
|
+
return this.find(".uk-active");
|
982
891
|
}
|
983
892
|
});
|
984
893
|
|
@@ -1008,7 +917,7 @@
|
|
1008
917
|
|
1009
918
|
|
1010
919
|
// init code
|
1011
|
-
|
920
|
+
UI.$doc.on("click.buttonradio.uikit", "[data-uk-button-radio]", function(e) {
|
1012
921
|
var ele = $(this);
|
1013
922
|
|
1014
923
|
if (!ele.data("buttonRadio")) {
|
@@ -1020,7 +929,7 @@
|
|
1020
929
|
}
|
1021
930
|
});
|
1022
931
|
|
1023
|
-
|
932
|
+
UI.$doc.on("click.buttoncheckbox.uikit", "[data-uk-button-checkbox]", function(e) {
|
1024
933
|
var ele = $(this);
|
1025
934
|
|
1026
935
|
if (!ele.data("buttonCheckbox")) {
|
@@ -1033,7 +942,7 @@
|
|
1033
942
|
}
|
1034
943
|
});
|
1035
944
|
|
1036
|
-
|
945
|
+
UI.$doc.on("click.button.uikit", "[data-uk-button]", function(e) {
|
1037
946
|
var ele = $(this);
|
1038
947
|
|
1039
948
|
if (!ele.data("button")) {
|
@@ -1057,7 +966,7 @@
|
|
1057
966
|
'mode' : 'hover',
|
1058
967
|
'remaintime' : 800,
|
1059
968
|
'justify' : false,
|
1060
|
-
'boundary' :
|
969
|
+
'boundary' : UI.$win,
|
1061
970
|
'delay' : 0
|
1062
971
|
},
|
1063
972
|
|
@@ -1076,7 +985,7 @@
|
|
1076
985
|
this.flipped = this.dropdown.hasClass('uk-dropdown-flip');
|
1077
986
|
|
1078
987
|
if(!this.boundary.length) {
|
1079
|
-
this.boundary =
|
988
|
+
this.boundary = UI.$win;
|
1080
989
|
}
|
1081
990
|
|
1082
991
|
if (this.options.mode == "click" || UI.support.touch) {
|
@@ -1166,6 +1075,8 @@
|
|
1166
1075
|
this.checkDimensions();
|
1167
1076
|
this.element.addClass("uk-open");
|
1168
1077
|
this.trigger('uk.dropdown.show', [this]);
|
1078
|
+
|
1079
|
+
UI.Utils.checkDisplay(this.dropdown);
|
1169
1080
|
active = this.element;
|
1170
1081
|
|
1171
1082
|
this.registerOuterClick();
|
@@ -1175,10 +1086,10 @@
|
|
1175
1086
|
|
1176
1087
|
var $this = this;
|
1177
1088
|
|
1178
|
-
|
1089
|
+
UI.$doc.off("click.outer.dropdown");
|
1179
1090
|
|
1180
1091
|
setTimeout(function() {
|
1181
|
-
|
1092
|
+
UI.$doc.on("click.outer.dropdown", function(e) {
|
1182
1093
|
|
1183
1094
|
if (hoverIdle) {
|
1184
1095
|
clearTimeout(hoverIdle);
|
@@ -1188,7 +1099,7 @@
|
|
1188
1099
|
|
1189
1100
|
if (active && active[0] == $this.element[0] && ($target.is("a:not(.js-uk-prevent)") || $target.is(".uk-dropdown-close") || !$this.dropdown.find(e.target).length)) {
|
1190
1101
|
active.removeClass("uk-open");
|
1191
|
-
|
1102
|
+
UI.$doc.off("click.outer.dropdown");
|
1192
1103
|
}
|
1193
1104
|
});
|
1194
1105
|
}, 10);
|
@@ -1279,7 +1190,7 @@
|
|
1279
1190
|
var triggerevent = UI.support.touch ? "click" : "mouseenter";
|
1280
1191
|
|
1281
1192
|
// init code
|
1282
|
-
|
1193
|
+
UI.$doc.on(triggerevent+".dropdown.uikit", "[data-uk-dropdown]", function(e) {
|
1283
1194
|
var ele = $(this);
|
1284
1195
|
|
1285
1196
|
if (!ele.data("dropdown")) {
|
@@ -1302,7 +1213,7 @@
|
|
1302
1213
|
|
1303
1214
|
"use strict";
|
1304
1215
|
|
1305
|
-
var
|
1216
|
+
var grids = [];
|
1306
1217
|
|
1307
1218
|
UI.component('gridMatchHeight', {
|
1308
1219
|
|
@@ -1320,25 +1231,30 @@
|
|
1320
1231
|
|
1321
1232
|
if (!this.columns.length) return;
|
1322
1233
|
|
1323
|
-
win.on(
|
1234
|
+
UI.$win.on('resize orientationchange', (function() {
|
1235
|
+
|
1324
1236
|
var fn = function() {
|
1325
1237
|
$this.match();
|
1326
1238
|
};
|
1327
1239
|
|
1328
1240
|
$(function() {
|
1329
1241
|
fn();
|
1330
|
-
win.on("load", fn);
|
1242
|
+
UI.$win.on("load", fn);
|
1331
1243
|
});
|
1332
1244
|
|
1333
|
-
return UI.Utils.debounce(fn,
|
1245
|
+
return UI.Utils.debounce(fn, 50);
|
1334
1246
|
})());
|
1335
1247
|
|
1336
|
-
|
1248
|
+
UI.$doc.on("uk.dom.changed", function(e) {
|
1337
1249
|
$this.columns = $this.element.children();
|
1338
1250
|
$this.elements = $this.options.target ? $this.find($this.options.target) : $this.columns;
|
1339
1251
|
$this.match();
|
1340
1252
|
});
|
1341
1253
|
|
1254
|
+
this.on("uk-check-display", function(e) {
|
1255
|
+
if(this.element.is(":visible")) this.match();
|
1256
|
+
}.bind(this));
|
1257
|
+
|
1342
1258
|
grids.push(this);
|
1343
1259
|
},
|
1344
1260
|
|
@@ -1431,8 +1347,9 @@
|
|
1431
1347
|
|
1432
1348
|
|
1433
1349
|
// init code
|
1434
|
-
|
1435
|
-
|
1350
|
+
UI.ready(function(context) {
|
1351
|
+
|
1352
|
+
$("[data-uk-grid-match],[data-uk-grid-margin]", context).each(function() {
|
1436
1353
|
var grid = $(this), obj;
|
1437
1354
|
|
1438
1355
|
if (grid.is("[data-uk-grid-match]") && !grid.data("gridMatchHeight")) {
|
@@ -1445,15 +1362,9 @@
|
|
1445
1362
|
});
|
1446
1363
|
});
|
1447
1364
|
|
1448
|
-
$(document).on("uk-check-display", function(e) {
|
1449
|
-
grids.forEach(function(item) {
|
1450
|
-
if(item.element.is(":visible")) item.match();
|
1451
|
-
});
|
1452
|
-
});
|
1453
|
-
|
1454
1365
|
})(jQuery, jQuery.UIkit);
|
1455
1366
|
|
1456
|
-
(function($, UI
|
1367
|
+
(function($, UI) {
|
1457
1368
|
|
1458
1369
|
"use strict";
|
1459
1370
|
|
@@ -1490,9 +1401,7 @@
|
|
1490
1401
|
if (target[0] == $this.element[0] && $this.options.bgclose) {
|
1491
1402
|
$this.hide();
|
1492
1403
|
}
|
1493
|
-
|
1494
1404
|
});
|
1495
|
-
|
1496
1405
|
},
|
1497
1406
|
|
1498
1407
|
toggle: function() {
|
@@ -1514,7 +1423,7 @@
|
|
1514
1423
|
|
1515
1424
|
this.element.addClass("uk-open").trigger("uk.modal.show");
|
1516
1425
|
|
1517
|
-
|
1426
|
+
UI.Utils.checkDisplay(this.dialog);
|
1518
1427
|
|
1519
1428
|
return this;
|
1520
1429
|
},
|
@@ -1662,7 +1571,7 @@
|
|
1662
1571
|
};
|
1663
1572
|
|
1664
1573
|
// init code
|
1665
|
-
|
1574
|
+
UI.$doc.on("click.modal.uikit", "[data-uk-modal]", function(e) {
|
1666
1575
|
|
1667
1576
|
var ele = $(this);
|
1668
1577
|
|
@@ -1678,7 +1587,7 @@
|
|
1678
1587
|
});
|
1679
1588
|
|
1680
1589
|
// close modal on esc button
|
1681
|
-
|
1590
|
+
UI.$doc.on('keydown.modal.uikit', function (e) {
|
1682
1591
|
|
1683
1592
|
if (active && e.keyCode === 27 && active.options.keyboard) { // ESC
|
1684
1593
|
e.preventDefault();
|
@@ -1686,7 +1595,7 @@
|
|
1686
1595
|
}
|
1687
1596
|
});
|
1688
1597
|
|
1689
|
-
|
1598
|
+
UI.$win.on("resize orientationchange", UI.Utils.debounce(function(){
|
1690
1599
|
if(active) active.resize();
|
1691
1600
|
}, 150));
|
1692
1601
|
|
@@ -1718,15 +1627,15 @@
|
|
1718
1627
|
return modal;
|
1719
1628
|
}
|
1720
1629
|
|
1721
|
-
})(jQuery, jQuery.UIkit
|
1630
|
+
})(jQuery, jQuery.UIkit);
|
1722
1631
|
|
1723
1632
|
(function($, UI) {
|
1724
1633
|
|
1725
1634
|
"use strict";
|
1726
1635
|
|
1727
1636
|
var scrollpos = {x: window.scrollX, y: window.scrollY},
|
1728
|
-
$win =
|
1729
|
-
$doc =
|
1637
|
+
$win = UI.$win,
|
1638
|
+
$doc = UI.$doc,
|
1730
1639
|
$html = $('html'),
|
1731
1640
|
Offcanvas = {
|
1732
1641
|
|
@@ -1743,7 +1652,7 @@
|
|
1743
1652
|
flip = bar.hasClass("uk-offcanvas-bar-flip") ? -1:1,
|
1744
1653
|
dir = flip * (rtl ? -1 : 1);
|
1745
1654
|
|
1746
|
-
scrollpos = {x: window.
|
1655
|
+
scrollpos = {x: window.pageXOffset, y: window.pageYOffset};
|
1747
1656
|
|
1748
1657
|
element.addClass("uk-active");
|
1749
1658
|
|
@@ -1775,6 +1684,8 @@
|
|
1775
1684
|
Offcanvas.hide();
|
1776
1685
|
}
|
1777
1686
|
});
|
1687
|
+
|
1688
|
+
$doc.trigger('uk.offcanvas.show', [element, bar]);
|
1778
1689
|
},
|
1779
1690
|
|
1780
1691
|
hide: function(force) {
|
@@ -1782,17 +1693,22 @@
|
|
1782
1693
|
var $body = $('body'),
|
1783
1694
|
panel = $(".uk-offcanvas.uk-active"),
|
1784
1695
|
rtl = ($.UIkit.langdirection == "right"),
|
1785
|
-
bar = panel.find(".uk-offcanvas-bar:first")
|
1696
|
+
bar = panel.find(".uk-offcanvas-bar:first"),
|
1697
|
+
finalize = function() {
|
1698
|
+
$body.removeClass("uk-offcanvas-page").css({"width": "", "height": "", "margin-left": "", "margin-right": ""});
|
1699
|
+
panel.removeClass("uk-active");
|
1700
|
+
bar.removeClass("uk-offcanvas-bar-show");
|
1701
|
+
$html.css('margin-top', '');
|
1702
|
+
window.scrollTo(scrollpos.x, scrollpos.y);
|
1703
|
+
$doc.trigger('uk.offcanvas.hide', [panel, bar]);
|
1704
|
+
};
|
1786
1705
|
|
1787
1706
|
if (!panel.length) return;
|
1788
1707
|
|
1789
1708
|
if ($.UIkit.support.transition && !force) {
|
1790
1709
|
|
1791
1710
|
$body.one($.UIkit.support.transition.end, function() {
|
1792
|
-
|
1793
|
-
panel.removeClass("uk-active");
|
1794
|
-
$html.css('margin-top', '');
|
1795
|
-
window.scrollTo(scrollpos.x, scrollpos.y);
|
1711
|
+
finalize();
|
1796
1712
|
}).css((rtl ? "margin-right" : "margin-left"), "");
|
1797
1713
|
|
1798
1714
|
setTimeout(function(){
|
@@ -1800,11 +1716,7 @@
|
|
1800
1716
|
}, 0);
|
1801
1717
|
|
1802
1718
|
} else {
|
1803
|
-
|
1804
|
-
panel.removeClass("uk-active");
|
1805
|
-
bar.removeClass("uk-offcanvas-bar-show");
|
1806
|
-
$html.css('margin-top', '');
|
1807
|
-
window.scrollTo(scrollpos.x, scrollpos.y);
|
1719
|
+
finalize();
|
1808
1720
|
}
|
1809
1721
|
|
1810
1722
|
panel.off(".ukoffcanvas");
|
@@ -1934,8 +1846,9 @@
|
|
1934
1846
|
}
|
1935
1847
|
|
1936
1848
|
// init code
|
1937
|
-
|
1938
|
-
|
1849
|
+
UI.ready(function(context) {
|
1850
|
+
|
1851
|
+
$("[data-uk-nav]", context).each(function() {
|
1939
1852
|
var nav = $(this);
|
1940
1853
|
|
1941
1854
|
if (!nav.data("nav")) {
|
@@ -1951,7 +1864,7 @@
|
|
1951
1864
|
"use strict";
|
1952
1865
|
|
1953
1866
|
var $tooltip, // tooltip container
|
1954
|
-
tooltipdelay;
|
1867
|
+
tooltipdelay, checkdelay;
|
1955
1868
|
|
1956
1869
|
UI.component('tooltip', {
|
1957
1870
|
|
@@ -1960,6 +1873,7 @@
|
|
1960
1873
|
"pos": "top",
|
1961
1874
|
"animation": false,
|
1962
1875
|
"delay": 0, // in miliseconds
|
1876
|
+
"cls": "",
|
1963
1877
|
"src": function() { return this.attr("title"); }
|
1964
1878
|
},
|
1965
1879
|
|
@@ -1989,13 +1903,13 @@
|
|
1989
1903
|
show: function() {
|
1990
1904
|
|
1991
1905
|
if (tooltipdelay) clearTimeout(tooltipdelay);
|
1906
|
+
if (checkdelay) clearTimeout(checkdelay);
|
1992
1907
|
if (!this.tip.length) return;
|
1993
1908
|
|
1994
1909
|
$tooltip.stop().css({"top": -2000, "visibility": "hidden"}).show();
|
1995
1910
|
$tooltip.html('<div class="uk-tooltip-inner">' + this.tip + '</div>');
|
1996
1911
|
|
1997
1912
|
var $this = this,
|
1998
|
-
bodyoffset = $('body').offset(),
|
1999
1913
|
pos = $.extend({}, this.element.offset(), {width: this.element[0].offsetWidth, height: this.element[0].offsetHeight}),
|
2000
1914
|
width = $tooltip[0].offsetWidth,
|
2001
1915
|
height = $tooltip[0].offsetHeight,
|
@@ -2003,16 +1917,24 @@
|
|
2003
1917
|
position = typeof(this.options.pos) === "function" ? this.options.pos.call(this.element) : this.options.pos,
|
2004
1918
|
tmppos = position.split("-"),
|
2005
1919
|
tcss = {
|
2006
|
-
"display": "none",
|
2007
|
-
"visibility": "visible",
|
2008
|
-
"top": (pos.top + pos.height + height),
|
2009
|
-
"left": pos.left
|
1920
|
+
"display" : "none",
|
1921
|
+
"visibility" : "visible",
|
1922
|
+
"top" : (pos.top + pos.height + height),
|
1923
|
+
"left" : pos.left
|
2010
1924
|
};
|
2011
1925
|
|
1926
|
+
|
2012
1927
|
// prevent strange position
|
2013
1928
|
// when tooltip is in offcanvas etc.
|
2014
|
-
|
2015
|
-
|
1929
|
+
if ($('html').css('position')=='fixed' || $('body').css('position')=='fixed'){
|
1930
|
+
var bodyoffset = $('body').offset(),
|
1931
|
+
htmloffset = $('html').offset(),
|
1932
|
+
docoffset = {'top': (htmloffset.top + bodyoffset.top), 'left': (htmloffset.left + bodyoffset.left)};
|
1933
|
+
|
1934
|
+
pos.left -= docoffset.left;
|
1935
|
+
pos.top -= docoffset.top;
|
1936
|
+
}
|
1937
|
+
|
2016
1938
|
|
2017
1939
|
if ((tmppos[0] == "left" || tmppos[0] == "right") && $.UIkit.langdirection == 'right') {
|
2018
1940
|
tmppos[0] = tmppos[0] == "left" ? "right" : "left";
|
@@ -2076,7 +1998,7 @@
|
|
2076
1998
|
|
2077
1999
|
tooltipdelay = setTimeout(function(){
|
2078
2000
|
|
2079
|
-
$tooltip.css(tcss).attr("class", "uk-tooltip uk-tooltip-"
|
2001
|
+
$tooltip.css(tcss).attr("class", ["uk-tooltip", "uk-tooltip-"+position, $this.options.cls].join(' '));
|
2080
2002
|
|
2081
2003
|
if ($this.options.animation) {
|
2082
2004
|
$tooltip.css({opacity: 0, display: 'block'}).animate({opacity: 1}, parseInt($this.options.animation, 10) || 400);
|
@@ -2085,6 +2007,12 @@
|
|
2085
2007
|
}
|
2086
2008
|
|
2087
2009
|
tooltipdelay = false;
|
2010
|
+
|
2011
|
+
// close tooltip if element was removed or hidden
|
2012
|
+
checkdelay = setInterval(function(){
|
2013
|
+
if(!$this.element.is(':visible')) $this.hide();
|
2014
|
+
}, 150);
|
2015
|
+
|
2088
2016
|
}, parseInt(this.options.delay, 10) || 0);
|
2089
2017
|
},
|
2090
2018
|
|
@@ -2092,6 +2020,7 @@
|
|
2092
2020
|
if(this.element.is("input") && this.element[0]===document.activeElement) return;
|
2093
2021
|
|
2094
2022
|
if(tooltipdelay) clearTimeout(tooltipdelay);
|
2023
|
+
if (checkdelay) clearTimeout(checkdelay);
|
2095
2024
|
|
2096
2025
|
$tooltip.stop();
|
2097
2026
|
|
@@ -2124,7 +2053,7 @@
|
|
2124
2053
|
|
2125
2054
|
|
2126
2055
|
// init code
|
2127
|
-
|
2056
|
+
UI.$doc.on("mouseenter.tooltip.uikit focus.tooltip.uikit", "[data-uk-tooltip]", function(e) {
|
2128
2057
|
var ele = $(this);
|
2129
2058
|
|
2130
2059
|
if (!ele.data("tooltip")) {
|
@@ -2160,6 +2089,28 @@
|
|
2160
2089
|
|
2161
2090
|
this.connect = $(this.options.connect).find(".uk-active").removeClass(".uk-active").end();
|
2162
2091
|
|
2092
|
+
// delegate switch commands within container content
|
2093
|
+
if (this.connect.length) {
|
2094
|
+
|
2095
|
+
this.connect.on("click", '[data-uk-switcher-item]', function(e) {
|
2096
|
+
|
2097
|
+
e.preventDefault();
|
2098
|
+
|
2099
|
+
var item = $(this).data('ukSwitcherItem');
|
2100
|
+
|
2101
|
+
if ($this.index == item) return;
|
2102
|
+
|
2103
|
+
switch(item) {
|
2104
|
+
case 'next':
|
2105
|
+
case 'previous':
|
2106
|
+
$this.show($this.index + (item=='next' ? 1:-1));
|
2107
|
+
break;
|
2108
|
+
default:
|
2109
|
+
$this.show(item);
|
2110
|
+
}
|
2111
|
+
});
|
2112
|
+
}
|
2113
|
+
|
2163
2114
|
var toggles = this.find(this.options.toggle),
|
2164
2115
|
active = toggles.filter(".uk-active");
|
2165
2116
|
|
@@ -2177,7 +2128,7 @@
|
|
2177
2128
|
|
2178
2129
|
tab = isNaN(tab) ? $(tab) : this.find(this.options.toggle).eq(tab);
|
2179
2130
|
|
2180
|
-
var active = tab;
|
2131
|
+
var $this = this, active = tab;
|
2181
2132
|
|
2182
2133
|
if (active.hasClass("uk-disabled")) return;
|
2183
2134
|
|
@@ -2186,20 +2137,27 @@
|
|
2186
2137
|
|
2187
2138
|
if (this.options.connect && this.connect.length) {
|
2188
2139
|
|
2189
|
-
|
2140
|
+
this.index = this.find(this.options.toggle).index(active);
|
2141
|
+
|
2142
|
+
if (this.index == -1 ) {
|
2143
|
+
this.index = 0;
|
2144
|
+
}
|
2190
2145
|
|
2191
|
-
this.connect.
|
2146
|
+
this.connect.each(function() {
|
2147
|
+
$(this).children().removeClass("uk-active").eq($this.index).addClass("uk-active");
|
2148
|
+
UI.Utils.checkDisplay(this);
|
2149
|
+
});
|
2192
2150
|
}
|
2193
2151
|
|
2194
2152
|
this.trigger("uk.switcher.show", [active]);
|
2195
|
-
$(document).trigger("uk-check-display");
|
2196
2153
|
}
|
2197
2154
|
});
|
2198
2155
|
|
2199
2156
|
|
2200
2157
|
// init code
|
2201
|
-
|
2202
|
-
|
2158
|
+
UI.ready(function(context) {
|
2159
|
+
|
2160
|
+
$("[data-uk-switcher]", context).each(function() {
|
2203
2161
|
var switcher = $(this);
|
2204
2162
|
|
2205
2163
|
if (!switcher.data("switcher")) {
|
@@ -2218,8 +2176,9 @@
|
|
2218
2176
|
UI.component('tab', {
|
2219
2177
|
|
2220
2178
|
defaults: {
|
2221
|
-
|
2222
|
-
|
2179
|
+
'target' : '>li:not(.uk-tab-responsive, .uk-disabled)',
|
2180
|
+
'connect' : false,
|
2181
|
+
'active' : 0
|
2223
2182
|
},
|
2224
2183
|
|
2225
2184
|
init: function() {
|
@@ -2229,60 +2188,105 @@
|
|
2229
2188
|
this.on("click", this.options.target, function(e) {
|
2230
2189
|
e.preventDefault();
|
2231
2190
|
$this.find($this.options.target).not(this).removeClass("uk-active").blur();
|
2232
|
-
$this.trigger("change", [$(this).addClass("uk-active")]);
|
2191
|
+
$this.trigger("uk.tab.change", [$(this).addClass("uk-active")]);
|
2233
2192
|
});
|
2234
2193
|
|
2235
|
-
|
2236
2194
|
if (this.options.connect) {
|
2237
2195
|
this.connect = $(this.options.connect);
|
2238
2196
|
}
|
2239
2197
|
|
2240
|
-
|
2241
|
-
|
2198
|
+
// init responsive tab
|
2199
|
+
this.responsivetab = $('<li class="uk-tab-responsive uk-active"><a></a></li>').append('<div class="uk-dropdown uk-dropdown-small"><ul class="uk-nav uk-nav-dropdown"></ul><div>');
|
2242
2200
|
|
2243
|
-
|
2244
|
-
|
2245
|
-
|
2246
|
-
}
|
2201
|
+
this.responsivetab.dropdown = this.responsivetab.find('.uk-dropdown');
|
2202
|
+
this.responsivetab.lst = this.responsivetab.dropdown.find('ul');
|
2203
|
+
this.responsivetab.caption = this.responsivetab.find('a:first');
|
2247
2204
|
|
2248
|
-
|
2249
|
-
caption = mobiletab.find("a:first"),
|
2250
|
-
dropdown = $('<div class="uk-dropdown uk-dropdown-small"><ul class="uk-nav uk-nav-dropdown"></ul><div>'),
|
2251
|
-
ul = dropdown.find("ul");
|
2205
|
+
if (this.element.hasClass("uk-tab-bottom")) this.responsivetab.dropdown.addClass("uk-dropdown-up");
|
2252
2206
|
|
2253
|
-
|
2207
|
+
// handle click
|
2208
|
+
this.responsivetab.lst.on('click', 'a', function(e) {
|
2254
2209
|
|
2255
|
-
|
2256
|
-
|
2210
|
+
e.preventDefault();
|
2211
|
+
e.stopPropagation();
|
2257
2212
|
|
2258
|
-
|
2213
|
+
var link = $(this);
|
2259
2214
|
|
2260
|
-
|
2261
|
-
|
2262
|
-
$this.element.data("switcher").show(i);
|
2263
|
-
});
|
2215
|
+
$this.element.children(':not(.uk-tab-responsive)').eq(link.data('index')).trigger('click');
|
2216
|
+
});
|
2264
2217
|
|
2265
|
-
|
2218
|
+
this.on('uk.switcher.show uk.tab.change', function(e, tab) {
|
2219
|
+
$this.responsivetab.caption.html(tab.text());
|
2266
2220
|
});
|
2267
2221
|
|
2268
|
-
this.element.
|
2222
|
+
this.element.append(this.responsivetab);
|
2269
2223
|
|
2270
|
-
|
2224
|
+
// init UIkit components
|
2225
|
+
if (this.options.connect) {
|
2226
|
+
UI.switcher(this.element, {"toggle": ">li:not(.uk-tab-responsive)", "connect": this.options.connect, "active": this.options.active});
|
2227
|
+
}
|
2228
|
+
|
2229
|
+
UI.dropdown(this.responsivetab, {"mode": "click"});
|
2230
|
+
|
2231
|
+
// init
|
2232
|
+
$this.trigger("uk.tab.change", [this.element.find(this.options.target).filter('.uk-active')]);
|
2233
|
+
|
2234
|
+
this.check();
|
2235
|
+
|
2236
|
+
UI.$win.on('resize orientationchange', UI.Utils.debounce(function(){
|
2237
|
+
$this.check();
|
2238
|
+
}, 100));
|
2239
|
+
},
|
2240
|
+
|
2241
|
+
check: function() {
|
2242
|
+
|
2243
|
+
var children = this.element.children(':not(.uk-tab-responsive)').removeClass('uk-hidden');
|
2244
|
+
|
2245
|
+
if (children.length < 2) return;
|
2271
2246
|
|
2272
|
-
|
2273
|
-
|
2274
|
-
|
2275
|
-
|
2276
|
-
|
2277
|
-
|
2247
|
+
var top = (children.eq(0).offset().top + Math.ceil(children.eq(0).height()/2)),
|
2248
|
+
added = 0,
|
2249
|
+
doresponsive = false,
|
2250
|
+
item, link;
|
2251
|
+
|
2252
|
+
this.responsivetab.lst.empty();
|
2253
|
+
|
2254
|
+
children.each(function(){
|
2255
|
+
|
2256
|
+
item = $(this);
|
2257
|
+
|
2258
|
+
if (item.offset().top > top || (added && this.responsivetab.offset().top > top)) {
|
2259
|
+
doresponsive = true;
|
2260
|
+
}
|
2278
2261
|
});
|
2279
2262
|
|
2263
|
+
if (doresponsive) {
|
2264
|
+
|
2265
|
+
for (var i = 0; i < children.length; i++) {
|
2266
|
+
|
2267
|
+
item = children.eq(i);
|
2268
|
+
link = item.find('a');
|
2269
|
+
|
2270
|
+
if (item.css('float') != 'none' && !item.attr('uk-dropdown')) {
|
2271
|
+
|
2272
|
+
item.addClass('uk-hidden');
|
2273
|
+
|
2274
|
+
if (!item.hasClass('uk-disabled')) {
|
2275
|
+
this.responsivetab.lst.append('<li><a href="'+link.attr('href')+'" data-index="'+i+'">'+link.html()+'</a></li>');
|
2276
|
+
}
|
2277
|
+
}
|
2278
|
+
}
|
2279
|
+
}
|
2280
|
+
|
2281
|
+
this.responsivetab[this.responsivetab.lst.children().length ? 'removeClass':'addClass']('uk-hidden');
|
2280
2282
|
}
|
2281
2283
|
});
|
2282
2284
|
|
2283
|
-
|
2285
|
+
// init code
|
2286
|
+
UI.ready(function(context) {
|
2287
|
+
|
2288
|
+
$("[data-uk-tab]", context).each(function() {
|
2284
2289
|
|
2285
|
-
$("[data-uk-tab]").each(function() {
|
2286
2290
|
var tab = $(this);
|
2287
2291
|
|
2288
2292
|
if (!tab.data("tab")) {
|
@@ -2297,8 +2301,8 @@
|
|
2297
2301
|
|
2298
2302
|
"use strict";
|
2299
2303
|
|
2300
|
-
var $win =
|
2301
|
-
$doc =
|
2304
|
+
var $win = UI.$win,
|
2305
|
+
$doc = UI.$doc,
|
2302
2306
|
scrollspies = [],
|
2303
2307
|
checkScrollSpy = function() {
|
2304
2308
|
for(var i=0; i < scrollspies.length; i++) {
|
@@ -2444,8 +2448,9 @@
|
|
2444
2448
|
$win.on("resize orientationchange", UI.Utils.debounce(fnCheck, 50));
|
2445
2449
|
|
2446
2450
|
// init code
|
2447
|
-
|
2448
|
-
|
2451
|
+
UI.ready(function(context) {
|
2452
|
+
|
2453
|
+
$("[data-uk-scrollspy]", context).each(function() {
|
2449
2454
|
|
2450
2455
|
var element = $(this);
|
2451
2456
|
|
@@ -2454,7 +2459,7 @@
|
|
2454
2459
|
}
|
2455
2460
|
});
|
2456
2461
|
|
2457
|
-
$("[data-uk-scrollspy-nav]").each(function() {
|
2462
|
+
$("[data-uk-scrollspy-nav]", context).each(function() {
|
2458
2463
|
|
2459
2464
|
var element = $(this);
|
2460
2465
|
|
@@ -2488,8 +2493,8 @@
|
|
2488
2493
|
// get / set parameters
|
2489
2494
|
var ele = ($(this.hash).length ? $(this.hash) : $("body")),
|
2490
2495
|
target = ele.offset().top - $this.options.offset,
|
2491
|
-
docheight =
|
2492
|
-
winheight =
|
2496
|
+
docheight = UI.$doc.height(),
|
2497
|
+
winheight = UI.$win.height(),
|
2493
2498
|
eleheight = ele.outerHeight();
|
2494
2499
|
|
2495
2500
|
if ((target + winheight) > docheight) {
|
@@ -2511,7 +2516,7 @@
|
|
2511
2516
|
}
|
2512
2517
|
|
2513
2518
|
// init code
|
2514
|
-
|
2519
|
+
UI.$doc.on("click.smooth-scroll.uikit", "[data-uk-smooth-scroll]", function(e) {
|
2515
2520
|
var ele = $(this);
|
2516
2521
|
|
2517
2522
|
if (!ele.data("smoothScroll")) {
|
@@ -2527,6 +2532,7 @@
|
|
2527
2532
|
|
2528
2533
|
(function(global, $, UI){
|
2529
2534
|
|
2535
|
+
var togglers = [];
|
2530
2536
|
|
2531
2537
|
UI.component('toggle', {
|
2532
2538
|
|
@@ -2539,12 +2545,14 @@
|
|
2539
2545
|
|
2540
2546
|
var $this = this;
|
2541
2547
|
|
2542
|
-
this.
|
2548
|
+
this.getTogglers();
|
2543
2549
|
|
2544
2550
|
this.on("click", function(e) {
|
2545
2551
|
if ($this.element.is('a[href="#"]')) e.preventDefault();
|
2546
2552
|
$this.toggle();
|
2547
2553
|
});
|
2554
|
+
|
2555
|
+
togglers.push(this);
|
2548
2556
|
},
|
2549
2557
|
|
2550
2558
|
toggle: function() {
|
@@ -2553,21 +2561,34 @@
|
|
2553
2561
|
|
2554
2562
|
this.totoggle.toggleClass(this.options.cls);
|
2555
2563
|
|
2556
|
-
if(this.options.cls == 'uk-hidden') {
|
2557
|
-
|
2564
|
+
if (this.options.cls == 'uk-hidden') {
|
2565
|
+
UI.Utils.checkDisplay(this.totoggle);
|
2558
2566
|
}
|
2567
|
+
},
|
2568
|
+
|
2569
|
+
getTogglers: function() {
|
2570
|
+
this.totoggle = this.options.target ? $(this.options.target):[];
|
2559
2571
|
}
|
2560
2572
|
});
|
2561
2573
|
|
2562
|
-
|
2574
|
+
// init code
|
2575
|
+
UI.ready(function(context) {
|
2563
2576
|
|
2564
|
-
$("[data-uk-toggle]").each(function() {
|
2577
|
+
$("[data-uk-toggle]", context).each(function() {
|
2565
2578
|
var ele = $(this);
|
2566
2579
|
|
2567
2580
|
if (!ele.data("toggle")) {
|
2568
2581
|
var obj = UI.toggle(ele, UI.Utils.options(ele.attr("data-uk-toggle")));
|
2569
2582
|
}
|
2570
2583
|
});
|
2584
|
+
|
2585
|
+
setTimeout(function(){
|
2586
|
+
|
2587
|
+
togglers.forEach(function(toggler){
|
2588
|
+
toggler.getTogglers();
|
2589
|
+
});
|
2590
|
+
|
2591
|
+
}, 0);
|
2571
2592
|
});
|
2572
2593
|
|
2573
2594
|
})(this, jQuery, jQuery.UIkit);
|