Updated the footable Lib.

This commit is contained in:
2016-03-19 03:51:35 +02:00
parent 1cad434a39
commit 3bc71a935c
801 changed files with 8543 additions and 3032 deletions

View File

@@ -1,4 +1,4 @@
/*! UIkit 2.21.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(UI) {
"use strict";
@@ -8,7 +8,8 @@
UI.component('stackMargin', {
defaults: {
'cls': 'uk-margin-small-top'
cls: 'uk-margin-small-top',
rowfirst: false
},
boot: function() {
@@ -18,10 +19,10 @@
UI.$("[data-uk-margin]", context).each(function() {
var ele = UI.$(this), obj;
var ele = UI.$(this);
if (!ele.data("stackMargin")) {
obj = UI.stackMargin(ele, UI.Utils.options(ele.attr("data-uk-margin")));
UI.stackMargin(ele, UI.Utils.options(ele.attr("data-uk-margin")));
}
});
});
@@ -31,10 +32,6 @@
var $this = this;
this.columns = this.element.children();
if (!this.columns.length) return;
UI.$win.on('resize orientationchange', (function() {
var fn = function() {
@@ -50,12 +47,10 @@
})());
UI.$html.on("changed.uk.dom", function(e) {
$this.columns = $this.element.children();
$this.process();
});
this.on("display.uk.check", function(e) {
$this.columns = $this.element.children();
if (this.element.is(":visible")) this.process();
}.bind(this));
@@ -64,17 +59,26 @@
process: function() {
var $this = this;
var $this = this, columns = this.element.children();
UI.Utils.stackMargin(this.columns, this.options);
UI.Utils.stackMargin(columns, this.options);
return this;
},
if (!this.options.rowfirst) {
return this;
}
// Mark first column elements
var pos_cache = columns.removeClass(this.options.rowfirst).filter(':visible').first().position();
if (pos_cache) {
columns.each(function() {
UI.$(this)[UI.$(this).position().left == pos_cache.left ? 'addClass':'removeClass']($this.options.rowfirst);
});
}
revert: function() {
this.columns.removeClass(this.options.cls);
return this;
}
});
@@ -107,7 +111,7 @@
var ele = UI.$(this), obj;
if (!ele.data("responsiveIframe")) {
if (!ele.data("responsiveElement")) {
obj = UI.responsiveElement(ele, {});
}
});
@@ -164,7 +168,7 @@
firstvisible = elements.filter(":visible:first"),
offset = firstvisible.length ? (firstvisible.position().top + firstvisible.outerHeight()) - 1 : false; // (-1): weird firefox bug when parent container is display:flex
if (offset === false) return;
if (offset === false || elements.length == 1) return;
elements.each(function() {
@@ -240,4 +244,54 @@
}
};
(function(cacheSvgs){
UI.Utils.inlineSvg = function(selector, root) {
var images = UI.$(selector || 'img[src$=".svg"]', root || document).each(function(){
var img = UI.$(this),
src = img.attr('src');
if (!cacheSvgs[src]) {
var d = UI.$.Deferred();
UI.$.get(src, {nc: Math.random()}, function(data){
d.resolve(UI.$(data).find('svg'));
});
cacheSvgs[src] = d.promise();
}
cacheSvgs[src].then(function(svg) {
var $svg = UI.$(svg).clone();
if (img.attr('id')) $svg.attr('id', img.attr('id'));
if (img.attr('class')) $svg.attr('class', img.attr('class'));
if (img.attr('style')) $svg.attr('style', img.attr('style'));
if (img.attr('width')) {
$svg.attr('width', img.attr('width'));
if (!img.attr('height')) $svg.removeAttr('height');
}
if (img.attr('height')){
$svg.attr('height', img.attr('height'));
if (!img.attr('width')) $svg.removeAttr('width');
}
img.replaceWith($svg);
});
});
};
// init code
UI.ready(function(context) {
UI.Utils.inlineSvg('[data-uk-svg]', context);
});
})({});
})(UIkit);