updated Uikit v2

This commit is contained in:
2017-11-12 02:33:10 +02:00
parent 7d27af5d59
commit 1cc40dbfe4
437 changed files with 9171 additions and 5797 deletions

View File

@ -1,15 +1,15 @@
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
(function(addon) {
var component;
if (window.UIkit) {
component = addon(UIkit);
if (window.UIkit2) {
component = addon(UIkit2);
}
if (typeof define == "function" && define.amd) {
define("uikit-autocomplete", ["uikit"], function(){
return component || addon(UIkit);
if (typeof define == 'function' && define.amd) {
define('uikit-autocomplete', ['uikit'], function(){
return component || addon(UIkit2);
});
}
@ -45,17 +45,17 @@
boot: function() {
// init code
UI.$html.on("focus.autocomplete.uikit", "[data-uk-autocomplete]", function(e) {
UI.$html.on('focus.autocomplete.uikit', '[data-uk-autocomplete]', function(e) {
var ele = UI.$(this);
if (!ele.data("autocomplete")) {
UI.autocomplete(ele, UI.Utils.options(ele.attr("data-uk-autocomplete")));
if (!ele.data('autocomplete')) {
UI.autocomplete(ele, UI.Utils.options(ele.attr('data-uk-autocomplete')));
}
});
// register outer click for autocompletes
UI.$html.on("click.autocomplete.uikit", function(e) {
UI.$html.on('click.autocomplete.uikit', function(e) {
if (active && e.target!=active.input[0]) active.hide();
});
},
@ -65,9 +65,11 @@
var $this = this,
select = false,
trigger = UI.Utils.debounce(function(e) {
if(select) {
if (select) {
return (select = false);
}
$this.handle();
}, this.options.delay);
@ -88,9 +90,10 @@
this.dropdown.attr('aria-expanded', 'false');
this.input.on({
"keydown": function(e) {
if (e && e.which && !e.shiftKey) {
keydown: function(e) {
if (e && e.which && !e.shiftKey && $this.visible) {
switch (e.which) {
case 13: // enter
@ -119,14 +122,15 @@
}
},
"keyup": trigger
keyup: trigger
});
this.dropdown.on("click", ".uk-autocomplete-results > *", function(){
this.dropdown.on('click', '.uk-autocomplete-results > *', function(){
$this.select();
});
this.dropdown.on("mouseover", ".uk-autocomplete-results > *", function(){
this.dropdown.on('mouseover', '.uk-autocomplete-results > *', function(){
$this.pick(UI.$(this));
});
@ -199,7 +203,7 @@
var data = this.selected.data();
this.trigger("selectitem.uk.autocomplete", [data, this]);
this.trigger('selectitem.uk.autocomplete', [data, this]);
if (data.value) {
this.input.val(data.value).trigger('change');
@ -209,9 +213,11 @@
},
show: function() {
if (this.visible) return;
this.visible = true;
this.element.addClass("uk-open");
this.element.addClass('uk-open');
if (active && active!==this) {
active.hide();
@ -228,7 +234,7 @@
hide: function() {
if (!this.visible) return;
this.visible = false;
this.element.removeClass("uk-open");
this.element.removeClass('uk-open');
if (active === this) {
active = false;
@ -320,7 +326,7 @@
} else if(data && data.length) {
this.dropdown.append(this.template({"items":data}));
this.dropdown.append(this.template({items:data}));
this.show();
this.trigger('show.uk.autocomplete');