Updated the footable Lib.
This commit is contained in:
@ -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";
|
||||
@ -17,6 +17,7 @@
|
||||
|
||||
scrollable: false,
|
||||
transition: false,
|
||||
hasTransitioned: true,
|
||||
|
||||
init: function() {
|
||||
|
||||
@ -74,7 +75,14 @@
|
||||
|
||||
activeCount++;
|
||||
|
||||
this.element.addClass("uk-open");
|
||||
if (UI.support.transition) {
|
||||
this.hasTransitioned = false;
|
||||
this.element.one(UI.support.transition.end, function(){
|
||||
$this.hasTransitioned = true;
|
||||
}).addClass("uk-open");
|
||||
} else {
|
||||
this.element.addClass("uk-open");
|
||||
}
|
||||
|
||||
$html.addClass("uk-modal-page").height(); // force browser engine redraw
|
||||
|
||||
@ -90,7 +98,7 @@
|
||||
|
||||
hide: function(force) {
|
||||
|
||||
if (!force && UI.support.transition) {
|
||||
if (!force && UI.support.transition && this.hasTransitioned) {
|
||||
|
||||
var $this = this;
|
||||
|
||||
@ -136,14 +144,17 @@
|
||||
|
||||
if (scrollable.length) {
|
||||
|
||||
scrollable.css("height", 0);
|
||||
scrollable.css('height', 0);
|
||||
|
||||
var offset = Math.abs(parseInt(this.dialog.css("margin-top"), 10)),
|
||||
var offset = Math.abs(parseInt(this.dialog.css('margin-top'), 10)),
|
||||
dh = this.dialog.outerHeight(),
|
||||
wh = window.innerHeight,
|
||||
h = wh - 2*(offset < 20 ? 20:offset) - dh;
|
||||
|
||||
scrollable.css("height", h < this.options.minScrollHeight ? "":h);
|
||||
scrollable.css({
|
||||
'max-height': (h < this.options.minScrollHeight ? '':h),
|
||||
'height':''
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -154,21 +165,22 @@
|
||||
_hide: function() {
|
||||
|
||||
this.active = false;
|
||||
activeCount--;
|
||||
if (activeCount > 0) activeCount--;
|
||||
else activeCount = 0;
|
||||
|
||||
this.element.hide().removeClass("uk-open");
|
||||
this.element.hide().removeClass('uk-open');
|
||||
|
||||
// Update ARIA
|
||||
this.element.attr('aria-hidden', 'true');
|
||||
|
||||
if (!activeCount) {
|
||||
$html.removeClass("uk-modal-page");
|
||||
$html.removeClass('uk-modal-page');
|
||||
body.css(this.paddingdir, "");
|
||||
}
|
||||
|
||||
if(active===this) active = false;
|
||||
|
||||
this.trigger("hide.uk.modal");
|
||||
this.trigger('hide.uk.modal');
|
||||
},
|
||||
|
||||
isActive: function() {
|
||||
@ -265,31 +277,34 @@
|
||||
}, 50);
|
||||
});
|
||||
|
||||
modal.show();
|
||||
return modal.show();
|
||||
};
|
||||
|
||||
UI.modal.confirm = function(content, onconfirm, options) {
|
||||
UI.modal.confirm = function(content, onconfirm, oncancel) {
|
||||
|
||||
var options = arguments.length > 1 && arguments[arguments.length-1] ? arguments[arguments.length-1] : {};
|
||||
|
||||
onconfirm = UI.$.isFunction(onconfirm) ? onconfirm : function(){};
|
||||
options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options);
|
||||
oncancel = UI.$.isFunction(oncancel) ? oncancel : function(){};
|
||||
options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, UI.$.isFunction(options) ? {}:options);
|
||||
|
||||
var modal = UI.modal.dialog(([
|
||||
'<div class="uk-margin uk-modal-content">'+String(content)+'</div>',
|
||||
'<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-button-primary js-modal-confirm">'+options.labels.Ok+'</button> <button class="uk-button uk-modal-close">'+options.labels.Cancel+'</button></div>'
|
||||
'<div class="uk-modal-footer uk-text-right"><button class="uk-button js-modal-confirm-cancel">'+options.labels.Cancel+'</button> <button class="uk-button uk-button-primary js-modal-confirm">'+options.labels.Ok+'</button></div>'
|
||||
]).join(""), options);
|
||||
|
||||
modal.element.find(".js-modal-confirm").on("click", function(){
|
||||
onconfirm();
|
||||
modal.element.find(".js-modal-confirm, .js-modal-confirm-cancel").on("click", function(){
|
||||
UI.$(this).is('.js-modal-confirm') ? onconfirm() : oncancel();
|
||||
modal.hide();
|
||||
});
|
||||
|
||||
modal.on('show.uk.modal', function(){
|
||||
setTimeout(function(){
|
||||
modal.element.find('button:first').focus();
|
||||
modal.element.find('.js-modal-confirm').focus();
|
||||
}, 50);
|
||||
});
|
||||
|
||||
modal.show();
|
||||
return modal.show();
|
||||
};
|
||||
|
||||
UI.modal.prompt = function(text, value, onsubmit, options) {
|
||||
@ -300,7 +315,7 @@
|
||||
var modal = UI.modal.dialog(([
|
||||
text ? '<div class="uk-modal-content uk-form">'+String(text)+'</div>':'',
|
||||
'<div class="uk-margin-small-top uk-modal-content uk-form"><p><input type="text" class="uk-width-1-1"></p></div>',
|
||||
'<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-button-primary js-modal-ok">'+options.labels.Ok+'</button> <button class="uk-button uk-modal-close">'+options.labels.Cancel+'</button></div>'
|
||||
'<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-modal-close">'+options.labels.Cancel+'</button> <button class="uk-button uk-button-primary js-modal-ok">'+options.labels.Ok+'</button></div>'
|
||||
]).join(""), options),
|
||||
|
||||
input = modal.element.find("input[type='text']").val(value || '').on('keyup', function(e){
|
||||
@ -321,7 +336,7 @@
|
||||
}, 50);
|
||||
});
|
||||
|
||||
modal.show();
|
||||
return modal.show();
|
||||
};
|
||||
|
||||
UI.modal.blockUI = function(content, options) {
|
||||
@ -331,9 +346,8 @@
|
||||
]).join(""), UI.$.extend({bgclose:false, keyboard:false, modal:false}, options));
|
||||
|
||||
modal.content = modal.element.find('.uk-modal-content:first');
|
||||
modal.show();
|
||||
|
||||
return modal;
|
||||
return modal.show();
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user