updated Uikit v2
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
/*! 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-accordion", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-accordion', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
})(function(UI){
|
||||
@ -35,11 +35,11 @@
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
UI.$("[data-uk-accordion]", context).each(function(){
|
||||
UI.$('[data-uk-accordion]', context).each(function(){
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if(!ele.data("accordion")) {
|
||||
if (!ele.data('accordion')) {
|
||||
UI.accordion(ele, UI.Utils.options(ele.attr('data-uk-accordion')));
|
||||
}
|
||||
});
|
||||
@ -59,11 +59,13 @@
|
||||
$this.toggleItem(UI.$(this).data('wrapper'), $this.options.animate, $this.options.collapse);
|
||||
});
|
||||
|
||||
this.update();
|
||||
this.update(true);
|
||||
|
||||
if (this.options.showfirst) {
|
||||
this.toggleItem(this.toggle.eq(0).data('wrapper'), false, false);
|
||||
}
|
||||
UI.domObserve(this.element, function(e) {
|
||||
if ($this.element.children($this.options.containers).length) {
|
||||
$this.update();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
toggleItem: function(wrapper, animated, collapse) {
|
||||
@ -113,7 +115,7 @@
|
||||
this.element.trigger('toggle.uk.accordion', [active, wrapper.data('toggle'), wrapper.data('content')]);
|
||||
},
|
||||
|
||||
update: function() {
|
||||
update: function(init) {
|
||||
|
||||
var $this = this, $content, $wrapper, $toggle;
|
||||
|
||||
@ -142,6 +144,10 @@
|
||||
});
|
||||
|
||||
this.element.trigger('update.uk.accordion', [this]);
|
||||
|
||||
if (init && this.options.showfirst) {
|
||||
this.toggleItem(this.toggle.eq(0).data('wrapper'), false, false);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
@ -157,9 +163,9 @@
|
||||
} else {
|
||||
|
||||
var tmp = {
|
||||
position : $ele.css("position"),
|
||||
visibility : $ele.css("visibility"),
|
||||
display : $ele.css("display")
|
||||
position : $ele.css('position'),
|
||||
visibility : $ele.css('visibility'),
|
||||
display : $ele.css('display')
|
||||
};
|
||||
|
||||
height = $ele.css({position: 'absolute', visibility: 'hidden', display: 'block'}).outerHeight();
|
||||
|
4
media/uikit/js/components/accordion.min.js
vendored
4
media/uikit/js/components/accordion.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-accordion",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(i){var o=t.$(i),e="auto";if(o.is(":visible"))e=o.outerHeight();else{var a={position:o.css("position"),visibility:o.css("visibility"),display:o.css("display")};e=o.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),o.css(a)}return e}return t.component("accordion",{defaults:{showfirst:!0,collapse:!0,animate:!0,easing:"swing",duration:300,toggle:".uk-accordion-title",containers:".uk-accordion-content",clsactive:"uk-active"},boot:function(){t.ready(function(i){setTimeout(function(){t.$("[data-uk-accordion]",i).each(function(){var i=t.$(this);i.data("accordion")||t.accordion(i,t.Utils.options(i.attr("data-uk-accordion")))})},0)})},init:function(){var i=this;this.element.on("click.uk.accordion",this.options.toggle,function(o){o.preventDefault(),i.toggleItem(t.$(this).data("wrapper"),i.options.animate,i.options.collapse)}),this.update(),this.options.showfirst&&this.toggleItem(this.toggle.eq(0).data("wrapper"),!1,!1)},toggleItem:function(o,e,a){var n=this;o.data("toggle").toggleClass(this.options.clsactive),o.data("content").toggleClass(this.options.clsactive);var s=o.data("toggle").hasClass(this.options.clsactive);a&&(this.toggle.not(o.data("toggle")).removeClass(this.options.clsactive),this.content.not(o.data("content")).removeClass(this.options.clsactive).parent().stop().css("overflow","hidden").animate({height:0},{easing:this.options.easing,duration:e?this.options.duration:0}).attr("aria-expanded","false")),o.stop().css("overflow","hidden"),e?o.animate({height:s?i(o.data("content")):0},{easing:this.options.easing,duration:this.options.duration,complete:function(){s&&(o.css({overflow:"",height:"auto"}),t.Utils.checkDisplay(o.data("content"))),n.trigger("display.uk.check")}}):(o.height(s?"auto":0),s&&(o.css({overflow:""}),t.Utils.checkDisplay(o.data("content"))),this.trigger("display.uk.check")),o.attr("aria-expanded",s),this.element.trigger("toggle.uk.accordion",[s,o.data("toggle"),o.data("content")])},update:function(){var i,o,e,a=this;this.toggle=this.find(this.options.toggle),this.content=this.find(this.options.containers),this.content.each(function(n){i=t.$(this),i.parent().data("wrapper")?o=i.parent():(o=t.$(this).wrap('<div data-wrapper="true" style="overflow:hidden;height:0;position:relative;"></div>').parent(),o.attr("aria-expanded","false")),e=a.toggle.eq(n),o.data("toggle",e),o.data("content",i),e.data("wrapper",o),i.data("wrapper",o)}),this.element.trigger("update.uk.accordion",[this])}}),t.accordion});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit2&&(i=t(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-accordion",["uikit"],function(){return i||t(UIkit2)})}(function(t){"use strict";function i(i){var e=t.$(i),o="auto";if(e.is(":visible"))o=e.outerHeight();else{var a={position:e.css("position"),visibility:e.css("visibility"),display:e.css("display")};o=e.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),e.css(a)}return o}return t.component("accordion",{defaults:{showfirst:!0,collapse:!0,animate:!0,easing:"swing",duration:300,toggle:".uk-accordion-title",containers:".uk-accordion-content",clsactive:"uk-active"},boot:function(){t.ready(function(i){setTimeout(function(){t.$("[data-uk-accordion]",i).each(function(){var i=t.$(this);i.data("accordion")||t.accordion(i,t.Utils.options(i.attr("data-uk-accordion")))})},0)})},init:function(){var i=this;this.element.on("click.uk.accordion",this.options.toggle,function(e){e.preventDefault(),i.toggleItem(t.$(this).data("wrapper"),i.options.animate,i.options.collapse)}),this.update(!0),t.domObserve(this.element,function(){i.element.children(i.options.containers).length&&i.update()})},toggleItem:function(e,o,a){var n=this;e.data("toggle").toggleClass(this.options.clsactive),e.data("content").toggleClass(this.options.clsactive);var s=e.data("toggle").hasClass(this.options.clsactive);a&&(this.toggle.not(e.data("toggle")).removeClass(this.options.clsactive),this.content.not(e.data("content")).removeClass(this.options.clsactive).parent().stop().css("overflow","hidden").animate({height:0},{easing:this.options.easing,duration:o?this.options.duration:0}).attr("aria-expanded","false")),e.stop().css("overflow","hidden"),o?e.animate({height:s?i(e.data("content")):0},{easing:this.options.easing,duration:this.options.duration,complete:function(){s&&(e.css({overflow:"",height:"auto"}),t.Utils.checkDisplay(e.data("content"))),n.trigger("display.uk.check")}}):(e.height(s?"auto":0),s&&(e.css({overflow:""}),t.Utils.checkDisplay(e.data("content"))),this.trigger("display.uk.check")),e.attr("aria-expanded",s),this.element.trigger("toggle.uk.accordion",[s,e.data("toggle"),e.data("content")])},update:function(i){var e,o,a,n=this;this.toggle=this.find(this.options.toggle),this.content=this.find(this.options.containers),this.content.each(function(i){e=t.$(this),e.parent().data("wrapper")?o=e.parent():(o=t.$(this).wrap('<div data-wrapper="true" style="overflow:hidden;height:0;position:relative;"></div>').parent(),o.attr("aria-expanded","false")),a=n.toggle.eq(i),o.data("toggle",a),o.data("content",e),a.data("wrapper",o),e.data("wrapper",o)}),this.element.trigger("update.uk.accordion",[this]),i&&this.options.showfirst&&this.toggleItem(this.toggle.eq(0).data("wrapper"),!1,!1)}}),t.accordion});
|
@ -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');
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-autocomplete",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e;return t.component("autocomplete",{defaults:{minLength:3,param:"search",method:"post",delay:300,loadingClass:"uk-loading",flipDropdown:!1,skipClass:"uk-skip",hoverClass:"uk-active",source:null,renderer:null,template:'<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>'},visible:!1,value:null,selected:null,boot:function(){t.$html.on("focus.autocomplete.uikit","[data-uk-autocomplete]",function(){var e=t.$(this);e.data("autocomplete")||t.autocomplete(e,t.Utils.options(e.attr("data-uk-autocomplete")))}),t.$html.on("click.autocomplete.uikit",function(t){e&&t.target!=e.input[0]&&e.hide()})},init:function(){var e=this,i=!1,s=t.Utils.debounce(function(){return i?i=!1:(e.handle(),void 0)},this.options.delay);this.dropdown=this.find(".uk-dropdown"),this.template=this.find('script[type="text/autocomplete"]').html(),this.template=t.Utils.template(this.template||this.options.template),this.input=this.find("input:first").attr("autocomplete","off"),this.dropdown.length||(this.dropdown=t.$('<div class="uk-dropdown"></div>').appendTo(this.element)),this.options.flipDropdown&&this.dropdown.addClass("uk-dropdown-flip"),this.dropdown.attr("aria-expanded","false"),this.input.on({keydown:function(t){if(t&&t.which&&!t.shiftKey)switch(t.which){case 13:i=!0,e.selected&&(t.preventDefault(),e.select());break;case 38:t.preventDefault(),e.pick("prev",!0);break;case 40:t.preventDefault(),e.pick("next",!0);break;case 27:case 9:e.hide()}},keyup:s}),this.dropdown.on("click",".uk-autocomplete-results > *",function(){e.select()}),this.dropdown.on("mouseover",".uk-autocomplete-results > *",function(){e.pick(t.$(this))}),this.triggercomplete=s},handle:function(){var t=this,e=this.value;return this.value=this.input.val(),this.value.length<this.options.minLength?this.hide():(this.value!=e&&t.request(),this)},pick:function(e,i){var s=this,o=t.$(this.dropdown.find(".uk-autocomplete-results").children(":not(."+this.options.skipClass+")")),n=!1;if("string"==typeof e||e.hasClass(this.options.skipClass)){if("next"==e||"prev"==e){if(this.selected){var a=o.index(this.selected);n="next"==e?o.eq(a+1<o.length?a+1:0):o.eq(0>a-1?o.length-1:a-1)}else n=o["next"==e?"first":"last"]();n=t.$(n)}}else n=e;if(n&&n.length&&(this.selected=n,o.removeClass(this.options.hoverClass),this.selected.addClass(this.options.hoverClass),i)){var l=n.position().top,h=s.dropdown.scrollTop(),r=s.dropdown.height();(l>r||0>l)&&s.dropdown.scrollTop(h+l)}},select:function(){if(this.selected){var t=this.selected.data();this.trigger("selectitem.uk.autocomplete",[t,this]),t.value&&this.input.val(t.value).trigger("change"),this.hide()}},show:function(){return this.visible?void 0:(this.visible=!0,this.element.addClass("uk-open"),e&&e!==this&&e.hide(),e=this,this.dropdown.attr("aria-expanded","true"),this)},hide:function(){return this.visible?(this.visible=!1,this.element.removeClass("uk-open"),e===this&&(e=!1),this.dropdown.attr("aria-expanded","false"),this):void 0},request:function(){var e=this,i=function(t){t&&e.render(t),e.element.removeClass(e.options.loadingClass)};if(this.element.addClass(this.options.loadingClass),this.options.source){var s=this.options.source;switch(typeof this.options.source){case"function":this.options.source.apply(this,[i]);break;case"object":if(s.length){var o=[];s.forEach(function(t){t.value&&-1!=t.value.toLowerCase().indexOf(e.value.toLowerCase())&&o.push(t)}),i(o)}break;case"string":var n={};n[this.options.param]=this.value,t.$.ajax({url:this.options.source,data:n,type:this.options.method,dataType:"json"}).done(function(t){i(t||[])});break;default:i(null)}}else this.element.removeClass(e.options.loadingClass)},render:function(t){return this.dropdown.empty(),this.selected=!1,this.options.renderer?this.options.renderer.apply(this,[t]):t&&t.length&&(this.dropdown.append(this.template({items:t})),this.show(),this.trigger("show.uk.autocomplete")),this}}),t.autocomplete});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit2&&(e=t(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-autocomplete",["uikit"],function(){return e||t(UIkit2)})}(function(t){"use strict";var e;return t.component("autocomplete",{defaults:{minLength:3,param:"search",method:"post",delay:300,loadingClass:"uk-loading",flipDropdown:!1,skipClass:"uk-skip",hoverClass:"uk-active",source:null,renderer:null,template:'<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>'},visible:!1,value:null,selected:null,boot:function(){t.$html.on("focus.autocomplete.uikit","[data-uk-autocomplete]",function(){var e=t.$(this);e.data("autocomplete")||t.autocomplete(e,t.Utils.options(e.attr("data-uk-autocomplete")))}),t.$html.on("click.autocomplete.uikit",function(t){e&&t.target!=e.input[0]&&e.hide()})},init:function(){var e=this,i=!1,s=t.Utils.debounce(function(){return i?i=!1:(e.handle(),void 0)},this.options.delay);this.dropdown=this.find(".uk-dropdown"),this.template=this.find('script[type="text/autocomplete"]').html(),this.template=t.Utils.template(this.template||this.options.template),this.input=this.find("input:first").attr("autocomplete","off"),this.dropdown.length||(this.dropdown=t.$('<div class="uk-dropdown"></div>').appendTo(this.element)),this.options.flipDropdown&&this.dropdown.addClass("uk-dropdown-flip"),this.dropdown.attr("aria-expanded","false"),this.input.on({keydown:function(t){if(t&&t.which&&!t.shiftKey&&e.visible)switch(t.which){case 13:i=!0,e.selected&&(t.preventDefault(),e.select());break;case 38:t.preventDefault(),e.pick("prev",!0);break;case 40:t.preventDefault(),e.pick("next",!0);break;case 27:case 9:e.hide()}},keyup:s}),this.dropdown.on("click",".uk-autocomplete-results > *",function(){e.select()}),this.dropdown.on("mouseover",".uk-autocomplete-results > *",function(){e.pick(t.$(this))}),this.triggercomplete=s},handle:function(){var t=this,e=this.value;return this.value=this.input.val(),this.value.length<this.options.minLength?this.hide():(this.value!=e&&t.request(),this)},pick:function(e,i){var s=this,o=t.$(this.dropdown.find(".uk-autocomplete-results").children(":not(."+this.options.skipClass+")")),n=!1;if("string"==typeof e||e.hasClass(this.options.skipClass)){if("next"==e||"prev"==e){if(this.selected){var a=o.index(this.selected);n="next"==e?o.eq(a+1<o.length?a+1:0):o.eq(0>a-1?o.length-1:a-1)}else n=o["next"==e?"first":"last"]();n=t.$(n)}}else n=e;if(n&&n.length&&(this.selected=n,o.removeClass(this.options.hoverClass),this.selected.addClass(this.options.hoverClass),i)){var l=n.position().top,h=s.dropdown.scrollTop(),r=s.dropdown.height();(l>r||0>l)&&s.dropdown.scrollTop(h+l)}},select:function(){if(this.selected){var t=this.selected.data();this.trigger("selectitem.uk.autocomplete",[t,this]),t.value&&this.input.val(t.value).trigger("change"),this.hide()}},show:function(){return this.visible?void 0:(this.visible=!0,this.element.addClass("uk-open"),e&&e!==this&&e.hide(),e=this,this.dropdown.attr("aria-expanded","true"),this)},hide:function(){return this.visible?(this.visible=!1,this.element.removeClass("uk-open"),e===this&&(e=!1),this.dropdown.attr("aria-expanded","false"),this):void 0},request:function(){var e=this,i=function(t){t&&e.render(t),e.element.removeClass(e.options.loadingClass)};if(this.element.addClass(this.options.loadingClass),this.options.source){var s=this.options.source;switch(typeof this.options.source){case"function":this.options.source.apply(this,[i]);break;case"object":if(s.length){var o=[];s.forEach(function(t){t.value&&-1!=t.value.toLowerCase().indexOf(e.value.toLowerCase())&&o.push(t)}),i(o)}break;case"string":var n={};n[this.options.param]=this.value,t.$.ajax({url:this.options.source,data:n,type:this.options.method,dataType:"json"}).done(function(t){i(t||[])});break;default:i(null)}}else this.element.removeClass(e.options.loadingClass)},render:function(t){return this.dropdown.empty(),this.selected=!1,this.options.renderer?this.options.renderer.apply(this,[t]):t&&t.length&&(this.dropdown.append(this.template({items:t})),this.show(),this.trigger("show.uk.autocomplete")),this}}),t.autocomplete});
|
@ -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-datepicker", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-datepicker', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -30,11 +30,12 @@
|
||||
months : ['January','February','March','April','May','June','July','August','September','October','November','December'],
|
||||
weekdays : ['Sun','Mon','Tue','Wed','Thu','Fri','Sat']
|
||||
},
|
||||
format: "YYYY-MM-DD",
|
||||
format: 'YYYY-MM-DD',
|
||||
offsettop: 5,
|
||||
maxDate: false,
|
||||
minDate: false,
|
||||
pos: 'auto',
|
||||
container: 'body',
|
||||
template: function(data, opts) {
|
||||
|
||||
var content = '', i;
|
||||
@ -120,7 +121,7 @@
|
||||
|
||||
boot: function() {
|
||||
|
||||
UI.$win.on("resize orientationchange", function() {
|
||||
UI.$win.on('resize orientationchange', function() {
|
||||
|
||||
if (active) {
|
||||
active.hide();
|
||||
@ -128,22 +129,22 @@
|
||||
});
|
||||
|
||||
// init code
|
||||
UI.$html.on("focus.datepicker.uikit", "[data-uk-datepicker]", function(e) {
|
||||
UI.$html.on('focus.datepicker.uikit', '[data-uk-datepicker]', function(e) {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("datepicker")) {
|
||||
if (!ele.data('datepicker')) {
|
||||
e.preventDefault();
|
||||
UI.datepicker(ele, UI.Utils.options(ele.attr("data-uk-datepicker")));
|
||||
ele.trigger("focus");
|
||||
UI.datepicker(ele, UI.Utils.options(ele.attr('data-uk-datepicker')));
|
||||
ele.trigger('focus');
|
||||
}
|
||||
});
|
||||
|
||||
UI.$html.on("click focus", '*', function(e) {
|
||||
UI.$html.on('click focus', '*', function(e) {
|
||||
|
||||
var target = UI.$(e.target);
|
||||
|
||||
if (active && target[0] != dropdown[0] && !target.data("datepicker") && !target.parents(".uk-datepicker:first").length) {
|
||||
if (active && target[0] != dropdown[0] && !target.data('datepicker') && !target.parents('.uk-datepicker:first').length) {
|
||||
active.hide();
|
||||
}
|
||||
});
|
||||
@ -160,9 +161,9 @@
|
||||
|
||||
this.current = this.element.val() ? moment(this.element.val(), this.options.format) : moment();
|
||||
|
||||
this.on("click focus", function(){
|
||||
if (active!==$this) $this.pick(this.value ? this.value:($this.options.minDate ? $this.options.minDate :''));
|
||||
}).on("change", function(){
|
||||
this.on('click focus', function(){
|
||||
if (active!==$this) $this.pick(this.value ? this.value:'');
|
||||
}).on('change', function(){
|
||||
|
||||
if ($this.element.val() && !moment($this.element.val(), $this.options.format).isValid()) {
|
||||
$this.element.val(moment().format($this.options.format));
|
||||
@ -174,7 +175,7 @@
|
||||
|
||||
dropdown = UI.$('<div class="uk-dropdown uk-datepicker"></div>');
|
||||
|
||||
dropdown.on("click", ".uk-datepicker-next, .uk-datepicker-previous, [data-date]", function(e){
|
||||
dropdown.on('click', '.uk-datepicker-next, .uk-datepicker-previous, [data-date]', function(e){
|
||||
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
@ -185,7 +186,7 @@
|
||||
|
||||
if (ele.is('[data-date]')) {
|
||||
active.current = moment(ele.data("date"));
|
||||
active.element.val(active.current.format(active.options.format)).trigger("change");
|
||||
active.element.val(active.current.isValid() ? active.current.format(active.options.format) : null).trigger("change");
|
||||
active.hide();
|
||||
} else {
|
||||
active.add((ele.hasClass("uk-datepicker-next") ? 1:-1), "months");
|
||||
@ -198,14 +199,14 @@
|
||||
active[select.is('.update-picker-year') ? 'setYear':'setMonth'](Number(select.val()));
|
||||
});
|
||||
|
||||
dropdown.appendTo("body");
|
||||
dropdown.appendTo(this.options.container);
|
||||
}
|
||||
},
|
||||
|
||||
pick: function(initdate) {
|
||||
|
||||
var offset = this.element.offset(),
|
||||
css = {"left": offset.left, "right":""};
|
||||
css = {left: offset.left, right:''};
|
||||
|
||||
this.current = isNaN(initdate) ? moment(initdate, this.options.format):moment();
|
||||
this.initdate = this.current.format("YYYY-MM-DD");
|
||||
@ -214,7 +215,7 @@
|
||||
|
||||
if (UI.langdirection == 'right') {
|
||||
css.right = window.innerWidth - (css.left + this.element.outerWidth());
|
||||
css.left = "";
|
||||
css.left = '';
|
||||
}
|
||||
|
||||
var posTop = (offset.top - this.element.outerHeight() + this.element.height()) - this.options.offsettop - dropdown.outerHeight(),
|
||||
@ -265,15 +266,16 @@
|
||||
now = moment().format('YYYY-MM-DD'),
|
||||
days = [31, (year % 4 === 0 && year % 100 !== 0 || year % 400 === 0) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month],
|
||||
before = new Date(year, month, 1, 12).getDay(),
|
||||
data = {"month":month, "year":year,"weekdays":[],"days":[], "maxDate": false, "minDate": false},
|
||||
data = {month:month, year:year, weekdays:[], days:[], maxDate:false, minDate:false},
|
||||
row = [];
|
||||
|
||||
// We need these to be midday to avoid issues from DST transition protection.
|
||||
if (opts.maxDate!==false){
|
||||
data.maxDate = isNaN(opts.maxDate) ? moment(opts.maxDate, opts.format) : moment().add(opts.maxDate, 'days');
|
||||
data.maxDate = isNaN(opts.maxDate) ? moment(opts.maxDate, opts.format).startOf('day').hours(12) : moment().add(opts.maxDate, 'days').startOf('day').hours(12);
|
||||
}
|
||||
|
||||
if (opts.minDate!==false){
|
||||
data.minDate = isNaN(opts.minDate) ? moment(opts.minDate, opts.format) : moment().add(opts.minDate-1, 'days');
|
||||
data.minDate = isNaN(opts.minDate) ? moment(opts.minDate, opts.format).startOf('day').hours(12) : moment().add(opts.minDate-1, 'days').startOf('day').hours(12);
|
||||
}
|
||||
|
||||
data.weekdays = (function(){
|
||||
@ -315,10 +317,10 @@
|
||||
|
||||
day = moment(day);
|
||||
|
||||
isSelected = this.initdate == day.format("YYYY-MM-DD");
|
||||
isToday = now == day.format("YYYY-MM-DD");
|
||||
isSelected = this.initdate == day.format('YYYY-MM-DD');
|
||||
isToday = now == day.format('YYYY-MM-DD');
|
||||
|
||||
row.push({"selected": isSelected, "today": isToday, "disabled": isDisabled, "day":day, "inmonth":isInMonth});
|
||||
row.push({selected: isSelected, today: isToday, disabled: isDisabled, day:day, inmonth:isInMonth});
|
||||
|
||||
if (++r === 7) {
|
||||
data.days.push(row);
|
||||
|
6
media/uikit/js/components/datepicker.min.js
vendored
6
media/uikit/js/components/datepicker.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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-form-password", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-form-password', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -20,22 +20,22 @@
|
||||
UI.component('formPassword', {
|
||||
|
||||
defaults: {
|
||||
"lblShow": "Show",
|
||||
"lblHide": "Hide"
|
||||
lblShow: 'Show',
|
||||
lblHide: 'Hide'
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
// init code
|
||||
UI.$html.on("click.formpassword.uikit", "[data-uk-form-password]", function(e) {
|
||||
UI.$html.on('click.formpassword.uikit', '[data-uk-form-password]', function(e) {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("formPassword")) {
|
||||
if (!ele.data('formPassword')) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
UI.formPassword(ele, UI.Utils.options(ele.attr("data-uk-form-password")));
|
||||
ele.trigger("click");
|
||||
UI.formPassword(ele, UI.Utils.options(ele.attr('data-uk-form-password')));
|
||||
ele.trigger('click');
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -44,22 +44,22 @@
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.on("click", function(e) {
|
||||
this.on('click', function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if($this.input.length) {
|
||||
var type = $this.input.attr("type");
|
||||
$this.input.attr("type", type=="text" ? "password":"text");
|
||||
$this.element.html($this.options[type=="text" ? "lblShow":"lblHide"]);
|
||||
var type = $this.input.attr('type');
|
||||
$this.input.attr('type', type=='text' ? 'password':'text');
|
||||
$this.element.html($this.options[type=='text' ? 'lblShow':'lblHide']);
|
||||
}
|
||||
});
|
||||
|
||||
this.input = this.element.next("input").length ? this.element.next("input") : this.element.prev("input");
|
||||
this.element.html(this.options[this.input.is("[type='password']") ? "lblShow":"lblHide"]);
|
||||
this.input = this.element.next('input').length ? this.element.next('input') : this.element.prev('input');
|
||||
this.element.html(this.options[this.input.is('[type="password"]') ? 'lblShow':'lblHide']);
|
||||
|
||||
|
||||
this.element.data("formPassword", this);
|
||||
this.element.data('formPassword', this);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-password",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";return t.component("formPassword",{defaults:{lblShow:"Show",lblHide:"Hide"},boot:function(){t.$html.on("click.formpassword.uikit","[data-uk-form-password]",function(i){var e=t.$(this);e.data("formPassword")||(i.preventDefault(),t.formPassword(e,t.Utils.options(e.attr("data-uk-form-password"))),e.trigger("click"))})},init:function(){var t=this;this.on("click",function(i){if(i.preventDefault(),t.input.length){var e=t.input.attr("type");t.input.attr("type","text"==e?"password":"text"),t.element.html(t.options["text"==e?"lblShow":"lblHide"])}}),this.input=this.element.next("input").length?this.element.next("input"):this.element.prev("input"),this.element.html(this.options[this.input.is("[type='password']")?"lblShow":"lblHide"]),this.element.data("formPassword",this)}}),t.formPassword});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit2&&(i=t(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-form-password",["uikit"],function(){return i||t(UIkit2)})}(function(t){"use strict";return t.component("formPassword",{defaults:{lblShow:"Show",lblHide:"Hide"},boot:function(){t.$html.on("click.formpassword.uikit","[data-uk-form-password]",function(i){var e=t.$(this);e.data("formPassword")||(i.preventDefault(),t.formPassword(e,t.Utils.options(e.attr("data-uk-form-password"))),e.trigger("click"))})},init:function(){var t=this;this.on("click",function(i){if(i.preventDefault(),t.input.length){var e=t.input.attr("type");t.input.attr("type","text"==e?"password":"text"),t.element.html(t.options["text"==e?"lblShow":"lblHide"])}}),this.input=this.element.next("input").length?this.element.next("input"):this.element.prev("input"),this.element.html(this.options[this.input.is('[type="password"]')?"lblShow":"lblHide"]),this.element.data("formPassword",this)}}),t.formPassword});
|
@ -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-form-select", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-form-select', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -20,47 +20,62 @@
|
||||
UI.component('formSelect', {
|
||||
|
||||
defaults: {
|
||||
'target': '>span:first',
|
||||
'activeClass': 'uk-active'
|
||||
target: '>span:first',
|
||||
activeClass: 'uk-active'
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-form-select]", context).each(function(){
|
||||
UI.$('[data-uk-form-select]', context).each(function(){
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("formSelect")) {
|
||||
UI.formSelect(ele, UI.Utils.options(ele.attr("data-uk-form-select")));
|
||||
if (!ele.data('formSelect')) {
|
||||
UI.formSelect(ele, UI.Utils.options(ele.attr('data-uk-form-select')));
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
init: function() {
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.target = this.find(this.options.target);
|
||||
this.select = this.find('select');
|
||||
|
||||
// init + on change event
|
||||
this.select.on("change", (function(){
|
||||
this.select.on({
|
||||
|
||||
var select = $this.select[0], fn = function(){
|
||||
change: (function(){
|
||||
|
||||
try {
|
||||
$this.target.text(select.options[select.selectedIndex].text);
|
||||
} catch(e) {}
|
||||
var select = $this.select[0], fn = function(){
|
||||
|
||||
$this.element[$this.select.val() ? 'addClass':'removeClass']($this.options.activeClass);
|
||||
try {
|
||||
|
||||
return fn;
|
||||
};
|
||||
if($this.options.target === 'input') {
|
||||
$this.target.val(select.options[select.selectedIndex].text);
|
||||
} else {
|
||||
$this.target.text(select.options[select.selectedIndex].text);
|
||||
}
|
||||
|
||||
return fn();
|
||||
})());
|
||||
} catch(e) {}
|
||||
|
||||
$this.element[$this.select.val() ? 'addClass':'removeClass']($this.options.activeClass);
|
||||
|
||||
return fn;
|
||||
};
|
||||
|
||||
return fn();
|
||||
})(),
|
||||
|
||||
focus: function(){ $this.target.addClass('uk-focus') },
|
||||
blur: function(){ $this.target.removeClass('uk-focus') },
|
||||
mouseenter: function(){ $this.target.addClass('uk-hover') },
|
||||
mouseleave: function(){ $this.target.removeClass('uk-hover') }
|
||||
});
|
||||
|
||||
this.element.data("formSelect", this);
|
||||
}
|
||||
|
4
media/uikit/js/components/form-select.min.js
vendored
4
media/uikit/js/components/form-select.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-form-select",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";return t.component("formSelect",{defaults:{target:">span:first",activeClass:"uk-active"},boot:function(){t.ready(function(e){t.$("[data-uk-form-select]",e).each(function(){var e=t.$(this);e.data("formSelect")||t.formSelect(e,t.Utils.options(e.attr("data-uk-form-select")))})})},init:function(){var t=this;this.target=this.find(this.options.target),this.select=this.find("select"),this.select.on("change",function(){var e=t.select[0],i=function(){try{t.target.text(e.options[e.selectedIndex].text)}catch(n){}return t.element[t.select.val()?"addClass":"removeClass"](t.options.activeClass),i};return i()}()),this.element.data("formSelect",this)}}),t.formSelect});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit2&&(e=t(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-form-select",["uikit"],function(){return e||t(UIkit2)})}(function(t){"use strict";return t.component("formSelect",{defaults:{target:">span:first",activeClass:"uk-active"},boot:function(){t.ready(function(e){t.$("[data-uk-form-select]",e).each(function(){var e=t.$(this);e.data("formSelect")||t.formSelect(e,t.Utils.options(e.attr("data-uk-form-select")))})})},init:function(){var t=this;this.target=this.find(this.options.target),this.select=this.find("select"),this.select.on({change:function(){var e=t.select[0],n=function(){try{"input"===t.options.target?t.target.val(e.options[e.selectedIndex].text):t.target.text(e.options[e.selectedIndex].text)}catch(s){}return t.element[t.select.val()?"addClass":"removeClass"](t.options.activeClass),n};return n()}(),focus:function(){t.target.addClass("uk-focus")},blur:function(){t.target.removeClass("uk-focus")},mouseenter:function(){t.target.addClass("uk-hover")},mouseleave:function(){t.target.removeClass("uk-hover")}}),this.element.data("formSelect",this)}}),t.formSelect});
|
@ -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-grid-parallax", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-grid-parallax', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -28,16 +28,16 @@
|
||||
UI.component('gridparallax', {
|
||||
|
||||
defaults: {
|
||||
target : false,
|
||||
smooth : 150,
|
||||
translate : 150
|
||||
target : false,
|
||||
smooth : 150,
|
||||
translate : 150
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
|
||||
// listen to scroll and resize
|
||||
UI.$doc.on("scrolling.uk.document", checkParallaxes);
|
||||
UI.$win.on("load resize orientationchange", UI.Utils.debounce(function(){
|
||||
UI.$doc.on('scrolling.uk.document', checkParallaxes);
|
||||
UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(){
|
||||
checkParallaxes();
|
||||
}, 50));
|
||||
|
||||
@ -48,8 +48,8 @@
|
||||
|
||||
var parallax = UI.$(this);
|
||||
|
||||
if (!parallax.data("gridparallax")) {
|
||||
UI.gridparallax(parallax, UI.Utils.options(parallax.attr("data-uk-grid-parallax")));
|
||||
if (!parallax.data('gridparallax')) {
|
||||
UI.gridparallax(parallax, UI.Utils.options(parallax.attr('data-uk-grid-parallax')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -107,7 +107,7 @@
|
||||
}
|
||||
|
||||
while(mods.length < columns) {
|
||||
if(!(mods[mods.length-1] - 2)) break;
|
||||
if (!(mods[mods.length-1] - 2)) break;
|
||||
mods.push(mods[mods.length-1] - 2);
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
|
||||
var top = element.offset().top,
|
||||
height = element.outerHeight(),
|
||||
scrolltop = UIkit.$win.scrollTop(),
|
||||
scrolltop = UI.$win.scrollTop(),
|
||||
wh = window.innerHeight,
|
||||
distance, percentage, percent;
|
||||
|
||||
@ -165,4 +165,4 @@
|
||||
|
||||
return percent > 1 ? 1:percent;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var n;window.UIkit&&(n=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-grid-parallax",["uikit"],function(){return n||t(UIkit)})}(function(t){function n(t){for(var n=t.children(),i=n.filter(":visible:first"),e=i[0].offsetTop+i.outerHeight(),o=0;o<n.length&&!(n[o].offsetTop>=e);o++);return o||1}function i(t){var n,i,e,o=t.offset().top,r=t.outerHeight(),s=UIkit.$win.scrollTop(),a=window.innerHeight;return o>s+a?e=0:s>o+r?e=1:(a>o+r?e=(a>s?s:s-a)/(o+r):(n=s+a-o,i=Math.round(n/((a+r)/100)),e=i/100),a>o&&(e=e*s/(o+r-a))),e>1?1:e}var e=[],o=function(){requestAnimationFrame(function(){for(var t=0;t<e.length;t++)e[t].process()})};t.component("gridparallax",{defaults:{target:!1,smooth:150,translate:150},boot:function(){t.$doc.on("scrolling.uk.document",o),t.$win.on("load resize orientationchange",t.Utils.debounce(function(){o()},50)),t.ready(function(n){t.$("[data-uk-grid-parallax]",n).each(function(){var n=t.$(this);n.data("gridparallax")||t.gridparallax(n,t.Utils.options(n.attr("data-uk-grid-parallax")))})})},init:function(){var i=this;this.initItems().process(),e.push(this),t.$win.on("load resize orientationchange",function(){var e=function(){var t=n(i.element);i.element.css("margin-bottom",""),t>1&&i.element.css("margin-bottom",i.options.translate+parseInt(i.element.css("margin-bottom")))};return t.$(function(){e()}),t.Utils.debounce(e,50)}())},initItems:function(){var n=this.options.smooth;return this.items=(this.options.target?this.element.find(this.options.target):this.element.children()).each(function(){t.$(this).css({transition:"transform "+n+"ms linear",transform:""})}),this},process:function(){var e=i(this.element),o=n(this.element),r=this.items,s=[o-1];if(1==o||!e)return r.css("transform",""),void 0;for(;s.length<o&&s[s.length-1]-2;)s.push(s[s.length-1]-2);var a=this.options.translate,l=e*a;r.each(function(n,i,e){e=-1!=s.indexOf((n+1)%o)?l:l/8,t.$(this).css("transform","translate3d(0,"+e+"px, 0)")})}})});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var n;window.UIkit2&&(n=t(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-grid-parallax",["uikit"],function(){return n||t(UIkit2)})}(function(t){function n(t){for(var n=t.children(),i=n.filter(":visible:first"),e=i[0].offsetTop+i.outerHeight(),o=0;o<n.length&&!(n[o].offsetTop>=e);o++);return o||1}function i(n){var i,e,o,r=n.offset().top,s=n.outerHeight(),a=t.$win.scrollTop(),l=window.innerHeight;return r>a+l?o=0:a>r+s?o=1:(l>r+s?o=(l>a?a:a-l)/(r+s):(i=a+l-r,e=Math.round(i/((l+s)/100)),o=e/100),l>r&&(o=o*a/(r+s-l))),o>1?1:o}var e=[],o=function(){requestAnimationFrame(function(){for(var t=0;t<e.length;t++)e[t].process()})};t.component("gridparallax",{defaults:{target:!1,smooth:150,translate:150},boot:function(){t.$doc.on("scrolling.uk.document",o),t.$win.on("load resize orientationchange",t.Utils.debounce(function(){o()},50)),t.ready(function(n){t.$("[data-uk-grid-parallax]",n).each(function(){var n=t.$(this);n.data("gridparallax")||t.gridparallax(n,t.Utils.options(n.attr("data-uk-grid-parallax")))})})},init:function(){var i=this;this.initItems().process(),e.push(this),t.$win.on("load resize orientationchange",function(){var e=function(){var t=n(i.element);i.element.css("margin-bottom",""),t>1&&i.element.css("margin-bottom",i.options.translate+parseInt(i.element.css("margin-bottom")))};return t.$(function(){e()}),t.Utils.debounce(e,50)}())},initItems:function(){var n=this.options.smooth;return this.items=(this.options.target?this.element.find(this.options.target):this.element.children()).each(function(){t.$(this).css({transition:"transform "+n+"ms linear",transform:""})}),this},process:function(){var e=i(this.element),o=n(this.element),r=this.items,s=[o-1];if(1==o||!e)return r.css("transform",""),void 0;for(;s.length<o&&s[s.length-1]-2;)s.push(s[s.length-1]-2);var a=this.options.translate,l=e*a;r.each(function(n,i,e){e=-1!=s.indexOf((n+1)%o)?l:l/8,t.$(this).css("transform","translate3d(0,"+e+"px, 0)")})}})});
|
@ -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-grid", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-grid', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -25,7 +25,8 @@
|
||||
duration : 300,
|
||||
gutter : 0,
|
||||
controls : false,
|
||||
filter : false
|
||||
filter : false,
|
||||
origin : UI.langdirection
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
@ -37,7 +38,7 @@
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if(!ele.data("grid")) {
|
||||
if(!ele.data('grid')) {
|
||||
UI.grid(ele, UI.Utils.options(ele.attr('data-uk-grid')));
|
||||
}
|
||||
});
|
||||
@ -55,6 +56,7 @@
|
||||
this.element.css({'position': 'relative'});
|
||||
|
||||
this.controls = null;
|
||||
this.origin = this.options.origin;
|
||||
|
||||
if (this.options.controls) {
|
||||
|
||||
@ -63,7 +65,7 @@
|
||||
// filter
|
||||
this.controls.on('click', '[data-uk-filter]', function(e){
|
||||
e.preventDefault();
|
||||
$this.filter(UI.$(this).data('ukFilter'));
|
||||
$this.filter(UI.$(this).attr('data-uk-filter'));
|
||||
});
|
||||
|
||||
// sort
|
||||
@ -79,23 +81,23 @@
|
||||
if ($this.currentfilter) {
|
||||
$this.filter($this.currentfilter);
|
||||
} else {
|
||||
this.updateLayout();
|
||||
this.update();
|
||||
}
|
||||
|
||||
}.bind(this), 100));
|
||||
|
||||
this.on('display.uk.check', function(){
|
||||
if ($this.element.is(":visible")) $this.updateLayout();
|
||||
if ($this.element.is(':visible')) $this.update();
|
||||
});
|
||||
|
||||
UI.$html.on("changed.uk.dom", function(e) {
|
||||
$this.updateLayout();
|
||||
UI.domObserve(this.element, function(e) {
|
||||
$this.update();
|
||||
});
|
||||
|
||||
if (this.options.filter !== false) {
|
||||
this.filter(this.options.filter);
|
||||
} else {
|
||||
this.updateLayout();
|
||||
this.update();
|
||||
}
|
||||
},
|
||||
|
||||
@ -109,23 +111,25 @@
|
||||
}
|
||||
|
||||
css = {
|
||||
'position' : 'absolute',
|
||||
'box-sizing' : 'border-box',
|
||||
'width' : this.options.colwidth == 'auto' ? '' : this.options.colwidth
|
||||
position : 'absolute',
|
||||
boxSizing : 'border-box',
|
||||
width : this.options.colwidth == 'auto' ? '' : this.options.colwidth
|
||||
};
|
||||
|
||||
if (this.options.gutter) {
|
||||
|
||||
css['padding-left'] = this.gutterh;
|
||||
css['padding-'+this.origin] = this.gutterh;
|
||||
css['padding-bottom'] = this.gutterv;
|
||||
|
||||
this.element.css('margin-left', this.gutterh * -1);
|
||||
this.element.css('margin-'+this.origin, this.gutterh * -1);
|
||||
}
|
||||
|
||||
children.attr('data-grid-prepared', 'true').css(css);
|
||||
},
|
||||
|
||||
updateLayout: function(elements) {
|
||||
update: function(elements) {
|
||||
|
||||
var $this = this;
|
||||
|
||||
this._prepareElements();
|
||||
|
||||
@ -137,7 +141,7 @@
|
||||
top = 0,
|
||||
positions = [],
|
||||
|
||||
item, width, height, pos, i, z, max, size;
|
||||
item, width, height, pos, posi, i, z, max, size;
|
||||
|
||||
this.trigger('beforeupdate.uk.grid', [children]);
|
||||
|
||||
@ -160,18 +164,21 @@
|
||||
if (top <= pos.aY) { top = pos.aY; }
|
||||
}
|
||||
|
||||
positions.push({
|
||||
"ele" : item,
|
||||
"top" : top,
|
||||
"left" : left,
|
||||
"width" : width,
|
||||
"height" : height,
|
||||
"aY" : (top + height),
|
||||
"aX" : (left + width)
|
||||
});
|
||||
posi = {
|
||||
ele : item,
|
||||
top : top,
|
||||
width : width,
|
||||
height : height,
|
||||
aY : (top + height),
|
||||
aX : (left + width)
|
||||
};
|
||||
|
||||
posi[$this.origin] = left;
|
||||
|
||||
positions.push(posi);
|
||||
});
|
||||
|
||||
var posPrev, maxHeight = 0;
|
||||
var posPrev, maxHeight = 0, positionto;
|
||||
|
||||
// fix top
|
||||
for (i=0,max=positions.length;i<max;i++) {
|
||||
@ -184,7 +191,7 @@
|
||||
posPrev = positions[z];
|
||||
|
||||
// (posPrev.left + 1) fixex 1px bug when using % based widths
|
||||
if (pos.left < posPrev.aX && (posPrev.left +1) < pos.aX) {
|
||||
if (pos[this.origin] < posPrev.aX && (posPrev[this.origin] +1) < pos.aX) {
|
||||
top = posPrev.aY;
|
||||
}
|
||||
}
|
||||
@ -202,7 +209,11 @@
|
||||
this.element.stop().animate({'height': maxHeight}, 100);
|
||||
|
||||
positions.forEach(function(pos){
|
||||
pos.ele.stop().animate({"top": pos.top, "left": pos.left, opacity: 1}, this.options.duration);
|
||||
|
||||
positionto = {"top": pos.top, opacity: 1};
|
||||
positionto[$this.origin] = pos[$this.origin];
|
||||
|
||||
pos.ele.stop().animate(positionto, this.options.duration);
|
||||
}.bind(this));
|
||||
|
||||
} else {
|
||||
@ -210,7 +221,9 @@
|
||||
this.element.css('height', maxHeight);
|
||||
|
||||
positions.forEach(function(pos){
|
||||
pos.ele.css({"top": pos.top, "left": pos.left, opacity: 1});
|
||||
positionto = {"top": pos.top, opacity: 1};
|
||||
positionto[$this.origin] = pos[$this.origin];
|
||||
pos.ele.css(positionto);
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
@ -261,7 +274,7 @@
|
||||
elements.hidden.attr('aria-hidden', 'true').filter(':visible').fadeOut(this.options.duration);
|
||||
elements.visible.attr('aria-hidden', 'false').filter(':hidden').css('opacity', 0).show();
|
||||
|
||||
$this.updateLayout(elements.visible);
|
||||
$this.update(elements.visible);
|
||||
|
||||
if (this.controls && this.controls.length) {
|
||||
this.controls.find('[data-uk-filter]').removeClass('uk-active').filter('[data-uk-filter="'+filter+'"]').addClass('uk-active');
|
||||
@ -288,7 +301,7 @@
|
||||
|
||||
}).appendTo(this.element);
|
||||
|
||||
this.updateLayout(elements.filter(':visible'));
|
||||
this.update(elements.filter(':visible'));
|
||||
|
||||
if (this.controls && this.controls.length) {
|
||||
this.controls.find('[data-uk-sort]').removeClass('uk-active').filter('[data-uk-sort="'+by+':'+(order == -1 ? 'desc':'asc')+'"]').addClass('uk-active');
|
||||
@ -303,7 +316,7 @@
|
||||
* MIT license
|
||||
* https://github.com/desandro/get-size
|
||||
*/
|
||||
var _getSize = (function(){
|
||||
function _getSize() {
|
||||
|
||||
var prefixes = 'Webkit Moz ms Ms O'.split(' ');
|
||||
var docElemStyle = document.documentElement.style;
|
||||
@ -519,9 +532,9 @@
|
||||
|
||||
return getSize;
|
||||
|
||||
})();
|
||||
}
|
||||
|
||||
function getElementSize(ele) {
|
||||
return _getSize(ele);
|
||||
return _getSize()(ele);
|
||||
}
|
||||
});
|
||||
|
4
media/uikit/js/components/grid.min.js
vendored
4
media/uikit/js/components/grid.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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-htmleditor", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-htmleditor', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
mode : 'split',
|
||||
markdown : false,
|
||||
autocomplete : true,
|
||||
enablescripts: false,
|
||||
height : 500,
|
||||
maxsplitsize : 1000,
|
||||
codemirror : { mode: 'htmlmixed', lineWrapping: true, dragDrop: false, autoCloseTags: true, matchTags: true, autoCloseBrackets: true, matchBrackets: true, indentUnit: 4, indentWithTabs: false, tabSize: 4, hintOptions: {completionSingle:false} },
|
||||
@ -206,9 +207,9 @@
|
||||
}
|
||||
};
|
||||
|
||||
var result = callback(match, index);
|
||||
var result = typeof(callback) === 'string' ? callback : callback(match, index);
|
||||
|
||||
if (!result) {
|
||||
if (!result && result !== '') {
|
||||
return arguments[0];
|
||||
}
|
||||
|
||||
@ -290,6 +291,10 @@
|
||||
|
||||
this.currentvalue = this.editor.getValue();
|
||||
|
||||
if (!this.options.enablescripts) {
|
||||
this.currentvalue = this.currentvalue.replace(/<(script|style)\b[^<]*(?:(?!<\/(script|style)>)<[^<]*)*<\/(script|style)>/img, '');
|
||||
}
|
||||
|
||||
// empty code
|
||||
if (!this.currentvalue) {
|
||||
|
||||
@ -443,37 +448,82 @@
|
||||
addAction('link', '<a href="http://">$1</a>');
|
||||
addAction('image', '<img src="http://" alt="$1">');
|
||||
|
||||
var listfn = function() {
|
||||
var listfn = function(tag) {
|
||||
if (editor.getCursorMode() == 'html') {
|
||||
|
||||
var cm = editor.editor,
|
||||
pos = cm.getDoc().getCursor(true),
|
||||
posend = cm.getDoc().getCursor(false);
|
||||
tag = tag || 'ul';
|
||||
|
||||
var cm = editor.editor,
|
||||
doc = cm.getDoc(),
|
||||
pos = doc.getCursor(true),
|
||||
posend = doc.getCursor(false),
|
||||
im = CodeMirror.innerMode(cm.getMode(), cm.getTokenAt(cm.getCursor()).state),
|
||||
inList = im && im.state && im.state.context && ['ul','ol'].indexOf(im.state.context.tagName) != -1;
|
||||
|
||||
for (var i=pos.line; i<(posend.line+1);i++) {
|
||||
cm.replaceRange('<li>'+cm.getLine(i)+'</li>', { line: i, ch: 0 }, { line: i, ch: cm.getLine(i).length });
|
||||
}
|
||||
|
||||
cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length });
|
||||
if (!inList) {
|
||||
cm.replaceRange('<'+tag+'>'+"\n"+cm.getLine(pos.line), { line: pos.line, ch: 0 }, { line: pos.line, ch: cm.getLine(pos.line).length });
|
||||
cm.replaceRange(cm.getLine((posend.line+1))+"\n"+'</'+tag+'>', { line: (posend.line+1), ch: 0 }, { line: (posend.line+1), ch: cm.getLine((posend.line+1)).length });
|
||||
cm.setCursor({ line: posend.line+1, ch: cm.getLine(posend.line+1).length });
|
||||
} else {
|
||||
cm.setCursor({ line: posend.line, ch: cm.getLine(posend.line).length });
|
||||
}
|
||||
|
||||
cm.focus();
|
||||
}
|
||||
};
|
||||
|
||||
editor.on('action.listUl', function() {
|
||||
listfn();
|
||||
listfn('ul');
|
||||
});
|
||||
|
||||
editor.on('action.listOl', function() {
|
||||
listfn();
|
||||
listfn('ol');
|
||||
});
|
||||
|
||||
editor.htmleditor.on('click', 'a[data-htmleditor-button="fullscreen"]', function() {
|
||||
|
||||
editor.htmleditor.toggleClass('uk-htmleditor-fullscreen');
|
||||
|
||||
var wrap = editor.editor.getWrapperElement();
|
||||
|
||||
if (editor.htmleditor.hasClass('uk-htmleditor-fullscreen')) {
|
||||
|
||||
var fixedParent = false, parents = editor.htmleditor.parents().each(function(){
|
||||
if (UI.$(this).css('position')=='fixed' && !UI.$(this).is('html')) {
|
||||
fixedParent = UI.$(this);
|
||||
}
|
||||
});
|
||||
|
||||
editor.htmleditor.data('fixedParents', false);
|
||||
|
||||
if (fixedParent) {
|
||||
|
||||
var transformed = [];
|
||||
|
||||
fixedParent = fixedParent.parent().find(parents).each(function(){
|
||||
|
||||
if (UI.$(this).css('transform') != 'none') {
|
||||
transformed.push(UI.$(this).data('transform-reset', {
|
||||
'transform': this.style.transform,
|
||||
'-webkit-transform': this.style.webkitTransform,
|
||||
'-webkit-transition':this.style.webkitTransition,
|
||||
'transition':this.style.transition
|
||||
}).css({
|
||||
'transform': 'none',
|
||||
'-webkit-transform': 'none',
|
||||
'-webkit-transition':'none',
|
||||
'transition':'none'
|
||||
}));
|
||||
}
|
||||
});
|
||||
|
||||
editor.htmleditor.data('fixedParents', transformed);
|
||||
}
|
||||
|
||||
editor.editor.state.fullScreenRestore = {scrollTop: window.pageYOffset, scrollLeft: window.pageXOffset, width: wrap.style.width, height: wrap.style.height};
|
||||
wrap.style.width = '';
|
||||
wrap.style.height = editor.content.height()+'px';
|
||||
@ -485,6 +535,12 @@
|
||||
var info = editor.editor.state.fullScreenRestore;
|
||||
wrap.style.width = info.width; wrap.style.height = info.height;
|
||||
window.scrollTo(info.scrollLeft, info.scrollTop);
|
||||
|
||||
if (editor.htmleditor.data('fixedParents')) {
|
||||
editor.htmleditor.data('fixedParents').forEach(function(parent){
|
||||
parent.css(parent.data('transform-reset'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
@ -510,7 +566,7 @@
|
||||
|
||||
init: function(editor) {
|
||||
|
||||
var parser = editor.options.mdparser || marked || null;
|
||||
var parser = editor.options.mdparser || window.marked || null;
|
||||
|
||||
if (!parser) return;
|
||||
|
||||
|
4
media/uikit/js/components/htmleditor.min.js
vendored
4
media/uikit/js/components/htmleditor.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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) { // AMD
|
||||
define("uikit-lightbox", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) { // AMD
|
||||
define('uikit-lightbox', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -22,9 +22,10 @@
|
||||
UI.component('lightbox', {
|
||||
|
||||
defaults: {
|
||||
"group" : false,
|
||||
"duration" : 400,
|
||||
"keyboard" : true
|
||||
allowfullscreen : true,
|
||||
duration : 400,
|
||||
group : false,
|
||||
keyboard : true
|
||||
},
|
||||
|
||||
index : 0,
|
||||
@ -38,12 +39,12 @@
|
||||
|
||||
var link = UI.$(this);
|
||||
|
||||
if (!link.data("lightbox")) {
|
||||
if (!link.data('lightbox')) {
|
||||
|
||||
UI.lightbox(link, UI.Utils.options(link.attr("data-uk-lightbox")));
|
||||
UI.lightbox(link, UI.Utils.options(link.attr('data-uk-lightbox')));
|
||||
}
|
||||
|
||||
link.data("lightbox").show(link);
|
||||
link.data('lightbox').show(link);
|
||||
});
|
||||
|
||||
// keyboard navigation
|
||||
@ -74,20 +75,17 @@
|
||||
|
||||
if (this.element && this.element.length) {
|
||||
|
||||
var domSiblings = this.options.group ? UI.$([
|
||||
'[data-uk-lightbox*="'+this.options.group+'"]',
|
||||
"[data-uk-lightbox*='"+this.options.group+"']"
|
||||
].join(',')) : this.element;
|
||||
var domSiblings = this.options.group ? UI.$('[data-uk-lightbox*="'+this.options.group+'"]') : this.element;
|
||||
|
||||
domSiblings.each(function() {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
siblings.push({
|
||||
'source': ele.attr('href'),
|
||||
'title' : ele.attr('data-title') || ele.attr('title'),
|
||||
'type' : ele.attr("data-lightbox-type") || 'auto',
|
||||
'link' : ele
|
||||
source : ele.attr('href'),
|
||||
title : ele.attr('data-title') || ele.attr('title'),
|
||||
type : ele.attr("data-lightbox-type") || 'auto',
|
||||
link : ele
|
||||
});
|
||||
});
|
||||
|
||||
@ -134,17 +132,17 @@
|
||||
item = this.siblings[index];
|
||||
|
||||
data = {
|
||||
"lightbox" : $this,
|
||||
"source" : item.source,
|
||||
"type" : item.type,
|
||||
"index" : index,
|
||||
"promise" : promise,
|
||||
"title" : item.title,
|
||||
"item" : item,
|
||||
"meta" : {
|
||||
"content" : '',
|
||||
"width" : null,
|
||||
"height" : null
|
||||
lightbox : $this,
|
||||
source : item.source,
|
||||
type : item.type,
|
||||
index : index,
|
||||
promise : promise,
|
||||
title : item.title,
|
||||
item : item,
|
||||
meta : {
|
||||
content : '',
|
||||
width : null,
|
||||
height : null
|
||||
}
|
||||
};
|
||||
|
||||
@ -199,14 +197,14 @@
|
||||
|
||||
// calculate width
|
||||
var tmp = UI.$('<div> </div>').css({
|
||||
'opacity' : 0,
|
||||
'position' : 'absolute',
|
||||
'top' : 0,
|
||||
'left' : 0,
|
||||
'width' : '100%',
|
||||
'max-width' : $this.modal.dialog.css('max-width'),
|
||||
'padding' : $this.modal.dialog.css('padding'),
|
||||
'margin' : $this.modal.dialog.css('margin')
|
||||
opacity : 0,
|
||||
position : 'absolute',
|
||||
top : 0,
|
||||
left : 0,
|
||||
width : '100%',
|
||||
maxWidth : $this.modal.dialog.css('max-width'),
|
||||
padding : $this.modal.dialog.css('padding'),
|
||||
margin : $this.modal.dialog.css('margin')
|
||||
}), maxwidth, maxheight, w = data.meta.width, h = data.meta.height;
|
||||
|
||||
tmp.appendTo('body').width();
|
||||
@ -254,11 +252,11 @@
|
||||
|
||||
this.modal.dialog.animate({width: w + pad, height: h + pad, top: t }, duration, 'swing', function() {
|
||||
$this.modal.loader.addClass('uk-hidden');
|
||||
$this.modal.content.css({width:''}).animate({'opacity': 1}, function() {
|
||||
$this.modal.content.css({width:''}).animate({opacity: 1}, function() {
|
||||
$this.modal.closer.removeClass('uk-hidden');
|
||||
});
|
||||
|
||||
$this.modal.data({'mwidth': w, 'mheight': h});
|
||||
$this.modal.data({mwidth: w, mheight: h});
|
||||
});
|
||||
},
|
||||
|
||||
@ -278,16 +276,16 @@
|
||||
|
||||
init: function(lightbox) {
|
||||
|
||||
lightbox.on("showitem.uk.lightbox", function(e, data){
|
||||
lightbox.on('showitem.uk.lightbox', function(e, data){
|
||||
|
||||
if (data.type == 'image' || data.source && data.source.match(/\.(jpg|jpeg|png|gif|svg)$/i)) {
|
||||
|
||||
var resolve = function(source, width, height) {
|
||||
|
||||
data.meta = {
|
||||
"content" : '<img class="uk-responsive-width" width="'+width+'" height="'+height+'" src ="'+source+'">',
|
||||
"width" : width,
|
||||
"height" : height
|
||||
content : '<img class="uk-responsive-width" width="'+width+'" height="'+height+'" src ="'+source+'">',
|
||||
width : width,
|
||||
height : height
|
||||
};
|
||||
|
||||
data.type = 'image';
|
||||
@ -318,7 +316,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
UI.plugin("lightbox", "youtube", {
|
||||
UI.plugin('lightbox', 'youtube', {
|
||||
|
||||
init: function(lightbox) {
|
||||
|
||||
@ -326,14 +324,14 @@
|
||||
youtubeRegExpShort = /youtu\.be\/(.*)/;
|
||||
|
||||
|
||||
lightbox.on("showitem.uk.lightbox", function(e, data){
|
||||
lightbox.on('showitem.uk.lightbox', function(e, data){
|
||||
|
||||
var id, matches, resolve = function(id, width, height) {
|
||||
|
||||
data.meta = {
|
||||
'content': '<iframe src="//www.youtube.com/embed/'+id+'" width="'+width+'" height="'+height+'" style="max-width:100%;"></iframe>',
|
||||
'width': width,
|
||||
'height': height
|
||||
content: '<iframe src="//www.youtube.com/embed/'+id+'" width="'+width+'" height="'+height+'" style="max-width:100%;"'+(modal.lightbox.options.allowfullscreen?' allowfullscreen':'')+'></iframe>',
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
|
||||
data.type = 'iframe';
|
||||
@ -389,21 +387,21 @@
|
||||
});
|
||||
|
||||
|
||||
UI.plugin("lightbox", "vimeo", {
|
||||
UI.plugin('lightbox', 'vimeo', {
|
||||
|
||||
init: function(lightbox) {
|
||||
|
||||
var regex = /(\/\/.*?)vimeo\.[a-z]+\/([0-9]+).*?/, matches;
|
||||
|
||||
|
||||
lightbox.on("showitem.uk.lightbox", function(e, data){
|
||||
lightbox.on('showitem.uk.lightbox', function(e, data){
|
||||
|
||||
var id, resolve = function(id, width, height) {
|
||||
|
||||
data.meta = {
|
||||
'content': '<iframe src="//player.vimeo.com/video/'+id+'" width="'+width+'" height="'+height+'" style="width:100%;box-sizing:border-box;"></iframe>',
|
||||
'width': width,
|
||||
'height': height
|
||||
content: '<iframe src="//player.vimeo.com/video/'+id+'" width="'+width+'" height="'+height+'" style="width:100%;box-sizing:border-box;"'+(modal.lightbox.options.allowfullscreen?' allowfullscreen':'')+'></iframe>',
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
|
||||
data.type = 'iframe';
|
||||
@ -419,7 +417,7 @@
|
||||
|
||||
UI.$.ajax({
|
||||
type : 'GET',
|
||||
url : 'http://vimeo.com/api/oembed.json?url=' + encodeURI(data.source),
|
||||
url : '//vimeo.com/api/oembed.json?url=' + encodeURI(data.source),
|
||||
jsonp : 'callback',
|
||||
dataType : 'jsonp',
|
||||
success : function(data) {
|
||||
@ -438,19 +436,19 @@
|
||||
}
|
||||
});
|
||||
|
||||
UI.plugin("lightbox", "video", {
|
||||
UI.plugin('lightbox', 'video', {
|
||||
|
||||
init: function(lightbox) {
|
||||
|
||||
lightbox.on("showitem.uk.lightbox", function(e, data){
|
||||
lightbox.on('showitem.uk.lightbox', function(e, data){
|
||||
|
||||
|
||||
var resolve = function(source, width, height) {
|
||||
|
||||
data.meta = {
|
||||
'content': '<video class="uk-responsive-width" src="'+source+'" width="'+width+'" height="'+height+'" controls></video>',
|
||||
'width': width,
|
||||
'height': height
|
||||
content: '<video class="uk-responsive-width" src="'+source+'" width="'+width+'" height="'+height+'" controls></video>',
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
|
||||
data.type = 'video';
|
||||
@ -484,6 +482,33 @@
|
||||
});
|
||||
|
||||
|
||||
UI.plugin('lightbox', 'iframe', {
|
||||
|
||||
init: function (lightbox) {
|
||||
|
||||
lightbox.on('showitem.uk.lightbox', function (e, data) {
|
||||
|
||||
var resolve = function (source, width, height) {
|
||||
|
||||
data.meta = {
|
||||
content: '<iframe class="uk-responsive-width" src="' + source + '" width="' + width + '" height="' + height + '"'+(modal.lightbox.options.allowfullscreen?' allowfullscreen':'')+'></iframe>',
|
||||
width: width,
|
||||
height: height
|
||||
};
|
||||
|
||||
data.type = 'iframe';
|
||||
|
||||
data.promise.resolve();
|
||||
};
|
||||
|
||||
if (data.type === 'iframe' || data.source.match(/\.(html|php)$/)) {
|
||||
resolve(data.source, (lightbox.options.width || 800), (lightbox.options.height || 600));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
function getModal(lightbox) {
|
||||
|
||||
if (modal) {
|
||||
@ -509,21 +534,29 @@
|
||||
modal.modal = UI.modal(modal, {modal:false});
|
||||
|
||||
// next / previous
|
||||
modal.on("swipeRight swipeLeft", function(e) {
|
||||
modal.on('swipeRight swipeLeft', function(e) {
|
||||
modal.lightbox[e.type=='swipeLeft' ? 'next':'previous']();
|
||||
}).on("click", "[data-lightbox-previous], [data-lightbox-next]", function(e){
|
||||
}).on('click', '[data-lightbox-previous], [data-lightbox-next]', function(e){
|
||||
e.preventDefault();
|
||||
modal.lightbox[UI.$(this).is('[data-lightbox-next]') ? 'next':'previous']();
|
||||
});
|
||||
|
||||
// destroy content on modal hide
|
||||
modal.on("hide.uk.modal", function(e) {
|
||||
modal.on('hide.uk.modal', function(e) {
|
||||
modal.content.html('');
|
||||
});
|
||||
|
||||
var resizeCache = {w: window.innerWidth, h:window.innerHeight};
|
||||
|
||||
UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(e){
|
||||
if (modal.is(':visible') && !UI.Utils.isFullscreen()) modal.lightbox.fitSize();
|
||||
}.bind(this), 100));
|
||||
|
||||
if (resizeCache.w !== window.innerWidth && modal.is(':visible') && !UI.Utils.isFullscreen()) {
|
||||
modal.lightbox.fitSize();
|
||||
}
|
||||
|
||||
resizeCache = {w: window.innerWidth, h:window.innerHeight};
|
||||
|
||||
}, 100));
|
||||
|
||||
modal.lightbox = lightbox;
|
||||
|
||||
@ -539,10 +572,10 @@
|
||||
items.forEach(function(item) {
|
||||
|
||||
group.push(UI.$.extend({
|
||||
'source' : '',
|
||||
'title' : '',
|
||||
'type' : 'auto',
|
||||
'link' : false
|
||||
source : '',
|
||||
title : '',
|
||||
type : 'auto',
|
||||
link : false
|
||||
}, (typeof(item) == 'string' ? {'source': item} : item)));
|
||||
});
|
||||
|
||||
|
4
media/uikit/js/components/lightbox.min.js
vendored
4
media/uikit/js/components/lightbox.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! 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 */
|
||||
/*
|
||||
* Based on Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/
|
||||
*/
|
||||
@ -6,13 +6,13 @@
|
||||
|
||||
var component;
|
||||
|
||||
if (window.UIkit) {
|
||||
component = addon(UIkit);
|
||||
if (window.UIkit2) {
|
||||
component = addon(UIkit2);
|
||||
}
|
||||
|
||||
if (typeof define == "function" && define.amd) {
|
||||
define("uikit-nestable", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-nestable', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -130,7 +130,8 @@
|
||||
|
||||
var onStartEvent = function(e) {
|
||||
|
||||
var handle = UI.$(e.target);
|
||||
var handle = UI.$(e.target),
|
||||
link = handle.is('a[href]') ? handle:handle.parents('a[href]');
|
||||
|
||||
if (e.target === $this.element[0]) {
|
||||
return;
|
||||
@ -161,6 +162,8 @@
|
||||
|
||||
$this.delayMove = function(evt) {
|
||||
|
||||
link = false;
|
||||
|
||||
evt.preventDefault();
|
||||
$this.dragStart(e);
|
||||
$this.trigger('start.uk.nestable', [$this]);
|
||||
@ -172,6 +175,15 @@
|
||||
$this.delayMove.y = parseInt(e.pageY, 10);
|
||||
$this.delayMove.threshold = $this.options.idlethreshold;
|
||||
|
||||
if (link.length && eEnd == 'touchend') {
|
||||
|
||||
$this.one(eEnd, function(){
|
||||
if (link && link.attr('href').trim()) {
|
||||
location.href = link.attr('href');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
};
|
||||
|
||||
@ -236,10 +248,12 @@
|
||||
item = {}, attribute,
|
||||
sub = li.children(list.options._listClass);
|
||||
|
||||
for (var i = 0; i < li[0].attributes.length; i++) {
|
||||
for (var i = 0, attr, val; i < li[0].attributes.length; i++) {
|
||||
attribute = li[0].attributes[i];
|
||||
if (attribute.name.indexOf('data-') === 0) {
|
||||
item[attribute.name.substr(5)] = UI.Utils.str2json(attribute.value);
|
||||
attr = attribute.name.substr(5);
|
||||
val = UI.Utils.str2json(attribute.value);
|
||||
item[attr] = (val || attribute.value=='false' || attribute.value=='0') ? val:attribute.value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -323,7 +337,7 @@
|
||||
},
|
||||
|
||||
toggleItem: function(li) {
|
||||
this[li.hasClass(this.options.collapsedClass) ? "expandItem":"collapseItem"](li);
|
||||
this[li.hasClass(this.options.collapsedClass) ? 'expandItem':'collapseItem'](li);
|
||||
},
|
||||
|
||||
expandItem: function(li) {
|
||||
@ -354,7 +368,7 @@
|
||||
setParent: function(li) {
|
||||
|
||||
if (li.children(this.options._listClass).length) {
|
||||
li.addClass("uk-parent");
|
||||
li.addClass('uk-parent');
|
||||
}
|
||||
},
|
||||
|
||||
@ -610,7 +624,7 @@
|
||||
}
|
||||
|
||||
if (!parent.children().length) {
|
||||
if (!parent.data("nestable")) this.unsetParent(parent.parent());
|
||||
if (!parent.data('nestable')) this.unsetParent(parent.parent());
|
||||
}
|
||||
|
||||
this.checkEmptyList(this.dragRootEl);
|
||||
|
4
media/uikit/js/components/nestable.min.js
vendored
4
media/uikit/js/components/nestable.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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-notify", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-notify', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
this.options = UI.$.extend({}, Message.defaults, options);
|
||||
|
||||
this.uuid = UI.Utils.uid("notifymsg");
|
||||
this.uuid = UI.Utils.uid('notifymsg');
|
||||
this.element = UI.$([
|
||||
|
||||
'<div class="uk-notify-message">',
|
||||
@ -72,7 +72,7 @@
|
||||
if(!containers[this.options.pos]) {
|
||||
containers[this.options.pos] = UI.$('<div class="uk-notify uk-notify-'+this.options.pos+'"></div>').appendTo('body').on("click", ".uk-notify-message", function(){
|
||||
|
||||
var message = UI.$(this).data("notifyMessage");
|
||||
var message = UI.$(this).data('notifyMessage');
|
||||
|
||||
message.element.trigger('manualclose.uk.notify', [message]);
|
||||
message.close();
|
||||
@ -91,15 +91,15 @@
|
||||
|
||||
show: function() {
|
||||
|
||||
if (this.element.is(":visible")) return;
|
||||
if (this.element.is(':visible')) return;
|
||||
|
||||
var $this = this;
|
||||
|
||||
containers[this.options.pos].show().prepend(this.element);
|
||||
|
||||
var marginbottom = parseInt(this.element.css("margin-bottom"), 10);
|
||||
var marginbottom = parseInt(this.element.css('margin-bottom'), 10);
|
||||
|
||||
this.element.css({"opacity":0, "margin-top": -1*this.element.outerHeight(), "margin-bottom":0}).animate({"opacity":1, "margin-top": 0, "margin-bottom":marginbottom}, function(){
|
||||
this.element.css({opacity:0, marginTop: -1*this.element.outerHeight(), marginBottom:0}).animate({opacity:1, marginTop:0, marginBottom:marginbottom}, function(){
|
||||
|
||||
if ($this.options.timeout) {
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
if (instantly) {
|
||||
finalize();
|
||||
} else {
|
||||
this.element.animate({"opacity":0, "margin-top": -1* this.element.outerHeight(), "margin-bottom":0}, function(){
|
||||
this.element.animate({opacity:0, marginTop: -1* this.element.outerHeight(), marginBottom:0}, function(){
|
||||
finalize();
|
||||
});
|
||||
}
|
||||
|
4
media/uikit/js/components/notify.min.js
vendored
4
media/uikit/js/components/notify.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-notify",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";var e={},i={},s=function(e){return"string"==t.$.type(e)&&(e={message:e}),arguments[1]&&(e=t.$.extend(e,"string"==t.$.type(arguments[1])?{status:arguments[1]}:arguments[1])),new n(e).show()},o=function(t,e){var s;if(t)for(s in i)t===i[s].group&&i[s].close(e);else for(s in i)i[s].close(e)},n=function(s){this.options=t.$.extend({},n.defaults,s),this.uuid=t.Utils.uid("notifymsg"),this.element=t.$(['<div class="uk-notify-message">','<a class="uk-close"></a>',"<div></div>","</div>"].join("")).data("notifyMessage",this),this.content(this.options.message),this.options.status&&(this.element.addClass("uk-notify-message-"+this.options.status),this.currentstatus=this.options.status),this.group=this.options.group,i[this.uuid]=this,e[this.options.pos]||(e[this.options.pos]=t.$('<div class="uk-notify uk-notify-'+this.options.pos+'"></div>').appendTo("body").on("click",".uk-notify-message",function(){var e=t.$(this).data("notifyMessage");e.element.trigger("manualclose.uk.notify",[e]),e.close()}))};return t.$.extend(n.prototype,{uuid:!1,element:!1,timout:!1,currentstatus:"",group:!1,show:function(){if(!this.element.is(":visible")){var t=this;e[this.options.pos].show().prepend(this.element);var i=parseInt(this.element.css("margin-bottom"),10);return this.element.css({opacity:0,"margin-top":-1*this.element.outerHeight(),"margin-bottom":0}).animate({opacity:1,"margin-top":0,"margin-bottom":i},function(){if(t.options.timeout){var e=function(){t.close()};t.timeout=setTimeout(e,t.options.timeout),t.element.hover(function(){clearTimeout(t.timeout)},function(){t.timeout=setTimeout(e,t.options.timeout)})}}),this}},close:function(t){var s=this,o=function(){s.element.remove(),e[s.options.pos].children().length||e[s.options.pos].hide(),s.options.onClose.apply(s,[]),s.element.trigger("close.uk.notify",[s]),delete i[s.uuid]};this.timeout&&clearTimeout(this.timeout),t?o():this.element.animate({opacity:0,"margin-top":-1*this.element.outerHeight(),"margin-bottom":0},function(){o()})},content:function(t){var e=this.element.find(">div");return t?(e.html(t),this):e.html()},status:function(t){return t?(this.element.removeClass("uk-notify-message-"+this.currentstatus).addClass("uk-notify-message-"+t),this.currentstatus=t,this):this.currentstatus}}),n.defaults={message:"",status:"",timeout:5e3,group:null,pos:"top-center",onClose:function(){}},t.notify=s,t.notify.message=n,t.notify.closeAll=o,s});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit2&&(e=t(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-notify",["uikit"],function(){return e||t(UIkit2)})}(function(t){"use strict";var e={},i={},s=function(e){return"string"==t.$.type(e)&&(e={message:e}),arguments[1]&&(e=t.$.extend(e,"string"==t.$.type(arguments[1])?{status:arguments[1]}:arguments[1])),new n(e).show()},o=function(t,e){var s;if(t)for(s in i)t===i[s].group&&i[s].close(e);else for(s in i)i[s].close(e)},n=function(s){this.options=t.$.extend({},n.defaults,s),this.uuid=t.Utils.uid("notifymsg"),this.element=t.$(['<div class="uk-notify-message">','<a class="uk-close"></a>',"<div></div>","</div>"].join("")).data("notifyMessage",this),this.content(this.options.message),this.options.status&&(this.element.addClass("uk-notify-message-"+this.options.status),this.currentstatus=this.options.status),this.group=this.options.group,i[this.uuid]=this,e[this.options.pos]||(e[this.options.pos]=t.$('<div class="uk-notify uk-notify-'+this.options.pos+'"></div>').appendTo("body").on("click",".uk-notify-message",function(){var e=t.$(this).data("notifyMessage");e.element.trigger("manualclose.uk.notify",[e]),e.close()}))};return t.$.extend(n.prototype,{uuid:!1,element:!1,timout:!1,currentstatus:"",group:!1,show:function(){if(!this.element.is(":visible")){var t=this;e[this.options.pos].show().prepend(this.element);var i=parseInt(this.element.css("margin-bottom"),10);return this.element.css({opacity:0,marginTop:-1*this.element.outerHeight(),marginBottom:0}).animate({opacity:1,marginTop:0,marginBottom:i},function(){if(t.options.timeout){var e=function(){t.close()};t.timeout=setTimeout(e,t.options.timeout),t.element.hover(function(){clearTimeout(t.timeout)},function(){t.timeout=setTimeout(e,t.options.timeout)})}}),this}},close:function(t){var s=this,o=function(){s.element.remove(),e[s.options.pos].children().length||e[s.options.pos].hide(),s.options.onClose.apply(s,[]),s.element.trigger("close.uk.notify",[s]),delete i[s.uuid]};this.timeout&&clearTimeout(this.timeout),t?o():this.element.animate({opacity:0,marginTop:-1*this.element.outerHeight(),marginBottom:0},function(){o()})},content:function(t){var e=this.element.find(">div");return t?(e.html(t),this):e.html()},status:function(t){return t?(this.element.removeClass("uk-notify-message-"+this.currentstatus).addClass("uk-notify-message-"+t),this.currentstatus=t,this):this.currentstatus}}),n.defaults={message:"",status:"",timeout:5e3,group:null,pos:"top-center",onClose:function(){}},t.notify=s,t.notify.message=n,t.notify.closeAll=o,s});
|
@ -1,4 +1,4 @@
|
||||
/*! 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 */
|
||||
/*
|
||||
* Based on simplePagination - Copyright (c) 2012 Flavius Matis - http://flaviusmatis.github.com/simplePagination.js/ (MIT)
|
||||
*/
|
||||
@ -6,13 +6,13 @@
|
||||
|
||||
var component;
|
||||
|
||||
if (window.UIkit) {
|
||||
component = addon(UIkit);
|
||||
if (window.UIkit2) {
|
||||
component = addon(UIkit2);
|
||||
}
|
||||
|
||||
if (typeof define == "function" && define.amd) {
|
||||
define("uikit-pagination", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-pagination', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -39,11 +39,11 @@
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-pagination]", context).each(function(){
|
||||
UI.$('[data-uk-pagination]', context).each(function(){
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("pagination")) {
|
||||
UI.pagination(ele, UI.Utils.options(ele.attr("data-uk-pagination")));
|
||||
if (!ele.data('pagination')) {
|
||||
UI.pagination(ele, UI.Utils.options(ele.attr('data-uk-pagination')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -57,9 +57,9 @@
|
||||
this.currentPage = this.options.currentPage;
|
||||
this.halfDisplayed = this.options.displayedPages / 2;
|
||||
|
||||
this.on("click", "a[data-page]", function(e){
|
||||
this.on('click', 'a[data-page]', function(e){
|
||||
e.preventDefault();
|
||||
$this.selectPage(UI.$(this).data("page"));
|
||||
$this.selectPage(UI.$(this).data('page'));
|
||||
});
|
||||
|
||||
this._render();
|
||||
|
4
media/uikit/js/components/pagination.min.js
vendored
4
media/uikit/js/components/pagination.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-pagination",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";return t.component("pagination",{defaults:{items:1,itemsOnPage:1,pages:0,displayedPages:7,edges:1,currentPage:0,lblPrev:!1,lblNext:!1,onSelectPage:function(){}},boot:function(){t.ready(function(e){t.$("[data-uk-pagination]",e).each(function(){var e=t.$(this);e.data("pagination")||t.pagination(e,t.Utils.options(e.attr("data-uk-pagination")))})})},init:function(){var e=this;this.pages=this.options.pages?this.options.pages:Math.ceil(this.options.items/this.options.itemsOnPage)?Math.ceil(this.options.items/this.options.itemsOnPage):1,this.currentPage=this.options.currentPage,this.halfDisplayed=this.options.displayedPages/2,this.on("click","a[data-page]",function(i){i.preventDefault(),e.selectPage(t.$(this).data("page"))}),this._render()},_getInterval:function(){return{start:Math.ceil(this.currentPage>this.halfDisplayed?Math.max(Math.min(this.currentPage-this.halfDisplayed,this.pages-this.options.displayedPages),0):0),end:Math.ceil(this.currentPage>this.halfDisplayed?Math.min(this.currentPage+this.halfDisplayed,this.pages):Math.min(this.options.displayedPages,this.pages))}},render:function(t){this.pages=t?t:this.pages,this._render()},selectPage:function(t,e){this.currentPage=t,this.render(e),this.options.onSelectPage.apply(this,[t]),this.trigger("select.uk.pagination",[t,this])},_render:function(){var t,e=this.options,i=this._getInterval();if(this.element.empty(),e.lblPrev&&this._append(this.currentPage-1,{text:e.lblPrev}),i.start>0&&e.edges>0){var s=Math.min(e.edges,i.start);for(t=0;s>t;t++)this._append(t);e.edges<i.start&&i.start-e.edges!=1?this.element.append("<li><span>...</span></li>"):i.start-e.edges==1&&this._append(e.edges)}for(t=i.start;t<i.end;t++)this._append(t);if(i.end<this.pages&&e.edges>0){this.pages-e.edges>i.end&&this.pages-e.edges-i.end!=1?this.element.append("<li><span>...</span></li>"):this.pages-e.edges-i.end==1&&this._append(i.end++);var a=Math.max(this.pages-e.edges,i.end);for(t=a;t<this.pages;t++)this._append(t)}e.lblNext&&this._append(this.currentPage+1,{text:e.lblNext})},_append:function(e,i){var s,a;e=0>e?0:e<this.pages?e:this.pages-1,a=t.$.extend({text:e+1},i),s=e==this.currentPage?'<li class="uk-active"><span>'+a.text+"</span></li>":'<li><a href="#page-'+(e+1)+'" data-page="'+e+'">'+a.text+"</a></li>",this.element.append(s)}}),t.pagination});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit2&&(e=t(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-pagination",["uikit"],function(){return e||t(UIkit2)})}(function(t){"use strict";return t.component("pagination",{defaults:{items:1,itemsOnPage:1,pages:0,displayedPages:7,edges:1,currentPage:0,lblPrev:!1,lblNext:!1,onSelectPage:function(){}},boot:function(){t.ready(function(e){t.$("[data-uk-pagination]",e).each(function(){var e=t.$(this);e.data("pagination")||t.pagination(e,t.Utils.options(e.attr("data-uk-pagination")))})})},init:function(){var e=this;this.pages=this.options.pages?this.options.pages:Math.ceil(this.options.items/this.options.itemsOnPage)?Math.ceil(this.options.items/this.options.itemsOnPage):1,this.currentPage=this.options.currentPage,this.halfDisplayed=this.options.displayedPages/2,this.on("click","a[data-page]",function(i){i.preventDefault(),e.selectPage(t.$(this).data("page"))}),this._render()},_getInterval:function(){return{start:Math.ceil(this.currentPage>this.halfDisplayed?Math.max(Math.min(this.currentPage-this.halfDisplayed,this.pages-this.options.displayedPages),0):0),end:Math.ceil(this.currentPage>this.halfDisplayed?Math.min(this.currentPage+this.halfDisplayed,this.pages):Math.min(this.options.displayedPages,this.pages))}},render:function(t){this.pages=t?t:this.pages,this._render()},selectPage:function(t,e){this.currentPage=t,this.render(e),this.options.onSelectPage.apply(this,[t]),this.trigger("select.uk.pagination",[t,this])},_render:function(){var t,e=this.options,i=this._getInterval();if(this.element.empty(),e.lblPrev&&this._append(this.currentPage-1,{text:e.lblPrev}),i.start>0&&e.edges>0){var s=Math.min(e.edges,i.start);for(t=0;s>t;t++)this._append(t);e.edges<i.start&&i.start-e.edges!=1?this.element.append("<li><span>...</span></li>"):i.start-e.edges==1&&this._append(e.edges)}for(t=i.start;t<i.end;t++)this._append(t);if(i.end<this.pages&&e.edges>0){this.pages-e.edges>i.end&&this.pages-e.edges-i.end!=1?this.element.append("<li><span>...</span></li>"):this.pages-e.edges-i.end==1&&this._append(i.end++);var a=Math.max(this.pages-e.edges,i.end);for(t=a;t<this.pages;t++)this._append(t)}e.lblNext&&this._append(this.currentPage+1,{text:e.lblNext})},_append:function(e,i){var s,a;e=0>e?0:e<this.pages?e:this.pages-1,a=t.$.extend({text:e+1},i),s=e==this.currentPage?'<li class="uk-active"><span>'+a.text+"</span></li>":'<li><a href="#page-'+(e+1)+'" data-page="'+e+'">'+a.text+"</a></li>",this.element.append(s)}}),t.pagination});
|
@ -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-parallax", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-parallax', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@
|
||||
|
||||
for (var t in transforms) {
|
||||
if (el.style[t] !== undefined) {
|
||||
el.style[t] = "translate3d(1px,1px,1px)";
|
||||
el.style[t] = 'translate3d(1px,1px,1px)';
|
||||
has3d = window.getComputedStyle(el).getPropertyValue(transforms[t]);
|
||||
}
|
||||
}
|
||||
@ -71,8 +71,8 @@
|
||||
})();
|
||||
|
||||
// listen to scroll and resize
|
||||
UI.$doc.on("scrolling.uk.document", checkParallaxes);
|
||||
UI.$win.on("load resize orientationchange", UI.Utils.debounce(function(){
|
||||
UI.$doc.on('scrolling.uk.document', checkParallaxes);
|
||||
UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(){
|
||||
wh = window.innerHeight;
|
||||
checkParallaxes();
|
||||
}, 50));
|
||||
@ -84,8 +84,8 @@
|
||||
|
||||
var parallax = UI.$(this);
|
||||
|
||||
if (!parallax.data("parallax")) {
|
||||
UI.parallax(parallax, UI.Utils.options(parallax.attr("data-uk-parallax")));
|
||||
if (!parallax.data('parallax')) {
|
||||
UI.parallax(parallax, UI.Utils.options(parallax.attr('data-uk-parallax')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -122,7 +122,7 @@
|
||||
dir = (start < end ? 1:-1);
|
||||
}
|
||||
|
||||
this.props[prop] = { 'start': start, 'end': end, 'dir': dir, 'diff': diff };
|
||||
this.props[prop] = { start: start, end: end, dir: dir, diff: diff };
|
||||
|
||||
}.bind(this));
|
||||
|
||||
@ -186,7 +186,7 @@
|
||||
update: function(percent) {
|
||||
|
||||
var $this = this,
|
||||
css = {'transform':''},
|
||||
css = {transform:'', filter:''},
|
||||
compercent = percent * (1 - (this.velocity - (this.velocity * percent))),
|
||||
opts, val;
|
||||
|
||||
@ -216,27 +216,27 @@
|
||||
switch(prop) {
|
||||
|
||||
// transforms
|
||||
case "x":
|
||||
case 'x':
|
||||
css.transform += supports3d ? ' translate3d('+val+'px, 0, 0)':' translateX('+val+'px)';
|
||||
break;
|
||||
case "xp":
|
||||
case 'xp':
|
||||
css.transform += supports3d ? ' translate3d('+val+'%, 0, 0)':' translateX('+val+'%)';
|
||||
break;
|
||||
case "y":
|
||||
case 'y':
|
||||
css.transform += supports3d ? ' translate3d(0, '+val+'px, 0)':' translateY('+val+'px)';
|
||||
break;
|
||||
case "yp":
|
||||
case 'yp':
|
||||
css.transform += supports3d ? ' translate3d(0, '+val+'%, 0)':' translateY('+val+'%)';
|
||||
break;
|
||||
case "rotate":
|
||||
case 'rotate':
|
||||
css.transform += ' rotate('+val+'deg)';
|
||||
break;
|
||||
case "scale":
|
||||
case 'scale':
|
||||
css.transform += ' scale('+val+')';
|
||||
break;
|
||||
|
||||
// bg image
|
||||
case "bg":
|
||||
case 'bg':
|
||||
|
||||
// don't move if image height is too small
|
||||
// if ($this.element.data('bgsize') && ($this.element.data('bgsize').h + val - window.innerHeight) < 0) {
|
||||
@ -245,17 +245,40 @@
|
||||
|
||||
css['background-position'] = '50% '+val+'px';
|
||||
break;
|
||||
case "bgp":
|
||||
case 'bgp':
|
||||
css['background-position'] = '50% '+val+'%';
|
||||
break;
|
||||
|
||||
// color
|
||||
case "color":
|
||||
case "background-color":
|
||||
case "border-color":
|
||||
case 'color':
|
||||
case 'background-color':
|
||||
case 'border-color':
|
||||
css[prop] = calcColor(opts.start, opts.end, compercent);
|
||||
break;
|
||||
|
||||
// CSS Filter
|
||||
case 'blur':
|
||||
css.filter += ' blur('+val+'px)';
|
||||
break;
|
||||
case 'hue':
|
||||
css.filter += ' hue-rotate('+val+'deg)';
|
||||
break;
|
||||
case 'grayscale':
|
||||
css.filter += ' grayscale('+val+'%)';
|
||||
break;
|
||||
case 'invert':
|
||||
css.filter += ' invert('+val+'%)';
|
||||
break;
|
||||
case 'fopacity':
|
||||
css.filter += ' opacity('+val+'%)';
|
||||
break;
|
||||
case 'saturate':
|
||||
css.filter += ' saturate('+val+'%)';
|
||||
break;
|
||||
case 'sepia':
|
||||
css.filter += ' sepia('+val+'%)';
|
||||
break;
|
||||
|
||||
default:
|
||||
css[prop] = val;
|
||||
break;
|
||||
@ -263,6 +286,10 @@
|
||||
|
||||
}.bind(this));
|
||||
|
||||
if (css.filter) {
|
||||
css['-webkit-filter'] = css.filter;
|
||||
}
|
||||
|
||||
this.element.css(css);
|
||||
|
||||
this._percent = compercent;
|
||||
@ -292,7 +319,7 @@
|
||||
|
||||
var img = new Image(), url, element, size, check, ratio, width, height;
|
||||
|
||||
element = obj.element.css({'background-size': 'cover', 'background-repeat': 'no-repeat'});
|
||||
element = obj.element.css({backgroundSize: 'cover', backgroundRepeat: 'no-repeat'});
|
||||
url = element.css('background-image').replace(/^url\(/g, '').replace(/\)$/g, '').replace(/("|')/g, '');
|
||||
check = function() {
|
||||
|
||||
@ -302,7 +329,7 @@
|
||||
w += Math.ceil(extra * ratio);
|
||||
|
||||
if (w-extra < size.w && h < size.h) {
|
||||
return obj.element.css({'background-size': 'auto'});
|
||||
return obj.element.css({backgroundSize: 'auto'});
|
||||
}
|
||||
|
||||
// if element height < parent height (gap underneath)
|
||||
@ -323,7 +350,7 @@
|
||||
height = Math.ceil(w / ratio);
|
||||
}
|
||||
|
||||
element.css({'background-size': (width+'px '+height+'px')}).data('bgsize', {w:width,h:height});
|
||||
element.css({backgroundSize: (width+'px '+height+'px')}).data('bgsize', {w:width,h:height});
|
||||
};
|
||||
|
||||
img.onerror = function(){
|
||||
@ -334,7 +361,7 @@
|
||||
size = {w:img.width, h:img.height};
|
||||
ratio = img.width / img.height;
|
||||
|
||||
UI.$win.on("load resize orientationchange", UI.Utils.debounce(function(){
|
||||
UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(){
|
||||
check();
|
||||
}, 50));
|
||||
|
||||
|
4
media/uikit/js/components/parallax.min.js
vendored
4
media/uikit/js/components/parallax.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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-search", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-search', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@
|
||||
|
||||
var opts = this.options;
|
||||
|
||||
this.dropdown.append(this.template({"items":data.results || [], "msgResultsHeader":opts.msgResultsHeader, "msgMoreResults": opts.msgMoreResults, "msgNoResults": opts.msgNoResults}));
|
||||
this.dropdown.append(this.template({items:data.results || [], msgResultsHeader:opts.msgResultsHeader, msgMoreResults: opts.msgMoreResults, msgNoResults: opts.msgNoResults}));
|
||||
this.show();
|
||||
}
|
||||
},
|
||||
@ -55,11 +55,11 @@
|
||||
boot: function() {
|
||||
|
||||
// init code
|
||||
UI.$html.on("focus.search.uikit", "[data-uk-search]", function(e) {
|
||||
UI.$html.on('focus.search.uikit', '[data-uk-search]', function(e) {
|
||||
var ele =UI.$(this);
|
||||
|
||||
if (!ele.data("search")) {
|
||||
UI.search(ele, UI.Utils.options(ele.attr("data-uk-search")));
|
||||
if (!ele.data('search')) {
|
||||
UI.search(ele, UI.Utils.options(ele.attr('data-uk-search')));
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -72,10 +72,10 @@
|
||||
this.autocomplete.dropdown.addClass('uk-dropdown-search');
|
||||
|
||||
this.autocomplete.input.on("keyup", function(){
|
||||
$this.element[$this.autocomplete.input.val() ? "addClass":"removeClass"]("uk-active");
|
||||
$this.element[$this.autocomplete.input.val() ? 'addClass':'removeClass']('uk-active');
|
||||
}).closest("form").on("reset", function(){
|
||||
$this.value="";
|
||||
$this.element.removeClass("uk-active");
|
||||
$this.value = '';
|
||||
$this.element.removeClass('uk-active');
|
||||
});
|
||||
|
||||
this.on('selectitem.uk.autocomplete', function(e, data) {
|
||||
@ -86,7 +86,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
this.element.data("search", this);
|
||||
this.element.data('search', this);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
4
media/uikit/js/components/search.min.js
vendored
4
media/uikit/js/components/search.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(e){var s;window.UIkit&&(s=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-search",["uikit"],function(){return s||e(UIkit)})}(function(e){"use strict";e.component("search",{defaults:{msgResultsHeader:"Search Results",msgMoreResults:"More Results",msgNoResults:"No results found",template:'<ul class="uk-nav uk-nav-search uk-autocomplete-results"> {{#msgResultsHeader}}<li class="uk-nav-header uk-skip">{{msgResultsHeader}}</li>{{/msgResultsHeader}} {{#items && items.length}} {{~items}} <li data-url="{{!$item.url}}"> <a href="{{!$item.url}}"> {{{$item.title}}} {{#$item.text}}<div>{{{$item.text}}}</div>{{/$item.text}} </a> </li> {{/items}} {{#msgMoreResults}} <li class="uk-nav-divider uk-skip"></li> <li class="uk-search-moreresults" data-moreresults="true"><a href="#" onclick="jQuery(this).closest(\'form\').submit();">{{msgMoreResults}}</a></li> {{/msgMoreResults}} {{/end}} {{^items.length}} {{#msgNoResults}}<li class="uk-skip"><a>{{msgNoResults}}</a></li>{{/msgNoResults}} {{/end}} </ul>',renderer:function(e){var s=this.options;this.dropdown.append(this.template({items:e.results||[],msgResultsHeader:s.msgResultsHeader,msgMoreResults:s.msgMoreResults,msgNoResults:s.msgNoResults})),this.show()}},boot:function(){e.$html.on("focus.search.uikit","[data-uk-search]",function(){var s=e.$(this);s.data("search")||e.search(s,e.Utils.options(s.attr("data-uk-search")))})},init:function(){var s=this;this.autocomplete=e.autocomplete(this.element,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-search"),this.autocomplete.input.on("keyup",function(){s.element[s.autocomplete.input.val()?"addClass":"removeClass"]("uk-active")}).closest("form").on("reset",function(){s.value="",s.element.removeClass("uk-active")}),this.on("selectitem.uk.autocomplete",function(e,t){t.url?location.href=t.url:t.moreresults&&s.autocomplete.input.closest("form").submit()}),this.element.data("search",this)}})});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(e){var s;window.UIkit2&&(s=e(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-search",["uikit"],function(){return s||e(UIkit2)})}(function(e){"use strict";e.component("search",{defaults:{msgResultsHeader:"Search Results",msgMoreResults:"More Results",msgNoResults:"No results found",template:'<ul class="uk-nav uk-nav-search uk-autocomplete-results"> {{#msgResultsHeader}}<li class="uk-nav-header uk-skip">{{msgResultsHeader}}</li>{{/msgResultsHeader}} {{#items && items.length}} {{~items}} <li data-url="{{!$item.url}}"> <a href="{{!$item.url}}"> {{{$item.title}}} {{#$item.text}}<div>{{{$item.text}}}</div>{{/$item.text}} </a> </li> {{/items}} {{#msgMoreResults}} <li class="uk-nav-divider uk-skip"></li> <li class="uk-search-moreresults" data-moreresults="true"><a href="#" onclick="jQuery(this).closest(\'form\').submit();">{{msgMoreResults}}</a></li> {{/msgMoreResults}} {{/end}} {{^items.length}} {{#msgNoResults}}<li class="uk-skip"><a>{{msgNoResults}}</a></li>{{/msgNoResults}} {{/end}} </ul>',renderer:function(e){var s=this.options;this.dropdown.append(this.template({items:e.results||[],msgResultsHeader:s.msgResultsHeader,msgMoreResults:s.msgMoreResults,msgNoResults:s.msgNoResults})),this.show()}},boot:function(){e.$html.on("focus.search.uikit","[data-uk-search]",function(){var s=e.$(this);s.data("search")||e.search(s,e.Utils.options(s.attr("data-uk-search")))})},init:function(){var s=this;this.autocomplete=e.autocomplete(this.element,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-search"),this.autocomplete.input.on("keyup",function(){s.element[s.autocomplete.input.val()?"addClass":"removeClass"]("uk-active")}).closest("form").on("reset",function(){s.value="",s.element.removeClass("uk-active")}),this.on("selectitem.uk.autocomplete",function(e,t){t.url?location.href=t.url:t.moreresults&&s.autocomplete.input.closest("form").submit()}),this.element.data("search",this)}})});
|
@ -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-slider", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-slider', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
this.focus = 0;
|
||||
|
||||
UI.$win.on('resize load', UI.Utils.debounce(function() {
|
||||
$this.resize(true);
|
||||
$this.update(true);
|
||||
}, 100));
|
||||
|
||||
this.on('click.uk.slider', '[data-uk-slider-item]', function(e) {
|
||||
@ -143,11 +143,11 @@
|
||||
mouseleave: function() { $this.hovering = false; }
|
||||
});
|
||||
|
||||
this.resize(true);
|
||||
this.update(true);
|
||||
|
||||
this.on('display.uk.check', function(){
|
||||
if ($this.element.is(":visible")) {
|
||||
$this.resize(true);
|
||||
$this.update(true);
|
||||
}
|
||||
});
|
||||
|
||||
@ -159,9 +159,15 @@
|
||||
this.start();
|
||||
}
|
||||
|
||||
UI.domObserve(this.element, function(e) {
|
||||
if ($this.element.children(':not([data-slider-slide])').length) {
|
||||
$this.update(true);
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
resize: function(focus) {
|
||||
update: function(focus) {
|
||||
|
||||
var $this = this, pos = 0, maxheight = 0, item, width, cwidth, size;
|
||||
|
||||
@ -172,7 +178,7 @@
|
||||
|
||||
this.items.each(function(idx){
|
||||
|
||||
item = UI.$(this);
|
||||
item = UI.$(this).attr('data-slider-slide', idx);
|
||||
size = item.css({'left': '', 'width':''})[0].getBoundingClientRect();
|
||||
width = size.width;
|
||||
cwidth = item.width();
|
||||
@ -196,7 +202,7 @@
|
||||
|
||||
this.itemsResized = true;
|
||||
|
||||
return this.resize();
|
||||
return this.update();
|
||||
}
|
||||
|
||||
this.cw = pos;
|
||||
@ -364,9 +370,9 @@
|
||||
var left = item.data('area');
|
||||
|
||||
itm.css({'left': left}).data({
|
||||
'left' : left,
|
||||
'area' : (left+itm.data('width')),
|
||||
'center': (left - ($this.vp/2 - itm.data('cwidth')/2))
|
||||
left : left,
|
||||
area : (left+itm.data('width')),
|
||||
center: (left - ($this.vp/2 - itm.data('cwidth')/2))
|
||||
});
|
||||
|
||||
item = itm;
|
||||
@ -398,9 +404,9 @@
|
||||
var left = item.data('left') - itm.data('width');
|
||||
|
||||
itm.css({'left': left}).data({
|
||||
'left' : left,
|
||||
'area' : (left+itm.data('width')),
|
||||
'center': (left - ($this.vp/2 - itm.data('cwidth')/2))
|
||||
left : left,
|
||||
area : (left+itm.data('width')),
|
||||
center: (left - ($this.vp/2 - itm.data('cwidth')/2))
|
||||
});
|
||||
|
||||
item = itm;
|
||||
@ -513,6 +519,9 @@
|
||||
|
||||
z = z+1 == dragging.items.length ? 0:z+1;
|
||||
}
|
||||
if (!dragging.options.infinite && !focus) {
|
||||
focus = dragging.items.length;
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
@ -527,6 +536,9 @@
|
||||
|
||||
z = z-1 == -1 ? dragging.items.length-1:z-1;
|
||||
}
|
||||
if (!dragging.options.infinite && !focus) {
|
||||
focus = 0
|
||||
}
|
||||
}
|
||||
|
||||
dragging.updateFocus(focus!==false ? focus:store._focus);
|
||||
|
4
media/uikit/js/components/slider.min.js
vendored
4
media/uikit/js/components/slider.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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-slideset", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-slideset', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -40,12 +40,12 @@
|
||||
// auto init
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-slideset]", context).each(function(){
|
||||
UI.$('[data-uk-slideset]', context).each(function(){
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if(!ele.data("slideset")) {
|
||||
UI.slideset(ele, UI.Utils.options(ele.attr("data-uk-slideset")));
|
||||
if(!ele.data('slideset')) {
|
||||
UI.slideset(ele, UI.Utils.options(ele.attr('data-uk-slideset')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -60,8 +60,8 @@
|
||||
this.nav = this.element.find('.uk-slideset-nav');
|
||||
this.controls = this.options.controls ? UI.$(this.options.controls) : this.element;
|
||||
|
||||
UI.$win.on("resize load", UI.Utils.debounce(function() {
|
||||
$this.updateSets();
|
||||
UI.$win.on('resize load', UI.Utils.debounce(function() {
|
||||
$this.update();
|
||||
}, 100));
|
||||
|
||||
$this.list.addClass('uk-grid-width-1-'+$this.options.default);
|
||||
@ -75,7 +75,7 @@
|
||||
$this.list.addClass('uk-grid-width-'+bp+'-1-'+$this.options[bp]);
|
||||
});
|
||||
|
||||
this.on("click.uk.slideset", '[data-uk-slideset-item]', function(e) {
|
||||
this.on('click.uk.slideset', '[data-uk-slideset-item]', function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
|
||||
$this._hide().then(function(){
|
||||
|
||||
$this.updateSets(true, true);
|
||||
$this.update(true, true);
|
||||
});
|
||||
});
|
||||
|
||||
@ -125,7 +125,7 @@
|
||||
});
|
||||
|
||||
this.updateFilter(this.options.filter);
|
||||
this.updateSets();
|
||||
this.update();
|
||||
|
||||
this.element.on({
|
||||
mouseenter: function() { if ($this.options.pauseOnHover) $this.hovering = true; },
|
||||
@ -136,9 +136,15 @@
|
||||
if (this.options.autoplay) {
|
||||
this.start();
|
||||
}
|
||||
|
||||
UI.domObserve(this.list, function(e) {
|
||||
if ($this.list.children(':visible:not(.uk-active)').length) {
|
||||
$this.update(false,true);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
updateSets: function(animate, force) {
|
||||
update: function(animate, force) {
|
||||
|
||||
var visible = this.visible, i;
|
||||
|
||||
@ -417,6 +423,8 @@
|
||||
clsOut = clsIn;
|
||||
}
|
||||
|
||||
UI.$body.css('overflow-x', 'hidden'); // prevent horizontal scrollbar on animation
|
||||
|
||||
release = function() {
|
||||
|
||||
if (current && current.length) {
|
||||
@ -435,6 +443,7 @@
|
||||
var finish = function() {
|
||||
next.removeClass(''+clsIn+'').css({opacity:'', display:'', 'animation-delay':'', 'animation':''});
|
||||
d.resolve();
|
||||
UI.$body.css('overflow-x', '');
|
||||
$this.element.css('min-height', '');
|
||||
finish = false;
|
||||
};
|
||||
|
4
media/uikit/js/components/slideset.min.js
vendored
4
media/uikit/js/components/slideset.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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-slideshow-fx", ["uikit"], function() {
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-slideshow-fx', ['uikit'], function() {
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
var Animations = UI.slideshow.animations;
|
||||
|
||||
UI.$.extend(UI.slideshow.animations, {
|
||||
'slice': function(current, next, dir, fromfx) {
|
||||
slice: function(current, next, dir, fromfx) {
|
||||
|
||||
if (!current.data('cover')) {
|
||||
return Animations.fade.apply(this, arguments);
|
||||
@ -30,7 +30,7 @@
|
||||
|
||||
var sliceWidth = Math.ceil(this.element.width() / this.options.slices),
|
||||
bgimage = next.data('cover').css('background-image'),
|
||||
ghost = UI.$('<li></li>').css({
|
||||
ghost = UI.$('<li class="uk-slideshow-ghost"></li>').css({
|
||||
top : 0,
|
||||
left : 0,
|
||||
width : this.container.width(),
|
||||
@ -80,19 +80,18 @@
|
||||
this.container.append(ghost);
|
||||
|
||||
ghost.children().last().on(UI.support.transition.end, function() {
|
||||
ghost.remove();
|
||||
d.resolve();
|
||||
|
||||
setTimeout(function() {
|
||||
ghost.remove();
|
||||
d.resolve();
|
||||
}, 0);
|
||||
});
|
||||
|
||||
ghost.width();
|
||||
|
||||
ghost.children().each(function() {
|
||||
var bar = UI.$(this);
|
||||
|
||||
bar.css({
|
||||
'clip': bar.data('clip'),
|
||||
'opacity': 1
|
||||
});
|
||||
bar = UI.$(this);
|
||||
bar.css({ clip: bar.data('clip'), opacity: 1 });
|
||||
});
|
||||
|
||||
return d.promise();
|
||||
@ -110,7 +109,7 @@
|
||||
return Animations.slice.apply(this, [current, next, dir, 'slice-up-down']);
|
||||
},
|
||||
|
||||
'fold': function(current, next, dir) {
|
||||
fold: function(current, next, dir) {
|
||||
|
||||
if (!next.data('cover')) {
|
||||
return Animations.fade.apply(this, arguments);
|
||||
@ -120,7 +119,7 @@
|
||||
|
||||
var sliceWidth = Math.ceil(this.element.width() / this.options.slices),
|
||||
bgimage = next.data('cover').css('background-image'),
|
||||
ghost = UI.$('<li></li>').css({
|
||||
ghost = UI.$('<li class="uk-slideshow-ghost"></li>').css({
|
||||
width : next.width(),
|
||||
height : next.height(),
|
||||
opacity: 1,
|
||||
@ -155,17 +154,19 @@
|
||||
ghost.width();
|
||||
|
||||
ghost.children().first().on(UI.support.transition.end, function() {
|
||||
ghost.remove();
|
||||
d.resolve();
|
||||
setTimeout(function() {
|
||||
ghost.remove();
|
||||
d.resolve();
|
||||
}, 0);
|
||||
}).end().css({
|
||||
'transform': 'scaleX(1)',
|
||||
'opacity': 1
|
||||
transform: 'scaleX(1)',
|
||||
opacity: 1
|
||||
});
|
||||
|
||||
return d.promise();
|
||||
},
|
||||
|
||||
'puzzle': function(current, next, dir) {
|
||||
puzzle: function(current, next, dir) {
|
||||
|
||||
if (!next.data('cover')) {
|
||||
return Animations.fade.apply(this, arguments);
|
||||
@ -178,7 +179,7 @@
|
||||
boxRows = Math.round(next.height()/boxWidth),
|
||||
boxHeight = Math.round(next.height()/boxRows)+1,
|
||||
bgimage = next.data('cover').css('background-image'),
|
||||
ghost = UI.$('<li></li>').css({
|
||||
ghost = UI.$('<li class="uk-slideshow-ghost"></li>').css({
|
||||
width : this.container.width(),
|
||||
height : this.container.height(),
|
||||
opacity : 1,
|
||||
@ -228,18 +229,21 @@
|
||||
'-webkit-transition': 'all '+$this.options.duration+'ms ease-in-out '+(50+i*25)+'ms'
|
||||
});
|
||||
}).last().on(UI.support.transition.end, function() {
|
||||
ghost.remove();
|
||||
d.resolve();
|
||||
|
||||
setTimeout(function() {
|
||||
ghost.remove();
|
||||
d.resolve();
|
||||
}, 0);
|
||||
});
|
||||
|
||||
ghost.width();
|
||||
|
||||
boxes.css({'opacity': 1});
|
||||
boxes.css({opacity: 1});
|
||||
|
||||
return d.promise();
|
||||
},
|
||||
|
||||
'boxes': function(current, next, dir, fromfx) {
|
||||
boxes: function(current, next, dir, fromfx) {
|
||||
|
||||
if (!next.data('cover')) {
|
||||
return Animations.fade.apply(this, arguments);
|
||||
@ -252,7 +256,7 @@
|
||||
boxRows = Math.round(next.height()/boxWidth),
|
||||
boxHeight = Math.round(next.height()/boxRows)+1,
|
||||
bgimage = next.data('cover').css('background-image'),
|
||||
ghost = UI.$('<li></li>').css({
|
||||
ghost = UI.$('<li class="uk-slideshow-ghost"></li>').css({
|
||||
width : next.width(),
|
||||
height : next.height(),
|
||||
opacity : 1,
|
||||
@ -332,8 +336,11 @@
|
||||
}
|
||||
|
||||
boxes.last().on(UI.support.transition.end, function() {
|
||||
ghost.remove();
|
||||
d.resolve();
|
||||
|
||||
setTimeout(function() {
|
||||
ghost.remove();
|
||||
d.resolve();
|
||||
}, 0);
|
||||
});
|
||||
|
||||
ghost.width();
|
||||
|
File diff suppressed because one or more lines are too long
@ -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-slideshow", ["uikit"], function() {
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-slideshow', ['uikit'], function() {
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -22,9 +22,9 @@
|
||||
UI.component('slideshow', {
|
||||
|
||||
defaults: {
|
||||
animation : "fade",
|
||||
animation : 'fade',
|
||||
duration : 500,
|
||||
height : "auto",
|
||||
height : 'auto',
|
||||
start : 0,
|
||||
autoplay : false,
|
||||
autoplayInterval : 7000,
|
||||
@ -56,8 +56,8 @@
|
||||
|
||||
var slideshow = UI.$(this);
|
||||
|
||||
if (!slideshow.data("slideshow")) {
|
||||
UI.slideshow(slideshow, UI.Utils.options(slideshow.attr("data-uk-slideshow")));
|
||||
if (!slideshow.data('slideshow')) {
|
||||
UI.slideshow(slideshow, UI.Utils.options(slideshow.attr('data-uk-slideshow')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -65,22 +65,20 @@
|
||||
|
||||
init: function() {
|
||||
|
||||
var $this = this, canvas, kbanimduration;
|
||||
var $this = this;
|
||||
|
||||
this.container = this.element.hasClass('uk-slideshow') ? this.element : UI.$(this.find('.uk-slideshow'));
|
||||
this.slides = this.container.children();
|
||||
this.slidesCount = this.slides.length;
|
||||
this.container = this.element.hasClass('uk-slideshow') ? this.element : UI.$(this.find('.uk-slideshow:first'));
|
||||
this.current = this.options.start;
|
||||
this.animating = false;
|
||||
this.triggers = this.find('[data-uk-slideshow-item]');
|
||||
|
||||
this.fixFullscreen = navigator.userAgent.match(/(iPad|iPhone|iPod)/g) && this.container.hasClass('uk-slideshow-fullscreen'); // viewport unit fix for height:100vh - should be fixed in iOS 8
|
||||
|
||||
if (this.options.kenburns) {
|
||||
|
||||
kbanimduration = this.options.kenburns === true ? '15s': this.options.kenburns;
|
||||
this.kbanimduration = this.options.kenburns === true ? '15s': this.options.kenburns;
|
||||
|
||||
if (!String(kbanimduration).match(/(ms|s)$/)) {
|
||||
kbanimduration += 'ms';
|
||||
if (!String(this.kbanimduration).match(/(ms|s)$/)) {
|
||||
this.kbanimduration += 'ms';
|
||||
}
|
||||
|
||||
if (typeof(this.options.kenburnsanimations) == 'string') {
|
||||
@ -88,10 +86,103 @@
|
||||
}
|
||||
}
|
||||
|
||||
this.update();
|
||||
|
||||
this.on('click.uk.slideshow', '[data-uk-slideshow-item]', function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
var slide = UI.$(this).attr('data-uk-slideshow-item');
|
||||
|
||||
if ($this.current == slide) return;
|
||||
|
||||
switch(slide) {
|
||||
case 'next':
|
||||
case 'previous':
|
||||
$this[slide=='next' ? 'next':'previous']();
|
||||
break;
|
||||
default:
|
||||
$this.show(parseInt(slide, 10));
|
||||
}
|
||||
|
||||
$this.stop();
|
||||
});
|
||||
|
||||
UI.$win.on("resize load", UI.Utils.debounce(function() {
|
||||
$this.resize();
|
||||
|
||||
if ($this.fixFullscreen) {
|
||||
$this.container.css('height', window.innerHeight);
|
||||
$this.slides.css('height', window.innerHeight);
|
||||
}
|
||||
}, 100));
|
||||
|
||||
// chrome image load fix
|
||||
setTimeout(function(){
|
||||
$this.resize();
|
||||
}, 80);
|
||||
|
||||
// Set autoplay
|
||||
if (this.options.autoplay) {
|
||||
this.start();
|
||||
}
|
||||
|
||||
if (this.options.videoautoplay && this.slides.eq(this.current).data('media')) {
|
||||
this.playmedia(this.slides.eq(this.current).data('media'));
|
||||
}
|
||||
|
||||
if (this.options.kenburns) {
|
||||
this.applyKenBurns(this.slides.eq(this.current));
|
||||
}
|
||||
|
||||
this.container.on({
|
||||
mouseenter: function() { if ($this.options.pauseOnHover) $this.hovering = true; },
|
||||
mouseleave: function() { $this.hovering = false; }
|
||||
});
|
||||
|
||||
this.on('swipeRight swipeLeft', function(e) {
|
||||
$this[e.type=='swipeLeft' ? 'next' : 'previous']();
|
||||
});
|
||||
|
||||
this.on('display.uk.check', function(){
|
||||
if ($this.element.is(':visible')) {
|
||||
|
||||
$this.resize();
|
||||
|
||||
if ($this.fixFullscreen) {
|
||||
$this.container.css('height', window.innerHeight);
|
||||
$this.slides.css('height', window.innerHeight);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
UI.domObserve(this.element, function(e) {
|
||||
if ($this.container.children(':not([data-slideshow-slide])').not('.uk-slideshow-ghost').length) {
|
||||
$this.update(true);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
update: function(resize) {
|
||||
|
||||
var $this = this, canvas, processed = 0;
|
||||
|
||||
this.slides = this.container.children();
|
||||
this.slidesCount = this.slides.length;
|
||||
|
||||
if (!this.slides.eq(this.current).length) {
|
||||
this.current = 0;
|
||||
}
|
||||
|
||||
this.slides.each(function(index) {
|
||||
|
||||
var slide = UI.$(this),
|
||||
media = slide.children('img,video,iframe').eq(0);
|
||||
var slide = UI.$(this);
|
||||
|
||||
if (slide.data('processed')) {
|
||||
return;
|
||||
}
|
||||
|
||||
var media = slide.children('img,video,iframe').eq(0), type = 'html';
|
||||
|
||||
slide.data('media', media);
|
||||
slide.data('sizer', media);
|
||||
@ -100,6 +191,8 @@
|
||||
|
||||
var placeholder;
|
||||
|
||||
type = media[0].nodeName.toLowerCase();
|
||||
|
||||
switch(media[0].nodeName) {
|
||||
case 'IMG':
|
||||
|
||||
@ -180,86 +273,29 @@
|
||||
if ($this.hasKenBurns(slide)) {
|
||||
|
||||
slide.data('cover').css({
|
||||
'-webkit-animation-duration': kbanimduration,
|
||||
'animation-duration': kbanimduration
|
||||
'-webkit-animation-duration': $this.kbanimduration,
|
||||
'animation-duration': $this.kbanimduration
|
||||
});
|
||||
}
|
||||
|
||||
slide.data('processed', ++processed);
|
||||
slide.attr('data-slideshow-slide', type);
|
||||
});
|
||||
|
||||
this.on("click.uk.slideshow", '[data-uk-slideshow-item]', function(e) {
|
||||
if (processed) {
|
||||
|
||||
e.preventDefault();
|
||||
this.triggers = this.find('[data-uk-slideshow-item]');
|
||||
|
||||
var slide = UI.$(this).attr('data-uk-slideshow-item');
|
||||
|
||||
if ($this.current == slide) return;
|
||||
|
||||
switch(slide) {
|
||||
case 'next':
|
||||
case 'previous':
|
||||
$this[slide=='next' ? 'next':'previous']();
|
||||
break;
|
||||
default:
|
||||
$this.show(parseInt(slide, 10));
|
||||
}
|
||||
|
||||
$this.stop();
|
||||
});
|
||||
|
||||
// Set start slide
|
||||
this.slides.attr('aria-hidden', 'true').eq(this.current).addClass('uk-active').attr('aria-hidden', 'false');
|
||||
this.triggers.filter('[data-uk-slideshow-item="'+this.current+'"]').addClass('uk-active');
|
||||
|
||||
UI.$win.on("resize load", UI.Utils.debounce(function() {
|
||||
$this.resize();
|
||||
|
||||
if ($this.fixFullscreen) {
|
||||
$this.container.css('height', window.innerHeight);
|
||||
$this.slides.css('height', window.innerHeight);
|
||||
}
|
||||
}, 100));
|
||||
|
||||
// chrome image load fix
|
||||
setTimeout(function(){
|
||||
$this.resize();
|
||||
}, 80);
|
||||
|
||||
// Set autoplay
|
||||
if (this.options.autoplay) {
|
||||
this.start();
|
||||
// Set start slide
|
||||
this.slides.attr('aria-hidden', 'true').removeClass('uk-active').eq(this.current).addClass('uk-active').attr('aria-hidden', 'false');
|
||||
this.triggers.filter('[data-uk-slideshow-item="'+this.current+'"]').addClass('uk-active');
|
||||
}
|
||||
|
||||
if (this.options.videoautoplay && this.slides.eq(this.current).data('media')) {
|
||||
this.playmedia(this.slides.eq(this.current).data('media'));
|
||||
if (resize && processed) {
|
||||
this.resize();
|
||||
}
|
||||
|
||||
if (this.options.kenburns) {
|
||||
this.applyKenBurns(this.slides.eq(this.current));
|
||||
}
|
||||
|
||||
this.container.on({
|
||||
mouseenter: function() { if ($this.options.pauseOnHover) $this.hovering = true; },
|
||||
mouseleave: function() { $this.hovering = false; }
|
||||
});
|
||||
|
||||
this.on('swipeRight swipeLeft', function(e) {
|
||||
$this[e.type=='swipeLeft' ? 'next' : 'previous']();
|
||||
});
|
||||
|
||||
this.on('display.uk.check', function(){
|
||||
if ($this.element.is(":visible")) {
|
||||
|
||||
$this.resize();
|
||||
|
||||
if ($this.fixFullscreen) {
|
||||
$this.container.css('height', window.innerHeight);
|
||||
$this.slides.css('height', window.innerHeight);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
resize: function() {
|
||||
|
||||
if (this.container.hasClass('uk-slideshow-fullscreen')) return;
|
||||
@ -304,8 +340,8 @@
|
||||
$this.playmedia(nextmedia);
|
||||
}
|
||||
|
||||
next.addClass("uk-active").attr('aria-hidden', 'false');
|
||||
current.removeClass("uk-active").attr('aria-hidden', 'true');
|
||||
next.addClass('uk-active').attr('aria-hidden', 'false');
|
||||
current.removeClass('uk-active').attr('aria-hidden', 'true');
|
||||
|
||||
$this.animating = false;
|
||||
$this.current = index;
|
||||
@ -444,8 +480,8 @@
|
||||
|
||||
next.css('opacity', 1).one(UI.support.animation.end, function() {
|
||||
|
||||
current.removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
|
||||
next.css('opacity', '').removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
|
||||
current.css('opacity', 0).removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-out' : 'uk-slideshow-scroll-forward-out');
|
||||
next.removeClass(dir == -1 ? 'uk-slideshow-scroll-backward-in' : 'uk-slideshow-scroll-forward-in');
|
||||
d.resolve();
|
||||
|
||||
}.bind(this));
|
||||
@ -466,8 +502,8 @@
|
||||
|
||||
next.css('opacity', 1).one(UI.support.animation.end, function() {
|
||||
|
||||
current.removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
|
||||
next.css('opacity', '').removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
|
||||
current.css('opacity', 0).removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-out' : 'uk-slideshow-swipe-forward-out');
|
||||
next.removeClass(dir === -1 ? 'uk-slideshow-swipe-backward-in' : 'uk-slideshow-swipe-forward-in');
|
||||
d.resolve();
|
||||
|
||||
}.bind(this));
|
||||
@ -490,8 +526,7 @@
|
||||
|
||||
current.one(UI.support.animation.end, function() {
|
||||
|
||||
current.removeClass('uk-slideshow-scale-out');
|
||||
next.css('opacity', '');
|
||||
current.css('opacity', 0).removeClass('uk-slideshow-scale-out');
|
||||
d.resolve();
|
||||
|
||||
}.bind(this));
|
||||
@ -521,8 +556,7 @@
|
||||
|
||||
current.one(UI.support.animation.end, function() {
|
||||
|
||||
current.removeClass('uk-slideshow-fade-out');
|
||||
next.css('opacity', '');
|
||||
current.css('opacity', 0).removeClass('uk-slideshow-fade-out');
|
||||
d.resolve();
|
||||
|
||||
}.bind(this));
|
||||
|
4
media/uikit/js/components/slideshow.min.js
vendored
4
media/uikit/js/components/slideshow.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! 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 */
|
||||
/*
|
||||
* Based on nativesortable - Copyright (c) Brian Grinstead - https://github.com/bgrins/nativesortable
|
||||
*/
|
||||
@ -6,13 +6,13 @@
|
||||
|
||||
var component;
|
||||
|
||||
if (window.UIkit) {
|
||||
component = addon(UIkit);
|
||||
if (window.UIkit2) {
|
||||
component = addon(UIkit2);
|
||||
}
|
||||
|
||||
if (typeof define == "function" && define.amd) {
|
||||
define("uikit-sortable", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-sortable', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -20,8 +20,12 @@
|
||||
|
||||
"use strict";
|
||||
|
||||
var supportsTouch = ('ontouchstart' in window) || (window.DocumentTouch && document instanceof DocumentTouch),
|
||||
draggingPlaceholder, currentlyDraggingElement, currentlyDraggingTarget, dragging, moving, clickedlink, delayIdle, touchedlists, moved, overElement;
|
||||
var supportsTouch = ('ontouchstart' in window || 'MSGesture' in window) || (window.DocumentTouch && document instanceof DocumentTouch),
|
||||
draggingPlaceholder, currentlyDraggingElement, currentlyDraggingTarget, dragging, moving, clickedlink, delayIdle, touchedlists, moved, overElement, startEvent;
|
||||
|
||||
var POINTER_DOWN = supportsTouch ? ('MSGesture' in window ? 'pointerdown':'touchstart') : 'mousedown',
|
||||
POINTER_MOVE = supportsTouch ? ('MSGesture' in window ? 'pointermove':'touchmove') : 'mousemove',
|
||||
POINTER_UP = supportsTouch ? ('MSGesture' in window ? 'pointerup':'touchend') : 'mouseup';
|
||||
|
||||
function closestSortable(ele) {
|
||||
|
||||
@ -66,17 +70,17 @@
|
||||
// auto init
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-sortable]", context).each(function(){
|
||||
UI.$('[data-uk-sortable]', context).each(function(){
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if(!ele.data("sortable")) {
|
||||
UI.sortable(ele, UI.Utils.options(ele.attr("data-uk-sortable")));
|
||||
if(!ele.data('sortable')) {
|
||||
UI.sortable(ele, UI.Utils.options(ele.attr('data-uk-sortable')));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
UI.$html.on('mousemove touchmove', function(e) {
|
||||
UI.$html.on(POINTER_MOVE, function(e) {
|
||||
|
||||
if (delayIdle) {
|
||||
|
||||
@ -100,10 +104,11 @@
|
||||
}
|
||||
|
||||
var offset = draggingPlaceholder.data('mouse-offset'),
|
||||
left = parseInt(e.originalEvent.pageX, 10) + offset.left,
|
||||
top = parseInt(e.originalEvent.pageY, 10) + offset.top;
|
||||
ev = e.originalEvent.touches && e.originalEvent.touches[0] || e.originalEvent,
|
||||
left = parseInt(ev.pageX, 10) + offset.left,
|
||||
top = parseInt(ev.pageY, 10) + offset.top;
|
||||
|
||||
draggingPlaceholder.css({'left': left, 'top': top });
|
||||
draggingPlaceholder.css({left: left, top: top });
|
||||
|
||||
// adjust document scrolling
|
||||
|
||||
@ -119,7 +124,7 @@
|
||||
}
|
||||
});
|
||||
|
||||
UI.$html.on('mouseup touchend', function(e) {
|
||||
UI.$html.on(POINTER_UP, function(e) {
|
||||
|
||||
delayIdle = clickedlink = false;
|
||||
|
||||
@ -166,14 +171,25 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this.options.handleClass) {
|
||||
var handle = $target.hasClass($this.options.handleClass) ? $target : $target.closest('.'+$this.options.handleClass, $this.element);
|
||||
if (!handle.length) return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
if (!supportsTouch && $link.length) {
|
||||
if ($link.length) {
|
||||
|
||||
$link.one('click', function(e){
|
||||
e.preventDefault();
|
||||
}).one('mouseup', function(){
|
||||
if(!moved) $link.trigger('click');
|
||||
}).one(POINTER_UP, function(){
|
||||
|
||||
if (!moved) {
|
||||
$link.trigger('click');
|
||||
if (supportsTouch && $link.attr('href').trim()) {
|
||||
location.href = $link.attr('href');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -219,8 +235,9 @@
|
||||
|
||||
// Bind/unbind standard mouse/touch events as a polyfill.
|
||||
function addDragHandlers() {
|
||||
if (supportsTouch) {
|
||||
element.addEventListener("touchmove", handleTouchMove, false);
|
||||
|
||||
if (supportsTouch && startEvent.touches && startEvent.touches.length) {
|
||||
element.addEventListener(POINTER_MOVE, handleTouchMove, false);
|
||||
} else {
|
||||
element.addEventListener('mouseover', handleDragEnter, false);
|
||||
element.addEventListener('mouseout', handleDragLeave, false);
|
||||
@ -230,8 +247,8 @@
|
||||
}
|
||||
|
||||
function removeDragHandlers() {
|
||||
if (supportsTouch) {
|
||||
element.removeEventListener("touchmove", handleTouchMove, false);
|
||||
if (supportsTouch && startEvent.touches && startEvent.touches.length) {
|
||||
element.removeEventListener(POINTER_MOVE, handleTouchMove, false);
|
||||
} else {
|
||||
element.removeEventListener('mouseover', handleDragEnter, false);
|
||||
element.removeEventListener('mouseout', handleDragLeave, false);
|
||||
@ -258,19 +275,21 @@
|
||||
|
||||
var touch, target, context;
|
||||
|
||||
startEvent = e;
|
||||
|
||||
if (e) {
|
||||
touch = (supportsTouch && e.touches && e.touches[0]) || { };
|
||||
touch = e.touches && e.touches[0] || e;
|
||||
target = touch.target || e.target;
|
||||
|
||||
// Fix event.target for a touch event
|
||||
if (supportsTouch && document.elementFromPoint) {
|
||||
target = document.elementFromPoint(e.pageX - document.body.scrollLeft, e.pageY - document.body.scrollTop);
|
||||
target = document.elementFromPoint(touch.pageX - document.body.scrollLeft, touch.pageY - document.body.scrollTop);
|
||||
}
|
||||
|
||||
overElement = UI.$(target);
|
||||
}
|
||||
|
||||
if (UI.$(target).hasClass($this.options.childClass)) {
|
||||
if (UI.$(target).hasClass('.'+$this.options.childClass)) {
|
||||
fn.apply(target, [e]);
|
||||
} else if (target !== element) {
|
||||
|
||||
@ -284,8 +303,8 @@
|
||||
};
|
||||
}
|
||||
|
||||
window.addEventListener(supportsTouch ? 'touchmove' : 'mousemove', handleDragMove, false);
|
||||
element.addEventListener(supportsTouch ? 'touchstart': 'mousedown', handleDragStart, false);
|
||||
window.addEventListener(POINTER_MOVE, handleDragMove, false);
|
||||
element.addEventListener(POINTER_DOWN, handleDragStart, false);
|
||||
},
|
||||
|
||||
dragStart: function(e, elem) {
|
||||
@ -301,16 +320,6 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this.options.handleClass) {
|
||||
|
||||
var handle = target.hasClass($this.options.handleClass) ? target : target.closest('.'+$this.options.handleClass, $this.element);
|
||||
|
||||
if (!handle.length) {
|
||||
//e.preventDefault();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (target.is('.'+$this.options.noDragClass) || target.closest('.'+$this.options.noDragClass).length) {
|
||||
return;
|
||||
}
|
||||
@ -327,12 +336,12 @@
|
||||
draggingPlaceholder.remove();
|
||||
}
|
||||
|
||||
var $current = UI.$(currentlyDraggingElement), offset = $current.offset();
|
||||
var $current = UI.$(currentlyDraggingElement), offset = $current.offset(), ev = e.touches && e.touches[0] || e;
|
||||
|
||||
delayIdle = {
|
||||
|
||||
pos : { x:e.pageX, y:e.pageY },
|
||||
threshold : $this.options.threshold,
|
||||
pos : { x:ev.pageX, y:ev.pageY },
|
||||
threshold : $this.options.handleClass ? 1 : $this.options.threshold,
|
||||
apply : function(evt) {
|
||||
|
||||
draggingPlaceholder = UI.$('<div class="'+([$this.options.draggingClass, $this.options.dragCustomClass].join(' '))+'"></div>').css({
|
||||
@ -344,11 +353,11 @@
|
||||
padding : $current.css('padding')
|
||||
}).data({
|
||||
'mouse-offset': {
|
||||
'left' : offset.left - parseInt(evt.pageX, 10),
|
||||
'top' : offset.top - parseInt(evt.pageY, 10)
|
||||
left : offset.left - parseInt(ev.pageX, 10),
|
||||
top : offset.top - parseInt(ev.pageY, 10)
|
||||
},
|
||||
'origin' : $this.element,
|
||||
'index' : $current.index()
|
||||
origin : $this.element,
|
||||
index : $current.index()
|
||||
}).append($current.html()).appendTo('body');
|
||||
|
||||
draggingPlaceholder.$current = $current;
|
||||
@ -363,7 +372,7 @@
|
||||
$this.addDragHandlers();
|
||||
|
||||
$this.options.start(this, currentlyDraggingElement);
|
||||
$this.trigger('start.uk.sortable', [$this, currentlyDraggingElement]);
|
||||
$this.trigger('start.uk.sortable', [$this, currentlyDraggingElement, draggingPlaceholder]);
|
||||
|
||||
moved = true;
|
||||
delayIdle = false;
|
||||
@ -376,10 +385,10 @@
|
||||
overElement = UI.$(document.elementFromPoint(e.pageX - (document.body.scrollLeft || document.scrollLeft || 0), e.pageY - (document.body.scrollTop || document.documentElement.scrollTop || 0)));
|
||||
|
||||
var overRoot = overElement.closest('.'+this.options.baseClass),
|
||||
groupOver = overRoot.data("sortable-group"),
|
||||
groupOver = overRoot.data('sortable-group'),
|
||||
$current = UI.$(currentlyDraggingElement),
|
||||
currentRoot = $current.parent(),
|
||||
groupCurrent = $current.data("sortable-group"),
|
||||
groupCurrent = $current.data('sortable-group'),
|
||||
overChild;
|
||||
|
||||
if (overRoot[0] !== currentRoot[0] && groupCurrent !== undefined && groupOver === groupCurrent) {
|
||||
@ -403,7 +412,7 @@
|
||||
overElement.append($current);
|
||||
}
|
||||
|
||||
UIkit.$doc.trigger('mouseover');
|
||||
UI.$doc.trigger('mouseover');
|
||||
}
|
||||
|
||||
this.checkEmptyList();
|
||||
@ -424,12 +433,12 @@
|
||||
if (previousCounter === 0) {
|
||||
|
||||
var currentlist = UI.$(elem).parent(),
|
||||
startlist = UI.$(currentlyDraggingElement).data("start-list");
|
||||
startlist = UI.$(currentlyDraggingElement).data('start-list');
|
||||
|
||||
if (currentlist[0] !== startlist[0]) {
|
||||
|
||||
var groupOver = currentlist.data('sortable-group'),
|
||||
groupCurrent = UI.$(currentlyDraggingElement).data("sortable-group");
|
||||
groupCurrent = UI.$(currentlyDraggingElement).data('sortable-group');
|
||||
|
||||
if ((groupOver || groupCurrent) && (groupOver != groupCurrent)) {
|
||||
return false;
|
||||
@ -503,7 +512,7 @@
|
||||
if (!currentlyDraggingElement) return;
|
||||
|
||||
var $current = UI.$(currentlyDraggingElement),
|
||||
oldRoot = draggingPlaceholder.data("origin"),
|
||||
oldRoot = draggingPlaceholder.data('origin'),
|
||||
newRoot = $current.closest('.'+this.options.baseClass),
|
||||
triggers = [],
|
||||
el = UI.$(currentlyDraggingElement);
|
||||
@ -572,7 +581,7 @@
|
||||
}).each(function() {
|
||||
var ele = UI.$(this),
|
||||
before = ele.data('offset-before');
|
||||
ele.css({'position':'absolute', 'top':before.top, 'left':before.left, 'min-width':before.width });
|
||||
ele.css({position:'absolute', top:before.top, left:before.left, minWidth:before.width });
|
||||
});
|
||||
|
||||
children.each(function(){
|
||||
@ -585,7 +594,7 @@
|
||||
|
||||
setTimeout(function(){
|
||||
ele.animate({'top':offset.top, 'left':offset.left}, $this.options.animation, function() {
|
||||
ele.css({'position':'','top':'', 'left':'', 'min-width': '', 'pointer-events':''}).removeClass($this.options.overClass).removeData('child-dragenter');
|
||||
ele.css({position:'',top:'', left:'', minWidth: '', 'pointer-events':''}).removeClass($this.options.overClass).removeData('child-dragenter');
|
||||
count--;
|
||||
if (!count) {
|
||||
list.css('min-height', '');
|
||||
@ -602,10 +611,12 @@
|
||||
|
||||
this.element.children().each(function(j, child) {
|
||||
item = {};
|
||||
for (var i = 0; i < child.attributes.length; i++) {
|
||||
for (var i = 0, attr, val; i < child.attributes.length; i++) {
|
||||
attribute = child.attributes[i];
|
||||
if (attribute.name.indexOf('data-') === 0) {
|
||||
item[attribute.name.substr(5)] = UI.Utils.str2json(attribute.value);
|
||||
attr = attribute.name.substr(5);
|
||||
val = UI.Utils.str2json(attribute.value);
|
||||
item[attr] = (val || attribute.value=='false' || attribute.value=='0') ? val:attribute.value;
|
||||
}
|
||||
}
|
||||
data.push(item);
|
||||
|
4
media/uikit/js/components/sortable.min.js
vendored
4
media/uikit/js/components/sortable.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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-sticky", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-sticky', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@
|
||||
clsactive : 'uk-active',
|
||||
clsinactive : '',
|
||||
getWidthFrom : '',
|
||||
showup : false,
|
||||
showup : false,
|
||||
boundary : false,
|
||||
media : false,
|
||||
target : false,
|
||||
@ -54,7 +54,7 @@
|
||||
|
||||
for (var i = 0; i < sticked.length; i++) {
|
||||
sticked[i].reset(true);
|
||||
//sticked[i].self.computeWrapper();
|
||||
sticked[i].self.computeWrapper();
|
||||
}
|
||||
|
||||
checkscrollposition();
|
||||
@ -65,11 +65,11 @@
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
UI.$("[data-uk-sticky]", context).each(function(){
|
||||
UI.$('[data-uk-sticky]', context).each(function(){
|
||||
|
||||
var $ele = UI.$(this);
|
||||
|
||||
if(!$ele.data("sticky")) {
|
||||
if (!$ele.data('sticky')) {
|
||||
UI.sticky($ele, UI.Utils.options($ele.attr('data-uk-sticky')));
|
||||
}
|
||||
});
|
||||
@ -85,6 +85,12 @@
|
||||
|
||||
this.wrapper = this.element.wrap('<div class="uk-sticky-placeholder"></div>').parent();
|
||||
this.computeWrapper();
|
||||
this.wrapper.css({
|
||||
'margin-top' : this.element.css('margin-top'),
|
||||
'margin-bottom' : this.element.css('margin-bottom'),
|
||||
'margin-left' : this.element.css('margin-left'),
|
||||
'margin-right' : this.element.css('margin-right')
|
||||
})
|
||||
this.element.css('margin', 0);
|
||||
|
||||
if (boundary) {
|
||||
@ -140,13 +146,14 @@
|
||||
this.calcTop();
|
||||
|
||||
var finalize = function() {
|
||||
this.element.css({"position":"", "top":"", "width":"", "left":"", "margin":"0"});
|
||||
this.element.css({position:'', top:'', width:'', left:'', margin:'0'});
|
||||
this.element.removeClass([this.options.animation, 'uk-animation-reverse', this.options.clsactive].join(' '));
|
||||
this.element.addClass(this.options.clsinactive);
|
||||
this.element.trigger('inactive.uk.sticky');
|
||||
|
||||
this.currentTop = null;
|
||||
this.animate = false;
|
||||
|
||||
}.bind(this);
|
||||
|
||||
|
||||
@ -233,9 +240,8 @@
|
||||
computeWrapper: function() {
|
||||
|
||||
this.wrapper.css({
|
||||
'height' : ['absolute','fixed'].indexOf(this.element.css('position')) == -1 ? this.element.outerHeight() : '',
|
||||
'float' : this.element.css('float') != 'none' ? this.element.css('float') : '',
|
||||
'margin' : this.element.css('margin')
|
||||
'height' : ['absolute','fixed'].indexOf(this.element.css('position')) == -1 ? this.element.outerHeight() : '',
|
||||
'float' : this.element.css('float') != 'none' ? this.element.css('float') : ''
|
||||
});
|
||||
|
||||
if (this.element.css('position') == 'fixed') {
|
||||
@ -263,7 +269,7 @@
|
||||
|
||||
sticky = stickies[i];
|
||||
|
||||
if (!sticky.element.is(":visible") || sticky.animate) {
|
||||
if (!sticky.element.is(':visible') || sticky.animate) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -290,7 +296,7 @@
|
||||
if (sticky.boundtoparent) {
|
||||
containerBottom = documentHeight - (bTop + sticky.boundary.outerHeight()) + parseInt(sticky.boundary.css('padding-bottom'));
|
||||
} else {
|
||||
containerBottom = documentHeight - bTop - parseInt(sticky.boundary.css('margin-top'));
|
||||
containerBottom = documentHeight - bTop;
|
||||
}
|
||||
|
||||
newTop = (scrollTop + stickyHeight) > (documentHeight - containerBottom - (sticky.top < 0 ? 0 : sticky.top)) ? (documentHeight - containerBottom) - (scrollTop + stickyHeight) : newTop;
|
||||
@ -300,7 +306,7 @@
|
||||
if (sticky.currentTop != newTop) {
|
||||
|
||||
sticky.element.css({
|
||||
position : "fixed",
|
||||
position : 'fixed',
|
||||
top : newTop,
|
||||
width : sticky.getWidthFrom.length ? sticky.getWidthFrom.width() : sticky.element.width()
|
||||
});
|
||||
|
4
media/uikit/js/components/sticky.min.js
vendored
4
media/uikit/js/components/sticky.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-sticky",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";function i(){var i=arguments.length?arguments:n;if(i.length&&!(e.scrollTop()<0))for(var o,a,r,h,p=e.scrollTop(),c=s.height(),l=e.height(),d=c-l,u=p>d?d-p:0,m=0;m<i.length;m++)if(h=i[m],h.element.is(":visible")&&!h.animate){if(h.check()){if(h.top<0?o=0:(r=h.element.outerHeight(),o=c-r-h.top-h.options.bottom-p-u,o=0>o?o+h.top:h.top),h.boundary&&h.boundary.length){var f=h.boundary.offset().top;a=h.boundtoparent?c-(f+h.boundary.outerHeight())+parseInt(h.boundary.css("padding-bottom")):c-f-parseInt(h.boundary.css("margin-top")),o=p+r>c-a-(h.top<0?0:h.top)?c-a-(p+r):o}if(h.currentTop!=o){if(h.element.css({position:"fixed",top:o,width:h.getWidthFrom.length?h.getWidthFrom.width():h.element.width()}),!h.init&&(h.element.addClass(h.options.clsinit),location.hash&&p>0&&h.options.target)){var g=t.$(location.hash);g.length&&setTimeout(function(t,i){return function(){i.element.width();var e=t.offset(),s=e.top+t.outerHeight(),n=i.element.offset(),o=i.element.outerHeight(),a=n.top+o;n.top<s&&e.top<a&&(p=e.top-o-i.options.target,window.scrollTo(0,p))}}(g,h),0)}h.element.addClass(h.options.clsactive).removeClass(h.options.clsinactive),h.element.trigger("active.uk.sticky"),h.element.css("margin",""),h.options.animation&&h.init&&!t.Utils.isInView(h.wrapper)&&h.element.addClass(h.options.animation),h.currentTop=o}}else null!==h.currentTop&&h.reset();h.init=!0}}var e=t.$win,s=t.$doc,n=[],o=1;return t.component("sticky",{defaults:{top:0,bottom:0,animation:"",clsinit:"uk-sticky-init",clsactive:"uk-active",clsinactive:"",getWidthFrom:"",showup:!1,boundary:!1,media:!1,target:!1,disabled:!1},boot:function(){t.$doc.on("scrolling.uk.document",function(t,e){e&&e.dir&&(o=e.dir.y,i())}),t.$win.on("resize orientationchange",t.Utils.debounce(function(){if(n.length){for(var t=0;t<n.length;t++)n[t].reset(!0);i()}},100)),t.ready(function(e){setTimeout(function(){t.$("[data-uk-sticky]",e).each(function(){var i=t.$(this);i.data("sticky")||t.sticky(i,t.Utils.options(i.attr("data-uk-sticky")))}),i()},0)})},init:function(){var i,a=this.options.boundary;this.wrapper=this.element.wrap('<div class="uk-sticky-placeholder"></div>').parent(),this.computeWrapper(),this.element.css("margin",0),a&&(a===!0||"!"===a[0]?(a=a===!0?this.wrapper.parent():this.wrapper.closest(a.substr(1)),i=!0):"string"==typeof a&&(a=t.$(a))),this.sticky={self:this,options:this.options,element:this.element,currentTop:null,wrapper:this.wrapper,init:!1,getWidthFrom:t.$(this.options.getWidthFrom||this.wrapper),boundary:a,boundtoparent:i,top:0,calcTop:function(){var i=this.options.top;if(this.options.top&&"string"==typeof this.options.top)if(this.options.top.match(/^(-|)(\d+)vh$/))i=window.innerHeight*parseInt(this.options.top,10)/100;else{var e=t.$(this.options.top).first();e.length&&e.is(":visible")&&(i=-1*(e.offset().top+e.outerHeight()-this.wrapper.offset().top))}this.top=i},reset:function(i){this.calcTop();var e=function(){this.element.css({position:"",top:"",width:"",left:"",margin:"0"}),this.element.removeClass([this.options.animation,"uk-animation-reverse",this.options.clsactive].join(" ")),this.element.addClass(this.options.clsinactive),this.element.trigger("inactive.uk.sticky"),this.currentTop=null,this.animate=!1}.bind(this);!i&&this.options.animation&&t.support.animation&&!t.Utils.isInView(this.wrapper)?(this.animate=!0,this.element.removeClass(this.options.animation).one(t.support.animation.end,function(){e()}).width(),this.element.addClass(this.options.animation+" uk-animation-reverse")):e()},check:function(){if(this.options.disabled)return!1;if(this.options.media)switch(typeof this.options.media){case"number":if(window.innerWidth<this.options.media)return!1;break;case"string":if(window.matchMedia&&!window.matchMedia(this.options.media).matches)return!1}var i=e.scrollTop(),n=s.height(),a=n-window.innerHeight,r=i>a?a-i:0,h=this.wrapper.offset().top,p=h-this.top-r,c=i>=p;return c&&this.options.showup&&(1==o&&(c=!1),-1==o&&!this.element.hasClass(this.options.clsactive)&&t.Utils.isInView(this.wrapper)&&(c=!1)),c}},this.sticky.calcTop(),n.push(this.sticky)},update:function(){i(this.sticky)},enable:function(){this.options.disabled=!1,this.update()},disable:function(t){this.options.disabled=!0,this.sticky.reset(t)},computeWrapper:function(){this.wrapper.css({height:-1==["absolute","fixed"].indexOf(this.element.css("position"))?this.element.outerHeight():"","float":"none"!=this.element.css("float")?this.element.css("float"):"",margin:this.element.css("margin")}),"fixed"==this.element.css("position")&&this.element.css({width:this.sticky.getWidthFrom.length?this.sticky.getWidthFrom.width():this.element.width()})}}),t.sticky});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit2&&(i=t(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-sticky",["uikit"],function(){return i||t(UIkit2)})}(function(t){"use strict";function i(){var i=arguments.length?arguments:n;if(i.length&&!(e.scrollTop()<0))for(var o,a,r,h,p=e.scrollTop(),c=s.height(),l=e.height(),m=c-l,d=p>m?m-p:0,u=0;u<i.length;u++)if(h=i[u],h.element.is(":visible")&&!h.animate){if(h.check()){if(h.top<0?o=0:(r=h.element.outerHeight(),o=c-r-h.top-h.options.bottom-p-d,o=0>o?o+h.top:h.top),h.boundary&&h.boundary.length){var f=h.boundary.offset().top;a=h.boundtoparent?c-(f+h.boundary.outerHeight())+parseInt(h.boundary.css("padding-bottom")):c-f,o=p+r>c-a-(h.top<0?0:h.top)?c-a-(p+r):o}if(h.currentTop!=o){if(h.element.css({position:"fixed",top:o,width:h.getWidthFrom.length?h.getWidthFrom.width():h.element.width()}),!h.init&&(h.element.addClass(h.options.clsinit),location.hash&&p>0&&h.options.target)){var g=t.$(location.hash);g.length&&setTimeout(function(t,i){return function(){i.element.width();var e=t.offset(),s=e.top+t.outerHeight(),n=i.element.offset(),o=i.element.outerHeight(),a=n.top+o;n.top<s&&e.top<a&&(p=e.top-o-i.options.target,window.scrollTo(0,p))}}(g,h),0)}h.element.addClass(h.options.clsactive).removeClass(h.options.clsinactive),h.element.trigger("active.uk.sticky"),h.element.css("margin",""),h.options.animation&&h.init&&!t.Utils.isInView(h.wrapper)&&h.element.addClass(h.options.animation),h.currentTop=o}}else null!==h.currentTop&&h.reset();h.init=!0}}var e=t.$win,s=t.$doc,n=[],o=1;return t.component("sticky",{defaults:{top:0,bottom:0,animation:"",clsinit:"uk-sticky-init",clsactive:"uk-active",clsinactive:"",getWidthFrom:"",showup:!1,boundary:!1,media:!1,target:!1,disabled:!1},boot:function(){t.$doc.on("scrolling.uk.document",function(t,e){e&&e.dir&&(o=e.dir.y,i())}),t.$win.on("resize orientationchange",t.Utils.debounce(function(){if(n.length){for(var t=0;t<n.length;t++)n[t].reset(!0),n[t].self.computeWrapper();i()}},100)),t.ready(function(e){setTimeout(function(){t.$("[data-uk-sticky]",e).each(function(){var i=t.$(this);i.data("sticky")||t.sticky(i,t.Utils.options(i.attr("data-uk-sticky")))}),i()},0)})},init:function(){var i,a=this.options.boundary;this.wrapper=this.element.wrap('<div class="uk-sticky-placeholder"></div>').parent(),this.computeWrapper(),this.wrapper.css({"margin-top":this.element.css("margin-top"),"margin-bottom":this.element.css("margin-bottom"),"margin-left":this.element.css("margin-left"),"margin-right":this.element.css("margin-right")}),this.element.css("margin",0),a&&(a===!0||"!"===a[0]?(a=a===!0?this.wrapper.parent():this.wrapper.closest(a.substr(1)),i=!0):"string"==typeof a&&(a=t.$(a))),this.sticky={self:this,options:this.options,element:this.element,currentTop:null,wrapper:this.wrapper,init:!1,getWidthFrom:t.$(this.options.getWidthFrom||this.wrapper),boundary:a,boundtoparent:i,top:0,calcTop:function(){var i=this.options.top;if(this.options.top&&"string"==typeof this.options.top)if(this.options.top.match(/^(-|)(\d+)vh$/))i=window.innerHeight*parseInt(this.options.top,10)/100;else{var e=t.$(this.options.top).first();e.length&&e.is(":visible")&&(i=-1*(e.offset().top+e.outerHeight()-this.wrapper.offset().top))}this.top=i},reset:function(i){this.calcTop();var e=function(){this.element.css({position:"",top:"",width:"",left:"",margin:"0"}),this.element.removeClass([this.options.animation,"uk-animation-reverse",this.options.clsactive].join(" ")),this.element.addClass(this.options.clsinactive),this.element.trigger("inactive.uk.sticky"),this.currentTop=null,this.animate=!1}.bind(this);!i&&this.options.animation&&t.support.animation&&!t.Utils.isInView(this.wrapper)?(this.animate=!0,this.element.removeClass(this.options.animation).one(t.support.animation.end,function(){e()}).width(),this.element.addClass(this.options.animation+" uk-animation-reverse")):e()},check:function(){if(this.options.disabled)return!1;if(this.options.media)switch(typeof this.options.media){case"number":if(window.innerWidth<this.options.media)return!1;break;case"string":if(window.matchMedia&&!window.matchMedia(this.options.media).matches)return!1}var i=e.scrollTop(),n=s.height(),a=n-window.innerHeight,r=i>a?a-i:0,h=this.wrapper.offset().top,p=h-this.top-r,c=i>=p;return c&&this.options.showup&&(1==o&&(c=!1),-1==o&&!this.element.hasClass(this.options.clsactive)&&t.Utils.isInView(this.wrapper)&&(c=!1)),c}},this.sticky.calcTop(),n.push(this.sticky)},update:function(){i(this.sticky)},enable:function(){this.options.disabled=!1,this.update()},disable:function(t){this.options.disabled=!0,this.sticky.reset(t)},computeWrapper:function(){this.wrapper.css({height:-1==["absolute","fixed"].indexOf(this.element.css("position"))?this.element.outerHeight():"","float":"none"!=this.element.css("float")?this.element.css("float"):""}),"fixed"==this.element.css("position")&&this.element.css({width:this.sticky.getWidthFrom.length?this.sticky.getWidthFrom.width():this.element.width()})}}),t.sticky});
|
@ -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-timepicker", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-timepicker', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -30,12 +30,12 @@
|
||||
boot: function() {
|
||||
|
||||
// init code
|
||||
UI.$html.on("focus.timepicker.uikit", "[data-uk-timepicker]", function(e) {
|
||||
UI.$html.on('focus.timepicker.uikit', '[data-uk-timepicker]', function(e) {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("timepicker")) {
|
||||
var obj = UI.timepicker(ele, UI.Utils.options(ele.attr("data-uk-timepicker")));
|
||||
if (!ele.data('timepicker')) {
|
||||
var obj = UI.timepicker(ele, UI.Utils.options(ele.attr('data-uk-timepicker')));
|
||||
|
||||
setTimeout(function(){
|
||||
obj.autocomplete.input.focus();
|
||||
|
4
media/uikit/js/components/timepicker.min.js
vendored
4
media/uikit/js/components/timepicker.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit&&(e=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-timepicker",["uikit"],function(){return e||t(UIkit)})}(function(t){"use strict";function e(t,e){t=t||0,e=e||24;var i,o,a={"12h":[],"24h":[]};for(i=t,o="";e>i;i++)o=""+i,10>i&&(o="0"+o),a["24h"].push({value:o+":00"}),a["24h"].push({value:o+":30"}),0===i&&(o=12,a["12h"].push({value:o+":00 AM"}),a["12h"].push({value:o+":30 AM"})),i>0&&13>i&&12!==i&&(a["12h"].push({value:o+":00 AM"}),a["12h"].push({value:o+":30 AM"})),i>=12&&(o-=12,0===o&&(o=12),10>o&&(o="0"+String(o)),a["12h"].push({value:o+":00 PM"}),a["12h"].push({value:o+":30 PM"}));return a}t.component("timepicker",{defaults:{format:"24h",delay:0,start:0,end:24},boot:function(){t.$html.on("focus.timepicker.uikit","[data-uk-timepicker]",function(){var e=t.$(this);if(!e.data("timepicker")){var i=t.timepicker(e,t.Utils.options(e.attr("data-uk-timepicker")));setTimeout(function(){i.autocomplete.input.focus()},40)}})},init:function(){var i,o=this,a=e(this.options.start,this.options.end);this.options.minLength=0,this.options.template='<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>',this.options.source=function(t){t(a[o.options.format]||a["12h"])},this.element.is("input")?(this.element.wrap('<div class="uk-autocomplete"></div>'),i=this.element.parent()):i=this.element.addClass("uk-autocomplete"),this.autocomplete=t.autocomplete(i,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-small uk-dropdown-scrollable"),this.autocomplete.on("show.uk.autocomplete",function(){var t=o.autocomplete.dropdown.find('[data-value="'+o.autocomplete.input.val()+'"]');setTimeout(function(){o.autocomplete.pick(t,!0)},10)}),this.autocomplete.input.on("focus",function(){o.autocomplete.value=Math.random(),o.autocomplete.triggercomplete()}).on("blur",t.Utils.debounce(function(){o.checkTime()},100)),this.element.data("timepicker",this)},checkTime:function(){var t,e,i,o,a="AM",u=this.autocomplete.input.val();"12h"==this.options.format?(t=u.split(" "),e=t[0].split(":"),a=t[1]):e=u.split(":"),i=parseInt(e[0],10),o=parseInt(e[1],10),isNaN(i)&&(i=0),isNaN(o)&&(o=0),"12h"==this.options.format?(i>12?i=12:0>i&&(i=12),"am"===a||"a"===a?a="AM":("pm"===a||"p"===a)&&(a="PM"),"AM"!==a&&"PM"!==a&&(a="AM")):i>=24?i=23:0>i&&(i=0),0>o?o=0:o>=60&&(o=0),this.autocomplete.input.val(this.formatTime(i,o,a)).trigger("change")},formatTime:function(t,e,i){return t=10>t?"0"+t:t,e=10>e?"0"+e:e,t+":"+e+("12h"==this.options.format?" "+i:"")}})});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var e;window.UIkit2&&(e=t(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-timepicker",["uikit"],function(){return e||t(UIkit2)})}(function(t){"use strict";function e(t,e){t=t||0,e=e||24;var i,o,a={"12h":[],"24h":[]};for(i=t,o="";e>i;i++)o=""+i,10>i&&(o="0"+o),a["24h"].push({value:o+":00"}),a["24h"].push({value:o+":30"}),0===i&&(o=12,a["12h"].push({value:o+":00 AM"}),a["12h"].push({value:o+":30 AM"})),i>0&&13>i&&12!==i&&(a["12h"].push({value:o+":00 AM"}),a["12h"].push({value:o+":30 AM"})),i>=12&&(o-=12,0===o&&(o=12),10>o&&(o="0"+String(o)),a["12h"].push({value:o+":00 PM"}),a["12h"].push({value:o+":30 PM"}));return a}t.component("timepicker",{defaults:{format:"24h",delay:0,start:0,end:24},boot:function(){t.$html.on("focus.timepicker.uikit","[data-uk-timepicker]",function(){var e=t.$(this);if(!e.data("timepicker")){var i=t.timepicker(e,t.Utils.options(e.attr("data-uk-timepicker")));setTimeout(function(){i.autocomplete.input.focus()},40)}})},init:function(){var i,o=this,a=e(this.options.start,this.options.end);this.options.minLength=0,this.options.template='<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>',this.options.source=function(t){t(a[o.options.format]||a["12h"])},this.element.is("input")?(this.element.wrap('<div class="uk-autocomplete"></div>'),i=this.element.parent()):i=this.element.addClass("uk-autocomplete"),this.autocomplete=t.autocomplete(i,this.options),this.autocomplete.dropdown.addClass("uk-dropdown-small uk-dropdown-scrollable"),this.autocomplete.on("show.uk.autocomplete",function(){var t=o.autocomplete.dropdown.find('[data-value="'+o.autocomplete.input.val()+'"]');setTimeout(function(){o.autocomplete.pick(t,!0)},10)}),this.autocomplete.input.on("focus",function(){o.autocomplete.value=Math.random(),o.autocomplete.triggercomplete()}).on("blur",t.Utils.debounce(function(){o.checkTime()},100)),this.element.data("timepicker",this)},checkTime:function(){var t,e,i,o,a="AM",u=this.autocomplete.input.val();"12h"==this.options.format?(t=u.split(" "),e=t[0].split(":"),a=t[1]):e=u.split(":"),i=parseInt(e[0],10),o=parseInt(e[1],10),isNaN(i)&&(i=0),isNaN(o)&&(o=0),"12h"==this.options.format?(i>12?i=12:0>i&&(i=12),"am"===a||"a"===a?a="AM":("pm"===a||"p"===a)&&(a="PM"),"AM"!==a&&"PM"!==a&&(a="AM")):i>=24?i=23:0>i&&(i=0),0>o?o=0:o>=60&&(o=0),this.autocomplete.input.val(this.formatTime(i,o,a)).trigger("change")},formatTime:function(t,e,i){return t=10>t?"0"+t:t,e=10>e?"0"+e:e,t+":"+e+("12h"==this.options.format?" "+i:"")}})});
|
@ -1,14 +1,14 @@
|
||||
/*! 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-tooltip", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-tooltip', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -17,18 +17,18 @@
|
||||
"use strict";
|
||||
|
||||
var $tooltip, // tooltip container
|
||||
tooltipdelay, checkdelay;
|
||||
tooltipdelay, checkIdle;
|
||||
|
||||
UI.component('tooltip', {
|
||||
|
||||
defaults: {
|
||||
"offset": 5,
|
||||
"pos": "top",
|
||||
"animation": false,
|
||||
"delay": 0, // in miliseconds
|
||||
"cls": "",
|
||||
"activeClass": "uk-active",
|
||||
"src": function(ele) {
|
||||
offset: 5,
|
||||
pos: 'top',
|
||||
animation: false,
|
||||
delay: 0, // in miliseconds
|
||||
cls: '',
|
||||
activeClass: 'uk-active',
|
||||
src: function(ele) {
|
||||
var title = ele.attr('title');
|
||||
|
||||
if (title !== undefined) {
|
||||
@ -39,17 +39,17 @@
|
||||
}
|
||||
},
|
||||
|
||||
tip: "",
|
||||
tip: '',
|
||||
|
||||
boot: function() {
|
||||
|
||||
// init code
|
||||
UI.$html.on("mouseenter.tooltip.uikit focus.tooltip.uikit", "[data-uk-tooltip]", function(e) {
|
||||
UI.$html.on('mouseenter.tooltip.uikit focus.tooltip.uikit', '[data-uk-tooltip]', function(e) {
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("tooltip")) {
|
||||
UI.tooltip(ele, UI.Utils.options(ele.attr("data-uk-tooltip")));
|
||||
ele.trigger("mouseenter");
|
||||
if (!ele.data('tooltip')) {
|
||||
UI.tooltip(ele, UI.Utils.options(ele.attr('data-uk-tooltip')));
|
||||
ele.trigger('mouseenter');
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -72,14 +72,14 @@
|
||||
|
||||
show: function() {
|
||||
|
||||
this.tip = typeof(this.options.src) === "function" ? this.options.src(this.element) : this.options.src;
|
||||
this.tip = typeof(this.options.src) === 'function' ? this.options.src(this.element) : this.options.src;
|
||||
|
||||
if (tooltipdelay) clearTimeout(tooltipdelay);
|
||||
if (checkdelay) clearTimeout(checkdelay);
|
||||
if (tooltipdelay) clearTimeout(tooltipdelay);
|
||||
if (checkIdle) clearInterval(checkIdle);
|
||||
|
||||
if (typeof(this.tip) === 'string' ? !this.tip.length:true) return;
|
||||
|
||||
$tooltip.stop().css({"top": -2000, "visibility": "hidden"}).removeClass(this.options.activeClass).show();
|
||||
$tooltip.stop().css({top: -2000, visibility: 'hidden'}).removeClass(this.options.activeClass).show();
|
||||
$tooltip.html('<div class="uk-tooltip-inner">' + this.tip + '</div>');
|
||||
|
||||
var $this = this,
|
||||
@ -90,10 +90,10 @@
|
||||
position = typeof(this.options.pos) === "function" ? this.options.pos.call(this.element) : this.options.pos,
|
||||
tmppos = position.split("-"),
|
||||
tcss = {
|
||||
"display" : "none",
|
||||
"visibility" : "visible",
|
||||
"top" : (pos.top + pos.height + height),
|
||||
"left" : pos.left
|
||||
display : 'none',
|
||||
visibility : 'visible',
|
||||
top : (pos.top + pos.height + height),
|
||||
left : pos.left
|
||||
};
|
||||
|
||||
|
||||
@ -102,22 +102,22 @@
|
||||
if (UI.$html.css('position')=='fixed' || UI.$body.css('position')=='fixed'){
|
||||
var bodyoffset = UI.$('body').offset(),
|
||||
htmloffset = UI.$('html').offset(),
|
||||
docoffset = {'top': (htmloffset.top + bodyoffset.top), 'left': (htmloffset.left + bodyoffset.left)};
|
||||
docoffset = {top: (htmloffset.top + bodyoffset.top), left: (htmloffset.left + bodyoffset.left)};
|
||||
|
||||
pos.left -= docoffset.left;
|
||||
pos.top -= docoffset.top;
|
||||
}
|
||||
|
||||
|
||||
if ((tmppos[0] == "left" || tmppos[0] == "right") && UI.langdirection == 'right') {
|
||||
tmppos[0] = tmppos[0] == "left" ? "right" : "left";
|
||||
if ((tmppos[0] == 'left' || tmppos[0] == 'right') && UI.langdirection == 'right') {
|
||||
tmppos[0] = tmppos[0] == 'left' ? 'right' : 'left';
|
||||
}
|
||||
|
||||
var variants = {
|
||||
"bottom" : {top: pos.top + pos.height + offset, left: pos.left + pos.width / 2 - width / 2},
|
||||
"top" : {top: pos.top - height - offset, left: pos.left + pos.width / 2 - width / 2},
|
||||
"left" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left - width - offset},
|
||||
"right" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left + pos.width + offset}
|
||||
bottom : {top: pos.top + pos.height + offset, left: pos.left + pos.width / 2 - width / 2},
|
||||
top : {top: pos.top - height - offset, left: pos.left + pos.width / 2 - width / 2},
|
||||
left : {top: pos.top + pos.height / 2 - height / 2, left: pos.left - width - offset},
|
||||
right : {top: pos.top + pos.height / 2 - height / 2, left: pos.left + pos.width + offset}
|
||||
};
|
||||
|
||||
UI.$.extend(tcss, variants[tmppos[0]]);
|
||||
@ -129,37 +129,37 @@
|
||||
if(boundary) {
|
||||
|
||||
switch(boundary) {
|
||||
case "x":
|
||||
case 'x':
|
||||
|
||||
if (tmppos.length == 2) {
|
||||
position = tmppos[0]+"-"+(tcss.left < 0 ? "left": "right");
|
||||
position = tmppos[0]+"-"+(tcss.left < 0 ? 'left': 'right');
|
||||
} else {
|
||||
position = tcss.left < 0 ? "right": "left";
|
||||
position = tcss.left < 0 ? 'right': 'left';
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "y":
|
||||
case 'y':
|
||||
if (tmppos.length == 2) {
|
||||
position = (tcss.top < 0 ? "bottom": "top")+"-"+tmppos[1];
|
||||
position = (tcss.top < 0 ? 'bottom': 'top')+'-'+tmppos[1];
|
||||
} else {
|
||||
position = (tcss.top < 0 ? "bottom": "top");
|
||||
position = (tcss.top < 0 ? 'bottom': 'top');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case "xy":
|
||||
case 'xy':
|
||||
if (tmppos.length == 2) {
|
||||
position = (tcss.top < 0 ? "bottom": "top")+"-"+(tcss.left < 0 ? "left": "right");
|
||||
position = (tcss.top < 0 ? 'bottom': 'top')+'-'+(tcss.left < 0 ? 'left': 'right');
|
||||
} else {
|
||||
position = tcss.left < 0 ? "right": "left";
|
||||
position = tcss.left < 0 ? 'right': 'left';
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
tmppos = position.split("-");
|
||||
tmppos = position.split('-');
|
||||
|
||||
UI.$.extend(tcss, variants[tmppos[0]]);
|
||||
|
||||
@ -171,7 +171,7 @@
|
||||
|
||||
tooltipdelay = setTimeout(function(){
|
||||
|
||||
$tooltip.css(tcss).attr("class", ["uk-tooltip", "uk-tooltip-"+position, $this.options.cls].join(' '));
|
||||
$tooltip.css(tcss).attr('class', ['uk-tooltip', 'uk-tooltip-'+position, $this.options.cls].join(' '));
|
||||
|
||||
if ($this.options.animation) {
|
||||
$tooltip.css({opacity: 0, display: 'block'}).addClass($this.options.activeClass).animate({opacity: 1}, parseInt($this.options.animation, 10) || 400);
|
||||
@ -182,7 +182,7 @@
|
||||
tooltipdelay = false;
|
||||
|
||||
// close tooltip if element was removed or hidden
|
||||
checkdelay = setInterval(function(){
|
||||
checkIdle = setInterval(function(){
|
||||
if(!$this.element.is(':visible')) $this.hide();
|
||||
}, 150);
|
||||
|
||||
@ -190,10 +190,11 @@
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
if(this.element.is("input") && this.element[0]===document.activeElement) return;
|
||||
|
||||
if(tooltipdelay) clearTimeout(tooltipdelay);
|
||||
if (checkdelay) clearTimeout(checkdelay);
|
||||
if (this.element.is('input') && this.element[0]===document.activeElement) return;
|
||||
|
||||
if (tooltipdelay) clearTimeout(tooltipdelay);
|
||||
if (checkIdle) clearInterval(checkIdle);
|
||||
|
||||
$tooltip.stop();
|
||||
|
||||
|
4
media/uikit/js/components/tooltip.min.js
vendored
4
media/uikit/js/components/tooltip.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit&&(i=t(UIkit)),"function"==typeof define&&define.amd&&define("uikit-tooltip",["uikit"],function(){return i||t(UIkit)})}(function(t){"use strict";var i,o,e;return t.component("tooltip",{defaults:{offset:5,pos:"top",animation:!1,delay:0,cls:"",activeClass:"uk-active",src:function(t){var i=t.attr("title");return void 0!==i&&t.data("cached-title",i).removeAttr("title"),t.data("cached-title")}},tip:"",boot:function(){t.$html.on("mouseenter.tooltip.uikit focus.tooltip.uikit","[data-uk-tooltip]",function(){var i=t.$(this);i.data("tooltip")||(t.tooltip(i,t.Utils.options(i.attr("data-uk-tooltip"))),i.trigger("mouseenter"))})},init:function(){var o=this;i||(i=t.$('<div class="uk-tooltip"></div>').appendTo("body")),this.on({focus:function(){o.show()},blur:function(){o.hide()},mouseenter:function(){o.show()},mouseleave:function(){o.hide()}})},show:function(){if(this.tip="function"==typeof this.options.src?this.options.src(this.element):this.options.src,o&&clearTimeout(o),e&&clearTimeout(e),"string"==typeof this.tip?this.tip.length:0){i.stop().css({top:-2e3,visibility:"hidden"}).removeClass(this.options.activeClass).show(),i.html('<div class="uk-tooltip-inner">'+this.tip+"</div>");var s=this,n=t.$.extend({},this.element.offset(),{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}),l=i[0].offsetWidth,f=i[0].offsetHeight,p="function"==typeof this.options.offset?this.options.offset.call(this.element):this.options.offset,a="function"==typeof this.options.pos?this.options.pos.call(this.element):this.options.pos,h=a.split("-"),c={display:"none",visibility:"visible",top:n.top+n.height+f,left:n.left};if("fixed"==t.$html.css("position")||"fixed"==t.$body.css("position")){var r=t.$("body").offset(),d=t.$("html").offset(),u={top:d.top+r.top,left:d.left+r.left};n.left-=u.left,n.top-=u.top}"left"!=h[0]&&"right"!=h[0]||"right"!=t.langdirection||(h[0]="left"==h[0]?"right":"left");var m={bottom:{top:n.top+n.height+p,left:n.left+n.width/2-l/2},top:{top:n.top-f-p,left:n.left+n.width/2-l/2},left:{top:n.top+n.height/2-f/2,left:n.left-l-p},right:{top:n.top+n.height/2-f/2,left:n.left+n.width+p}};t.$.extend(c,m[h[0]]),2==h.length&&(c.left="left"==h[1]?n.left:n.left+n.width-l);var v=this.checkBoundary(c.left,c.top,l,f);if(v){switch(v){case"x":a=2==h.length?h[0]+"-"+(c.left<0?"left":"right"):c.left<0?"right":"left";break;case"y":a=2==h.length?(c.top<0?"bottom":"top")+"-"+h[1]:c.top<0?"bottom":"top";break;case"xy":a=2==h.length?(c.top<0?"bottom":"top")+"-"+(c.left<0?"left":"right"):c.left<0?"right":"left"}h=a.split("-"),t.$.extend(c,m[h[0]]),2==h.length&&(c.left="left"==h[1]?n.left:n.left+n.width-l)}c.left-=t.$body.position().left,o=setTimeout(function(){i.css(c).attr("class",["uk-tooltip","uk-tooltip-"+a,s.options.cls].join(" ")),s.options.animation?i.css({opacity:0,display:"block"}).addClass(s.options.activeClass).animate({opacity:1},parseInt(s.options.animation,10)||400):i.show().addClass(s.options.activeClass),o=!1,e=setInterval(function(){s.element.is(":visible")||s.hide()},150)},parseInt(this.options.delay,10)||0)}},hide:function(){if(!this.element.is("input")||this.element[0]!==document.activeElement)if(o&&clearTimeout(o),e&&clearTimeout(e),i.stop(),this.options.animation){var t=this;i.fadeOut(parseInt(this.options.animation,10)||400,function(){i.removeClass(t.options.activeClass)})}else i.hide().removeClass(this.options.activeClass)},content:function(){return this.tip},checkBoundary:function(i,o,e,s){var n="";return(0>i||i-t.$win.scrollLeft()+e>window.innerWidth)&&(n+="x"),(0>o||o-t.$win.scrollTop()+s>window.innerHeight)&&(n+="y"),n}}),t.tooltip});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){var i;window.UIkit2&&(i=t(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-tooltip",["uikit"],function(){return i||t(UIkit2)})}(function(t){"use strict";var i,o,e;return t.component("tooltip",{defaults:{offset:5,pos:"top",animation:!1,delay:0,cls:"",activeClass:"uk-active",src:function(t){var i=t.attr("title");return void 0!==i&&t.data("cached-title",i).removeAttr("title"),t.data("cached-title")}},tip:"",boot:function(){t.$html.on("mouseenter.tooltip.uikit focus.tooltip.uikit","[data-uk-tooltip]",function(){var i=t.$(this);i.data("tooltip")||(t.tooltip(i,t.Utils.options(i.attr("data-uk-tooltip"))),i.trigger("mouseenter"))})},init:function(){var o=this;i||(i=t.$('<div class="uk-tooltip"></div>').appendTo("body")),this.on({focus:function(){o.show()},blur:function(){o.hide()},mouseenter:function(){o.show()},mouseleave:function(){o.hide()}})},show:function(){if(this.tip="function"==typeof this.options.src?this.options.src(this.element):this.options.src,o&&clearTimeout(o),e&&clearInterval(e),"string"==typeof this.tip?this.tip.length:0){i.stop().css({top:-2e3,visibility:"hidden"}).removeClass(this.options.activeClass).show(),i.html('<div class="uk-tooltip-inner">'+this.tip+"</div>");var s=this,n=t.$.extend({},this.element.offset(),{width:this.element[0].offsetWidth,height:this.element[0].offsetHeight}),l=i[0].offsetWidth,f=i[0].offsetHeight,a="function"==typeof this.options.offset?this.options.offset.call(this.element):this.options.offset,p="function"==typeof this.options.pos?this.options.pos.call(this.element):this.options.pos,h=p.split("-"),c={display:"none",visibility:"visible",top:n.top+n.height+f,left:n.left};if("fixed"==t.$html.css("position")||"fixed"==t.$body.css("position")){var r=t.$("body").offset(),d=t.$("html").offset(),u={top:d.top+r.top,left:d.left+r.left};n.left-=u.left,n.top-=u.top}"left"!=h[0]&&"right"!=h[0]||"right"!=t.langdirection||(h[0]="left"==h[0]?"right":"left");var m={bottom:{top:n.top+n.height+a,left:n.left+n.width/2-l/2},top:{top:n.top-f-a,left:n.left+n.width/2-l/2},left:{top:n.top+n.height/2-f/2,left:n.left-l-a},right:{top:n.top+n.height/2-f/2,left:n.left+n.width+a}};t.$.extend(c,m[h[0]]),2==h.length&&(c.left="left"==h[1]?n.left:n.left+n.width-l);var v=this.checkBoundary(c.left,c.top,l,f);if(v){switch(v){case"x":p=2==h.length?h[0]+"-"+(c.left<0?"left":"right"):c.left<0?"right":"left";break;case"y":p=2==h.length?(c.top<0?"bottom":"top")+"-"+h[1]:c.top<0?"bottom":"top";break;case"xy":p=2==h.length?(c.top<0?"bottom":"top")+"-"+(c.left<0?"left":"right"):c.left<0?"right":"left"}h=p.split("-"),t.$.extend(c,m[h[0]]),2==h.length&&(c.left="left"==h[1]?n.left:n.left+n.width-l)}c.left-=t.$body.position().left,o=setTimeout(function(){i.css(c).attr("class",["uk-tooltip","uk-tooltip-"+p,s.options.cls].join(" ")),s.options.animation?i.css({opacity:0,display:"block"}).addClass(s.options.activeClass).animate({opacity:1},parseInt(s.options.animation,10)||400):i.show().addClass(s.options.activeClass),o=!1,e=setInterval(function(){s.element.is(":visible")||s.hide()},150)},parseInt(this.options.delay,10)||0)}},hide:function(){if(!this.element.is("input")||this.element[0]!==document.activeElement)if(o&&clearTimeout(o),e&&clearInterval(e),i.stop(),this.options.animation){var t=this;i.fadeOut(parseInt(this.options.animation,10)||400,function(){i.removeClass(t.options.activeClass)})}else i.hide().removeClass(this.options.activeClass)},content:function(){return this.tip},checkBoundary:function(i,o,e,s){var n="";return(0>i||i-t.$win.scrollLeft()+e>window.innerWidth)&&(n+="x"),(0>o||o-t.$win.scrollTop()+s>window.innerHeight)&&(n+="y"),n}}),t.tooltip});
|
@ -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-upload", ["uikit"], function(){
|
||||
return component || addon(UIkit);
|
||||
if (typeof define == 'function' && define.amd) {
|
||||
define('uikit-upload', ['uikit'], function(){
|
||||
return component || addon(UIkit2);
|
||||
});
|
||||
}
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.on("change", function() {
|
||||
this.on('change', function() {
|
||||
xhrupload($this.element[0].files, $this.options);
|
||||
var twin = $this.element.clone(true).data('uploadSelect', $this);
|
||||
$this.element.replaceWith(twin);
|
||||
@ -42,23 +42,23 @@
|
||||
|
||||
var $this = this, hasdragCls = false;
|
||||
|
||||
this.on("drop", function(e){
|
||||
this.on('drop', function(e){
|
||||
|
||||
if (e.dataTransfer && e.dataTransfer.files) {
|
||||
if (e.originalEvent.dataTransfer && e.originalEvent.dataTransfer.files) {
|
||||
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
$this.element.removeClass($this.options.dragoverClass);
|
||||
$this.element.trigger('dropped.uk.upload', [e.dataTransfer.files]);
|
||||
$this.element.trigger('dropped.uk.upload', [e.originalEvent.dataTransfer.files]);
|
||||
|
||||
xhrupload(e.dataTransfer.files, $this.options);
|
||||
xhrupload(e.originalEvent.dataTransfer.files, $this.options);
|
||||
}
|
||||
|
||||
}).on("dragenter", function(e){
|
||||
}).on('dragenter', function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}).on("dragover", function(e){
|
||||
}).on('dragover', function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
@ -66,7 +66,7 @@
|
||||
$this.element.addClass($this.options.dragoverClass);
|
||||
hasdragCls = true;
|
||||
}
|
||||
}).on("dragleave", function(e){
|
||||
}).on('dragleave', function(e){
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
$this.element.removeClass($this.options.dragoverClass);
|
||||
@ -93,9 +93,6 @@
|
||||
return supportFileAPI() && supportAjaxUploadProgressEvents() && supportFormData();
|
||||
})();
|
||||
|
||||
if (UI.support.ajaxupload){
|
||||
UI.$.event.props.push("dataTransfer");
|
||||
}
|
||||
|
||||
function xhrupload(files, settings) {
|
||||
|
||||
@ -175,21 +172,25 @@
|
||||
for (var p in settings.params) { formData.append(p, settings.params[p]); }
|
||||
|
||||
// Add any event handlers here...
|
||||
xhr.upload.addEventListener("progress", function(e){
|
||||
xhr.upload.addEventListener('progress', function(e){
|
||||
var percent = (e.loaded / e.total)*100;
|
||||
settings.progress(percent, e);
|
||||
}, false);
|
||||
|
||||
xhr.addEventListener("loadstart", function(e){ settings.loadstart(e); }, false);
|
||||
xhr.addEventListener("load", function(e){ settings.load(e); }, false);
|
||||
xhr.addEventListener("loadend", function(e){ settings.loadend(e); }, false);
|
||||
xhr.addEventListener("error", function(e){ settings.error(e); }, false);
|
||||
xhr.addEventListener("abort", function(e){ settings.abort(e); }, false);
|
||||
xhr.addEventListener('loadstart', function(e){ settings.loadstart(e); }, false);
|
||||
xhr.addEventListener('load', function(e){ settings.load(e); }, false);
|
||||
xhr.addEventListener('loadend', function(e){ settings.loadend(e); }, false);
|
||||
xhr.addEventListener('error', function(e){ settings.error(e); }, false);
|
||||
xhr.addEventListener('abort', function(e){ settings.abort(e); }, false);
|
||||
|
||||
xhr.open(settings.method, settings.action, true);
|
||||
|
||||
if (settings.type=="json") {
|
||||
xhr.setRequestHeader("Accept", "application/json");
|
||||
if (settings.type=='json') {
|
||||
xhr.setRequestHeader('Accept', 'application/json');
|
||||
}
|
||||
|
||||
for (var h in settings.headers) {
|
||||
xhr.setRequestHeader(h, settings.headers[h]);
|
||||
}
|
||||
|
||||
xhr.onreadystatechange = function() {
|
||||
@ -200,7 +201,7 @@
|
||||
|
||||
var response = xhr.responseText;
|
||||
|
||||
if (settings.type=="json") {
|
||||
if (settings.type=='json') {
|
||||
try {
|
||||
response = UI.$.parseJSON(response);
|
||||
} catch(e) {
|
||||
@ -217,29 +218,30 @@
|
||||
}
|
||||
|
||||
xhrupload.defaults = {
|
||||
'action': '',
|
||||
'single': true,
|
||||
'method': 'POST',
|
||||
'param' : 'files[]',
|
||||
'params': {},
|
||||
'allow' : '*.*',
|
||||
'type' : 'text',
|
||||
'filelimit': false,
|
||||
action: '',
|
||||
single: true,
|
||||
method: 'POST',
|
||||
param : 'files[]',
|
||||
params: {},
|
||||
allow : '*.*',
|
||||
type : 'text',
|
||||
filelimit: false,
|
||||
headers: {},
|
||||
|
||||
// events
|
||||
'before' : function(o){},
|
||||
'beforeSend' : function(xhr){},
|
||||
'beforeAll' : function(){},
|
||||
'loadstart' : function(){},
|
||||
'load' : function(){},
|
||||
'loadend' : function(){},
|
||||
'error' : function(){},
|
||||
'abort' : function(){},
|
||||
'progress' : function(){},
|
||||
'complete' : function(){},
|
||||
'allcomplete' : function(){},
|
||||
'readystatechange': function(){},
|
||||
'notallowed' : function(file, settings){ alert('Only the following file types are allowed: '+settings.allow); }
|
||||
before : function(o){},
|
||||
beforeSend : function(xhr){},
|
||||
beforeAll : function(){},
|
||||
loadstart : function(){},
|
||||
load : function(){},
|
||||
loadend : function(){},
|
||||
error : function(){},
|
||||
abort : function(){},
|
||||
progress : function(){},
|
||||
complete : function(){},
|
||||
allcomplete : function(){},
|
||||
readystatechange: function(){},
|
||||
notallowed : function(file, settings){ alert('Only the following file types are allowed: '+settings.allow); }
|
||||
};
|
||||
|
||||
function matchName(pattern, path) {
|
||||
|
4
media/uikit/js/components/upload.min.js
vendored
4
media/uikit/js/components/upload.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(e){var t;window.UIkit&&(t=e(UIkit)),"function"==typeof define&&define.amd&&define("uikit-upload",["uikit"],function(){return t||e(UIkit)})}(function(e){"use strict";function t(o,a){function r(t,n){var o=new FormData,a=new XMLHttpRequest;if(n.before(n,t)!==!1){for(var r,i=0;r=t[i];i++)o.append(n.param,r);for(var l in n.params)o.append(l,n.params[l]);a.upload.addEventListener("progress",function(e){var t=e.loaded/e.total*100;n.progress(t,e)},!1),a.addEventListener("loadstart",function(e){n.loadstart(e)},!1),a.addEventListener("load",function(e){n.load(e)},!1),a.addEventListener("loadend",function(e){n.loadend(e)},!1),a.addEventListener("error",function(e){n.error(e)},!1),a.addEventListener("abort",function(e){n.abort(e)},!1),a.open(n.method,n.action,!0),"json"==n.type&&a.setRequestHeader("Accept","application/json"),a.onreadystatechange=function(){if(n.readystatechange(a),4==a.readyState){var t=a.responseText;if("json"==n.type)try{t=e.$.parseJSON(t)}catch(o){t=!1}n.complete(t,a)}},n.beforeSend(a),a.send(o)}}if(!e.support.ajaxupload)return this;if(a=e.$.extend({},t.defaults,a),o.length){if("*.*"!==a.allow)for(var i,l=0;i=o[l];l++)if(!n(a.allow,i.name))return"string"==typeof a.notallowed?alert(a.notallowed):a.notallowed(i,a),void 0;var s=a.complete;if(a.single){var d=o.length,f=0,p=!0;a.beforeAll(o),a.complete=function(e,t){f+=1,s(e,t),a.filelimit&&f>=a.filelimit&&(p=!1),p&&d>f?r([o[f]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){s(e,t),a.allcomplete(e,t)},r(o,a)}}function n(e,t){var n="^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return n="^"+n+"$",null!==t.match(new RegExp(n,"i"))}return e.component("uploadSelect",{init:function(){var e=this;this.on("change",function(){t(e.element[0].files,e.options);var n=e.element.clone(!0).data("uploadSelect",e);e.element.replaceWith(n),e.element=n})}}),e.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var e=this,n=!1;this.on("drop",function(n){n.dataTransfer&&n.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.dataTransfer.files]),t(n.dataTransfer.files,e.options))}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}).on("dragover",function(t){t.stopPropagation(),t.preventDefault(),n||(e.element.addClass(e.options.dragoverClass),n=!0)}).on("dragleave",function(t){t.stopPropagation(),t.preventDefault(),e.element.removeClass(e.options.dragoverClass),n=!1})}}),e.support.ajaxupload=function(){function e(){var e=document.createElement("INPUT");return e.type="file","files"in e}function t(){var e=new XMLHttpRequest;return!!(e&&"upload"in e&&"onprogress"in e.upload)}function n(){return!!window.FormData}return e()&&t()&&n()}(),e.support.ajaxupload&&e.$.event.props.push("dataTransfer"),t.defaults={action:"",single:!0,method:"POST",param:"files[]",params:{},allow:"*.*",type:"text",filelimit:!1,before:function(){},beforeSend:function(){},beforeAll:function(){},loadstart:function(){},load:function(){},loadend:function(){},error:function(){},abort:function(){},progress:function(){},complete:function(){},allcomplete:function(){},readystatechange:function(){},notallowed:function(e,t){alert("Only the following file types are allowed: "+t.allow)}},e.Utils.xhrupload=t,t});
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(e){var t;window.UIkit2&&(t=e(UIkit2)),"function"==typeof define&&define.amd&&define("uikit-upload",["uikit"],function(){return t||e(UIkit2)})}(function(e){"use strict";function t(o,a){function r(t,n){var o=new FormData,a=new XMLHttpRequest;if(n.before(n,t)!==!1){for(var r,i=0;r=t[i];i++)o.append(n.param,r);for(var l in n.params)o.append(l,n.params[l]);a.upload.addEventListener("progress",function(e){var t=e.loaded/e.total*100;n.progress(t,e)},!1),a.addEventListener("loadstart",function(e){n.loadstart(e)},!1),a.addEventListener("load",function(e){n.load(e)},!1),a.addEventListener("loadend",function(e){n.loadend(e)},!1),a.addEventListener("error",function(e){n.error(e)},!1),a.addEventListener("abort",function(e){n.abort(e)},!1),a.open(n.method,n.action,!0),"json"==n.type&&a.setRequestHeader("Accept","application/json");for(var s in n.headers)a.setRequestHeader(s,n.headers[s]);a.onreadystatechange=function(){if(n.readystatechange(a),4==a.readyState){var t=a.responseText;if("json"==n.type)try{t=e.$.parseJSON(t)}catch(o){t=!1}n.complete(t,a)}},n.beforeSend(a),a.send(o)}}if(!e.support.ajaxupload)return this;if(a=e.$.extend({},t.defaults,a),o.length){if("*.*"!==a.allow)for(var i,l=0;i=o[l];l++)if(!n(a.allow,i.name))return"string"==typeof a.notallowed?alert(a.notallowed):a.notallowed(i,a),void 0;var s=a.complete;if(a.single){var d=o.length,f=0,p=!0;a.beforeAll(o),a.complete=function(e,t){f+=1,s(e,t),a.filelimit&&f>=a.filelimit&&(p=!1),p&&d>f?r([o[f]],a):a.allcomplete(e,t)},r([o[0]],a)}else a.complete=function(e,t){s(e,t),a.allcomplete(e,t)},r(o,a)}}function n(e,t){var n="^"+e.replace(/\//g,"\\/").replace(/\*\*/g,"(\\/[^\\/]+)*").replace(/\*/g,"[^\\/]+").replace(/((?!\\))\?/g,"$1.")+"$";return n="^"+n+"$",null!==t.match(new RegExp(n,"i"))}return e.component("uploadSelect",{init:function(){var e=this;this.on("change",function(){t(e.element[0].files,e.options);var n=e.element.clone(!0).data("uploadSelect",e);e.element.replaceWith(n),e.element=n})}}),e.component("uploadDrop",{defaults:{dragoverClass:"uk-dragover"},init:function(){var e=this,n=!1;this.on("drop",function(n){n.originalEvent.dataTransfer&&n.originalEvent.dataTransfer.files&&(n.stopPropagation(),n.preventDefault(),e.element.removeClass(e.options.dragoverClass),e.element.trigger("dropped.uk.upload",[n.originalEvent.dataTransfer.files]),t(n.originalEvent.dataTransfer.files,e.options))}).on("dragenter",function(e){e.stopPropagation(),e.preventDefault()}).on("dragover",function(t){t.stopPropagation(),t.preventDefault(),n||(e.element.addClass(e.options.dragoverClass),n=!0)}).on("dragleave",function(t){t.stopPropagation(),t.preventDefault(),e.element.removeClass(e.options.dragoverClass),n=!1})}}),e.support.ajaxupload=function(){function e(){var e=document.createElement("INPUT");return e.type="file","files"in e}function t(){var e=new XMLHttpRequest;return!!(e&&"upload"in e&&"onprogress"in e.upload)}function n(){return!!window.FormData}return e()&&t()&&n()}(),t.defaults={action:"",single:!0,method:"POST",param:"files[]",params:{},allow:"*.*",type:"text",filelimit:!1,headers:{},before:function(){},beforeSend:function(){},beforeAll:function(){},loadstart:function(){},load:function(){},loadend:function(){},error:function(){},abort:function(){},progress:function(){},complete:function(){},allcomplete:function(){},readystatechange:function(){},notallowed:function(e,t){alert("Only the following file types are allowed: "+t.allow)}},e.Utils.xhrupload=t,t});
|
@ -1,4 +1,4 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
@ -6,21 +6,21 @@
|
||||
UI.component('alert', {
|
||||
|
||||
defaults: {
|
||||
"fade": true,
|
||||
"duration": 200,
|
||||
"trigger": ".uk-alert-close"
|
||||
fade: true,
|
||||
duration: 200,
|
||||
trigger: '.uk-alert-close'
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
|
||||
// init code
|
||||
UI.$html.on("click.alert.uikit", "[data-uk-alert]", function(e) {
|
||||
UI.$html.on('click.alert.uikit', '[data-uk-alert]', function(e) {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("alert")) {
|
||||
if (!ele.data('alert')) {
|
||||
|
||||
var alert = UI.alert(ele, UI.Utils.options(ele.attr("data-uk-alert")));
|
||||
var alert = UI.alert(ele, UI.Utils.options(ele.attr('data-uk-alert')));
|
||||
|
||||
if (UI.$(e.target).is(alert.options.trigger)) {
|
||||
e.preventDefault();
|
||||
@ -34,7 +34,7 @@
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.on("click", this.options.trigger, function(e) {
|
||||
this.on('click', this.options.trigger, function(e) {
|
||||
e.preventDefault();
|
||||
$this.close();
|
||||
});
|
||||
@ -42,19 +42,19 @@
|
||||
|
||||
close: function() {
|
||||
|
||||
var element = this.trigger("close.uk.alert"),
|
||||
var element = this.trigger('close.uk.alert'),
|
||||
removeElement = function () {
|
||||
this.trigger("closed.uk.alert").remove();
|
||||
this.trigger('closed.uk.alert').remove();
|
||||
}.bind(this);
|
||||
|
||||
if (this.options.fade) {
|
||||
element.css("overflow", "hidden").css("max-height", element.height()).animate({
|
||||
"height" : 0,
|
||||
"opacity" : 0,
|
||||
"padding-top" : 0,
|
||||
"padding-bottom" : 0,
|
||||
"margin-top" : 0,
|
||||
"margin-bottom" : 0
|
||||
element.css('overflow', 'hidden').css("max-height", element.height()).animate({
|
||||
height : 0,
|
||||
opacity : 0,
|
||||
paddingTop : 0,
|
||||
paddingBottom : 0,
|
||||
marginTop : 0,
|
||||
marginBottom : 0
|
||||
}, this.options.duration, removeElement);
|
||||
} else {
|
||||
removeElement();
|
||||
@ -63,4 +63,4 @@
|
||||
|
||||
});
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/alert.min.js
vendored
4
media/uikit/js/core/alert.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";t.component("alert",{defaults:{fade:!0,duration:200,trigger:".uk-alert-close"},boot:function(){t.$html.on("click.alert.uikit","[data-uk-alert]",function(i){var o=t.$(this);if(!o.data("alert")){var e=t.alert(o,t.Utils.options(o.attr("data-uk-alert")));t.$(i.target).is(e.options.trigger)&&(i.preventDefault(),e.close())}})},init:function(){var t=this;this.on("click",this.options.trigger,function(i){i.preventDefault(),t.close()})},close:function(){var t=this.trigger("close.uk.alert"),i=function(){this.trigger("closed.uk.alert").remove()}.bind(this);this.options.fade?t.css("overflow","hidden").css("max-height",t.height()).animate({height:0,opacity:0,"padding-top":0,"padding-bottom":0,"margin-top":0,"margin-bottom":0},this.options.duration,i):i()}})}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";t.component("alert",{defaults:{fade:!0,duration:200,trigger:".uk-alert-close"},boot:function(){t.$html.on("click.alert.uikit","[data-uk-alert]",function(i){var o=t.$(this);if(!o.data("alert")){var e=t.alert(o,t.Utils.options(o.attr("data-uk-alert")));t.$(i.target).is(e.options.trigger)&&(i.preventDefault(),e.close())}})},init:function(){var t=this;this.on("click",this.options.trigger,function(i){i.preventDefault(),t.close()})},close:function(){var t=this.trigger("close.uk.alert"),i=function(){this.trigger("closed.uk.alert").remove()}.bind(this);this.options.fade?t.css("overflow","hidden").css("max-height",t.height()).animate({height:0,opacity:0,paddingTop:0,paddingBottom:0,marginTop:0,marginBottom:0},this.options.duration,i):i()}})}(UIkit2);
|
@ -1,4 +1,4 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
@ -6,24 +6,24 @@
|
||||
UI.component('buttonRadio', {
|
||||
|
||||
defaults: {
|
||||
"activeClass": 'uk-active',
|
||||
"target": ".uk-button"
|
||||
activeClass: 'uk-active',
|
||||
target: '.uk-button'
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
|
||||
// init code
|
||||
UI.$html.on("click.buttonradio.uikit", "[data-uk-button-radio]", function(e) {
|
||||
UI.$html.on('click.buttonradio.uikit', '[data-uk-button-radio]', function(e) {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("buttonRadio")) {
|
||||
if (!ele.data('buttonRadio')) {
|
||||
|
||||
var obj = UI.buttonRadio(ele, UI.Utils.options(ele.attr("data-uk-button-radio"))),
|
||||
var obj = UI.buttonRadio(ele, UI.Utils.options(ele.attr('data-uk-button-radio'))),
|
||||
target = UI.$(e.target);
|
||||
|
||||
if (target.is(obj.options.target)) {
|
||||
target.trigger("click");
|
||||
target.trigger('click');
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -36,7 +36,7 @@
|
||||
// Init ARIA
|
||||
this.find($this.options.target).attr('aria-checked', 'false').filter('.' + $this.options.activeClass).attr('aria-checked', 'true');
|
||||
|
||||
this.on("click", this.options.target, function(e) {
|
||||
this.on('click', this.options.target, function(e) {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
@ -49,7 +49,7 @@
|
||||
$this.find($this.options.target).not(ele).attr('aria-checked', 'false');
|
||||
ele.attr('aria-checked', 'true');
|
||||
|
||||
$this.trigger("change.uk.button", [ele]);
|
||||
$this.trigger('change.uk.button', [ele]);
|
||||
});
|
||||
|
||||
},
|
||||
@ -62,22 +62,22 @@
|
||||
UI.component('buttonCheckbox', {
|
||||
|
||||
defaults: {
|
||||
"activeClass": 'uk-active',
|
||||
"target": ".uk-button"
|
||||
activeClass: 'uk-active',
|
||||
target: '.uk-button'
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
|
||||
UI.$html.on("click.buttoncheckbox.uikit", "[data-uk-button-checkbox]", function(e) {
|
||||
UI.$html.on('click.buttoncheckbox.uikit', '[data-uk-button-checkbox]', function(e) {
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("buttonCheckbox")) {
|
||||
if (!ele.data('buttonCheckbox')) {
|
||||
|
||||
var obj = UI.buttonCheckbox(ele, UI.Utils.options(ele.attr("data-uk-button-checkbox"))),
|
||||
var obj = UI.buttonCheckbox(ele, UI.Utils.options(ele.attr('data-uk-button-checkbox'))),
|
||||
target = UI.$(e.target);
|
||||
|
||||
if (target.is(obj.options.target)) {
|
||||
target.trigger("click");
|
||||
target.trigger('click');
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -90,7 +90,7 @@
|
||||
// Init ARIA
|
||||
this.find($this.options.target).attr('aria-checked', 'false').filter('.' + $this.options.activeClass).attr('aria-checked', 'true');
|
||||
|
||||
this.on("click", this.options.target, function(e) {
|
||||
this.on('click', this.options.target, function(e) {
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (ele.is('a[href="#"]')) e.preventDefault();
|
||||
@ -100,7 +100,7 @@
|
||||
// Update ARIA
|
||||
ele.attr('aria-checked', ele.hasClass($this.options.activeClass));
|
||||
|
||||
$this.trigger("change.uk.button", [ele]);
|
||||
$this.trigger('change.uk.button', [ele]);
|
||||
});
|
||||
|
||||
},
|
||||
@ -117,13 +117,13 @@
|
||||
|
||||
boot: function() {
|
||||
|
||||
UI.$html.on("click.button.uikit", "[data-uk-button]", function(e) {
|
||||
UI.$html.on('click.button.uikit', '[data-uk-button]', function(e) {
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("button")) {
|
||||
if (!ele.data('button')) {
|
||||
|
||||
var obj = UI.button(ele, UI.Utils.options(ele.attr("data-uk-button")));
|
||||
ele.trigger("click");
|
||||
var obj = UI.button(ele, UI.Utils.options(ele.attr('data-uk-button')));
|
||||
ele.trigger('click');
|
||||
}
|
||||
});
|
||||
},
|
||||
@ -135,23 +135,22 @@
|
||||
// Init ARIA
|
||||
this.element.attr('aria-pressed', this.element.hasClass("uk-active"));
|
||||
|
||||
this.on("click", function(e) {
|
||||
this.on('click', function(e) {
|
||||
|
||||
if ($this.element.is('a[href="#"]')) e.preventDefault();
|
||||
|
||||
$this.toggle();
|
||||
$this.trigger("change.uk.button", [$this.element.blur().hasClass("uk-active")]);
|
||||
$this.trigger('change.uk.button', [$this.element.blur().hasClass('uk-active')]);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
toggle: function() {
|
||||
this.element.toggleClass("uk-active");
|
||||
this.element.toggleClass('uk-active');
|
||||
|
||||
// Update ARIA
|
||||
this.element.attr('aria-pressed', this.element.hasClass("uk-active"));
|
||||
this.element.attr('aria-pressed', this.element.hasClass('uk-active'));
|
||||
}
|
||||
});
|
||||
|
||||
})(UIkit);
|
||||
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/button.min.js
vendored
4
media/uikit/js/core/button.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";t.component("buttonRadio",{defaults:{activeClass:"uk-active",target:".uk-button"},boot:function(){t.$html.on("click.buttonradio.uikit","[data-uk-button-radio]",function(i){var a=t.$(this);if(!a.data("buttonRadio")){var e=t.buttonRadio(a,t.Utils.options(a.attr("data-uk-button-radio"))),o=t.$(i.target);o.is(e.options.target)&&o.trigger("click")}})},init:function(){var i=this;this.find(i.options.target).attr("aria-checked","false").filter("."+i.options.activeClass).attr("aria-checked","true"),this.on("click",this.options.target,function(a){var e=t.$(this);e.is('a[href="#"]')&&a.preventDefault(),i.find(i.options.target).not(e).removeClass(i.options.activeClass).blur(),e.addClass(i.options.activeClass),i.find(i.options.target).not(e).attr("aria-checked","false"),e.attr("aria-checked","true"),i.trigger("change.uk.button",[e])})},getSelected:function(){return this.find("."+this.options.activeClass)}}),t.component("buttonCheckbox",{defaults:{activeClass:"uk-active",target:".uk-button"},boot:function(){t.$html.on("click.buttoncheckbox.uikit","[data-uk-button-checkbox]",function(i){var a=t.$(this);if(!a.data("buttonCheckbox")){var e=t.buttonCheckbox(a,t.Utils.options(a.attr("data-uk-button-checkbox"))),o=t.$(i.target);o.is(e.options.target)&&o.trigger("click")}})},init:function(){var i=this;this.find(i.options.target).attr("aria-checked","false").filter("."+i.options.activeClass).attr("aria-checked","true"),this.on("click",this.options.target,function(a){var e=t.$(this);e.is('a[href="#"]')&&a.preventDefault(),e.toggleClass(i.options.activeClass).blur(),e.attr("aria-checked",e.hasClass(i.options.activeClass)),i.trigger("change.uk.button",[e])})},getSelected:function(){return this.find("."+this.options.activeClass)}}),t.component("button",{defaults:{},boot:function(){t.$html.on("click.button.uikit","[data-uk-button]",function(){var i=t.$(this);if(!i.data("button")){{t.button(i,t.Utils.options(i.attr("data-uk-button")))}i.trigger("click")}})},init:function(){var t=this;this.element.attr("aria-pressed",this.element.hasClass("uk-active")),this.on("click",function(i){t.element.is('a[href="#"]')&&i.preventDefault(),t.toggle(),t.trigger("change.uk.button",[t.element.blur().hasClass("uk-active")])})},toggle:function(){this.element.toggleClass("uk-active"),this.element.attr("aria-pressed",this.element.hasClass("uk-active"))}})}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";t.component("buttonRadio",{defaults:{activeClass:"uk-active",target:".uk-button"},boot:function(){t.$html.on("click.buttonradio.uikit","[data-uk-button-radio]",function(i){var a=t.$(this);if(!a.data("buttonRadio")){var e=t.buttonRadio(a,t.Utils.options(a.attr("data-uk-button-radio"))),o=t.$(i.target);o.is(e.options.target)&&o.trigger("click")}})},init:function(){var i=this;this.find(i.options.target).attr("aria-checked","false").filter("."+i.options.activeClass).attr("aria-checked","true"),this.on("click",this.options.target,function(a){var e=t.$(this);e.is('a[href="#"]')&&a.preventDefault(),i.find(i.options.target).not(e).removeClass(i.options.activeClass).blur(),e.addClass(i.options.activeClass),i.find(i.options.target).not(e).attr("aria-checked","false"),e.attr("aria-checked","true"),i.trigger("change.uk.button",[e])})},getSelected:function(){return this.find("."+this.options.activeClass)}}),t.component("buttonCheckbox",{defaults:{activeClass:"uk-active",target:".uk-button"},boot:function(){t.$html.on("click.buttoncheckbox.uikit","[data-uk-button-checkbox]",function(i){var a=t.$(this);if(!a.data("buttonCheckbox")){var e=t.buttonCheckbox(a,t.Utils.options(a.attr("data-uk-button-checkbox"))),o=t.$(i.target);o.is(e.options.target)&&o.trigger("click")}})},init:function(){var i=this;this.find(i.options.target).attr("aria-checked","false").filter("."+i.options.activeClass).attr("aria-checked","true"),this.on("click",this.options.target,function(a){var e=t.$(this);e.is('a[href="#"]')&&a.preventDefault(),e.toggleClass(i.options.activeClass).blur(),e.attr("aria-checked",e.hasClass(i.options.activeClass)),i.trigger("change.uk.button",[e])})},getSelected:function(){return this.find("."+this.options.activeClass)}}),t.component("button",{defaults:{},boot:function(){t.$html.on("click.button.uikit","[data-uk-button]",function(){var i=t.$(this);if(!i.data("button")){{t.button(i,t.Utils.options(i.attr("data-uk-button")))}i.trigger("click")}})},init:function(){var t=this;this.element.attr("aria-pressed",this.element.hasClass("uk-active")),this.on("click",function(i){t.element.is('a[href="#"]')&&i.preventDefault(),t.toggle(),t.trigger("change.uk.button",[t.element.blur().hasClass("uk-active")])})},toggle:function(){this.element.toggleClass("uk-active"),this.element.attr("aria-pressed",this.element.hasClass("uk-active"))}})}(UIkit2);
|
@ -1,18 +1,24 @@
|
||||
/*! 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(core) {
|
||||
|
||||
if (typeof define == "function" && define.amd) { // AMD
|
||||
var uikit;
|
||||
|
||||
define("uikit", function(){
|
||||
if (!window.jQuery) {
|
||||
throw new Error('UIkit 2.x requires jQuery');
|
||||
} else {
|
||||
uikit = core(window.jQuery);
|
||||
}
|
||||
|
||||
var uikit = window.UIkit || core(window, window.jQuery, window.document);
|
||||
if (typeof define == 'function' && define.amd) { // AMD
|
||||
|
||||
define('uikit', function(){
|
||||
|
||||
uikit.load = function(res, req, onload, config) {
|
||||
|
||||
var resources = res.split(','), load = [], i, base = (config.config && config.config.uikit && config.config.uikit.base ? config.config.uikit.base : "").replace(/\/+$/g, "");
|
||||
var resources = res.split(','), load = [], i, base = (config.config && config.config.uikit && config.config.uikit.base ? config.config.uikit.base : '').replace(/\/+$/g, '');
|
||||
|
||||
if (!base) {
|
||||
throw new Error( "Please define base path to UIkit in the requirejs config." );
|
||||
throw new Error('Please define base path to UIkit in the requirejs config.');
|
||||
}
|
||||
|
||||
for (i = 0; i < resources.length; i += 1) {
|
||||
@ -29,27 +35,22 @@
|
||||
});
|
||||
}
|
||||
|
||||
if (!window.jQuery) {
|
||||
throw new Error( "UIkit requires jQuery" );
|
||||
}
|
||||
|
||||
if (window && window.jQuery) {
|
||||
core(window, window.jQuery, window.document);
|
||||
}
|
||||
|
||||
|
||||
})(function(global, $, doc) {
|
||||
})(function($) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var UI = {}, _UI = global.UIkit ? Object.create(global.UIkit) : undefined;
|
||||
if (window.UIkit2) {
|
||||
return window.UIkit2;
|
||||
}
|
||||
|
||||
UI.version = '2.25.0';
|
||||
var UI = {}, _UI = window.UIkit || undefined;
|
||||
|
||||
UI.version = '2.27.4';
|
||||
|
||||
UI.noConflict = function() {
|
||||
// restore UIkit version
|
||||
if (_UI) {
|
||||
global.UIkit = _UI;
|
||||
window.UIkit = _UI;
|
||||
$.UIkit = _UI;
|
||||
$.fn.uk = _UI.fn;
|
||||
}
|
||||
@ -57,9 +58,11 @@
|
||||
return UI;
|
||||
};
|
||||
|
||||
UI.prefix = function(str) {
|
||||
return str;
|
||||
};
|
||||
window.UIkit2 = UI;
|
||||
|
||||
if (!_UI) {
|
||||
window.UIkit = UI;
|
||||
}
|
||||
|
||||
// cache jQuery
|
||||
UI.$ = $;
|
||||
@ -73,7 +76,7 @@
|
||||
|
||||
var transitionEnd = (function() {
|
||||
|
||||
var element = doc.body || doc.documentElement,
|
||||
var element = document.body || document.documentElement,
|
||||
transEndEventNames = {
|
||||
WebkitTransition : 'webkitTransitionEnd',
|
||||
MozTransition : 'transitionend',
|
||||
@ -93,7 +96,7 @@
|
||||
|
||||
var animationEnd = (function() {
|
||||
|
||||
var element = doc.body || doc.documentElement,
|
||||
var element = document.body || document.documentElement,
|
||||
animEndEventNames = {
|
||||
WebkitAnimation : 'webkitAnimationEnd',
|
||||
MozAnimation : 'animationend',
|
||||
@ -137,13 +140,13 @@
|
||||
|
||||
UI.support.touch = (
|
||||
('ontouchstart' in document) ||
|
||||
(global.DocumentTouch && document instanceof global.DocumentTouch) ||
|
||||
(global.navigator.msPointerEnabled && global.navigator.msMaxTouchPoints > 0) || //IE 10
|
||||
(global.navigator.pointerEnabled && global.navigator.maxTouchPoints > 0) || //IE >=11
|
||||
(window.DocumentTouch && document instanceof window.DocumentTouch) ||
|
||||
(window.navigator.msPointerEnabled && window.navigator.msMaxTouchPoints > 0) || //IE 10
|
||||
(window.navigator.pointerEnabled && window.navigator.maxTouchPoints > 0) || //IE >=11
|
||||
false
|
||||
);
|
||||
|
||||
UI.support.mutationobserver = (global.MutationObserver || global.WebKitMutationObserver || null);
|
||||
UI.support.mutationobserver = (window.MutationObserver || window.WebKitMutationObserver || null);
|
||||
|
||||
UI.Utils = {};
|
||||
|
||||
@ -161,7 +164,7 @@
|
||||
.replace(/'([^']+)'/g, function(_, $1){return '"'+$1+'"';})
|
||||
);
|
||||
} else {
|
||||
return (new Function("", "var json = " + str + "; return JSON.parse(JSON.stringify(json));"))();
|
||||
return (new Function('', 'var json = ' + str + '; return JSON.parse(JSON.stringify(json));'))();
|
||||
}
|
||||
} catch(e) { return false; }
|
||||
};
|
||||
@ -181,6 +184,19 @@
|
||||
};
|
||||
};
|
||||
|
||||
UI.Utils.throttle = function (func, limit) {
|
||||
var wait = false;
|
||||
return function () {
|
||||
if (!wait) {
|
||||
func.call();
|
||||
wait = true;
|
||||
setTimeout(function () {
|
||||
wait = false;
|
||||
}, limit);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
UI.Utils.removeCssRules = function(selectorRegEx) {
|
||||
var idx, idxs, stylesheet, _i, _j, _k, _len, _len1, _len2, _ref;
|
||||
|
||||
@ -247,7 +263,7 @@
|
||||
|
||||
var ele = UI.$(this),
|
||||
cls = ele.attr('class'),
|
||||
anim = cls.match(/uk\-animation\-(.+)/);
|
||||
anim = cls.match(/uk-animation-(.+)/);
|
||||
|
||||
ele.removeClass(anim[0]).width();
|
||||
|
||||
@ -314,30 +330,30 @@
|
||||
|
||||
switch(cmd) {
|
||||
case '~':
|
||||
output.push("for(var $i=0;$i<"+prop+".length;$i++) { var $item = "+prop+"[$i];");
|
||||
output.push('for(var $i=0;$i<'+prop+'.length;$i++) { var $item = '+prop+'[$i];');
|
||||
openblocks++;
|
||||
break;
|
||||
case ':':
|
||||
output.push("for(var $key in "+prop+") { var $val = "+prop+"[$key];");
|
||||
output.push('for(var $key in '+prop+') { var $val = '+prop+'[$key];');
|
||||
openblocks++;
|
||||
break;
|
||||
case '#':
|
||||
output.push("if("+prop+") {");
|
||||
output.push('if('+prop+') {');
|
||||
openblocks++;
|
||||
break;
|
||||
case '^':
|
||||
output.push("if(!"+prop+") {");
|
||||
output.push('if(!'+prop+') {');
|
||||
openblocks++;
|
||||
break;
|
||||
case '/':
|
||||
output.push("}");
|
||||
output.push('}');
|
||||
openblocks--;
|
||||
break;
|
||||
case '!':
|
||||
output.push("__ret.push("+prop+");");
|
||||
output.push('__ret.push('+prop+');');
|
||||
break;
|
||||
default:
|
||||
output.push("__ret.push(escape("+prop+"));");
|
||||
output.push('__ret.push(escape('+prop+'));');
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@ -358,11 +374,43 @@
|
||||
return data ? fn(data) : fn;
|
||||
};
|
||||
|
||||
UI.Utils.focus = function(element, extra) {
|
||||
|
||||
element = $(element);
|
||||
|
||||
if (!element.length) {
|
||||
return element;
|
||||
}
|
||||
|
||||
var autofocus = element.find('[autofocus]:first'), tabidx;
|
||||
|
||||
if (autofocus.length) {
|
||||
return autofocus.focus();
|
||||
}
|
||||
|
||||
autofocus = element.find(':input'+(extra && (','+extra) || '')).first();
|
||||
|
||||
if (autofocus.length) {
|
||||
return autofocus.focus();
|
||||
}
|
||||
|
||||
if (!element.attr('tabindex')) {
|
||||
tabidx = 1000;
|
||||
element.attr('tabindex', tabidx);
|
||||
}
|
||||
|
||||
element[0].focus();
|
||||
|
||||
if (tabidx) {
|
||||
element.attr('tabindex', '');
|
||||
}
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
UI.Utils.events = {};
|
||||
UI.Utils.events.click = UI.support.touch ? 'tap' : 'click';
|
||||
|
||||
global.UIkit = UI;
|
||||
|
||||
// deprecated
|
||||
|
||||
UI.fn = function(command, options) {
|
||||
@ -370,7 +418,7 @@
|
||||
var args = arguments, cmd = command.match(/^([a-z\-]+)(?:\.([a-z]+))?/i), component = cmd[1], method = cmd[2];
|
||||
|
||||
if (!UI[component]) {
|
||||
$.error("UIkit component [" + component + "] does not exist.");
|
||||
$.error('UIkit component [' + component + '] does not exist.');
|
||||
return this;
|
||||
}
|
||||
|
||||
@ -388,7 +436,11 @@
|
||||
|
||||
UI.components = {};
|
||||
|
||||
UI.component = function(name, def) {
|
||||
UI.component = function(name, def, override) {
|
||||
|
||||
if (UI.components[name] && !override) {
|
||||
return UI.components[name];
|
||||
}
|
||||
|
||||
var fn = function(element, options) {
|
||||
|
||||
@ -488,7 +540,7 @@
|
||||
switch(arguments.length) {
|
||||
case 1:
|
||||
|
||||
if (typeof arguments[0] === "string" || arguments[0].nodeType || arguments[0] instanceof jQuery) {
|
||||
if (typeof arguments[0] === 'string' || arguments[0].nodeType || arguments[0] instanceof jQuery) {
|
||||
element = $(arguments[0]);
|
||||
} else {
|
||||
options = arguments[0];
|
||||
@ -592,9 +644,9 @@
|
||||
try {
|
||||
|
||||
var observer = new UI.support.mutationobserver(UI.Utils.debounce(function(mutations) {
|
||||
fn.apply(element, []);
|
||||
fn.apply(element, [$element]);
|
||||
$element.trigger('changed.uk.dom');
|
||||
}, 50));
|
||||
}, 50), {childList: true, subtree: true});
|
||||
|
||||
// pass in the target node, as well as the observer options
|
||||
observer.observe(element, { childList: true, subtree: true });
|
||||
@ -627,21 +679,12 @@
|
||||
|
||||
UI.$body = UI.$('body');
|
||||
|
||||
UI.ready(function(context){
|
||||
UI.domObserve('[data-uk-observe]');
|
||||
});
|
||||
|
||||
UI.on('changed.uk.dom', function(e) {
|
||||
UI.init(e.target);
|
||||
UI.Utils.checkDisplay(e.target);
|
||||
});
|
||||
|
||||
UI.trigger('beforeready.uk.dom');
|
||||
|
||||
UI.component.bootComponents();
|
||||
|
||||
// custom scroll observer
|
||||
requestAnimationFrame((function(){
|
||||
var rafToken = requestAnimationFrame((function(){
|
||||
|
||||
var memory = {dir: {x:0, y:0}, x: window.pageXOffset, y:window.pageYOffset};
|
||||
|
||||
@ -664,11 +707,12 @@
|
||||
// Trigger the scroll event, this could probably be sent using memory.clone() but this is
|
||||
// more explicit and easier to see exactly what is being sent in the event.
|
||||
UI.$doc.trigger('scrolling.uk.document', [{
|
||||
"dir": {"x": memory.dir.x, "y": memory.dir.y}, "x": wpxo, "y": wpyo
|
||||
dir: {x: memory.dir.x, y: memory.dir.y}, x: wpxo, y: wpyo
|
||||
}]);
|
||||
}
|
||||
|
||||
requestAnimationFrame(fn);
|
||||
cancelAnimationFrame(rafToken);
|
||||
rafToken = requestAnimationFrame(fn);
|
||||
};
|
||||
|
||||
if (UI.support.touch) {
|
||||
@ -709,6 +753,37 @@
|
||||
|
||||
// mark that domready is left behind
|
||||
UI.domready = true;
|
||||
|
||||
// auto init js components
|
||||
if (UI.support.mutationobserver) {
|
||||
|
||||
var initFn = UI.Utils.debounce(function(){
|
||||
requestAnimationFrame(function(){ UI.init(document.body);});
|
||||
}, 10);
|
||||
|
||||
(new UI.support.mutationobserver(function(mutations) {
|
||||
|
||||
var init = false;
|
||||
|
||||
mutations.every(function(mutation){
|
||||
|
||||
if (mutation.type != 'childList') return true;
|
||||
|
||||
for (var i = 0, node; i < mutation.addedNodes.length; ++i) {
|
||||
|
||||
node = mutation.addedNodes[i];
|
||||
|
||||
if (node.outerHTML && node.outerHTML.indexOf('data-uk-') !== -1) {
|
||||
return (init = true) && false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
if (init) initFn();
|
||||
|
||||
})).observe(document.body, {childList: true, subtree: true});
|
||||
}
|
||||
};
|
||||
|
||||
if (document.readyState == 'complete' || document.readyState == 'interactive') {
|
||||
@ -720,7 +795,7 @@
|
||||
}());
|
||||
|
||||
// add touch identifier class
|
||||
UI.$html.addClass(UI.support.touch ? "uk-touch" : "uk-notouch");
|
||||
UI.$html.addClass(UI.support.touch ? 'uk-touch' : 'uk-notouch');
|
||||
|
||||
// add uk-hover class on tap to support overlays on touch devices
|
||||
if (UI.support.touch) {
|
||||
|
4
media/uikit/js/core/core.min.js
vendored
4
media/uikit/js/core/core.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! 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(UI){
|
||||
|
||||
"use strict";
|
||||
@ -14,12 +14,12 @@
|
||||
// auto init
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-cover]", context).each(function(){
|
||||
UI.$('[data-uk-cover]', context).each(function(){
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if(!ele.data("cover")) {
|
||||
var plugin = UI.cover(ele, UI.Utils.options(ele.attr("data-uk-cover")));
|
||||
if(!ele.data('cover')) {
|
||||
var plugin = UI.cover(ele, UI.Utils.options(ele.attr('data-uk-cover')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -33,8 +33,8 @@
|
||||
this.check();
|
||||
}.bind(this), 100));
|
||||
|
||||
this.on("display.uk.check", function(e) {
|
||||
if(this.element.is(":visible")) this.check();
|
||||
this.on('display.uk.check', function(e) {
|
||||
if (this.element.is(':visible')) this.check();
|
||||
}.bind(this));
|
||||
|
||||
this.check();
|
||||
@ -44,19 +44,14 @@
|
||||
var src = this.element.attr('src');
|
||||
|
||||
this.element.attr('src', '').on('load', function(){
|
||||
|
||||
this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}', '*');
|
||||
|
||||
}).attr('src', [src, (src.indexOf('?') > -1 ? '&':'?'), 'enablejsapi=1&api=1'].join(''));
|
||||
}
|
||||
},
|
||||
|
||||
check: function() {
|
||||
|
||||
this.element.css({
|
||||
'width' : '',
|
||||
'height' : ''
|
||||
});
|
||||
this.element.css({ width : '', height : '' });
|
||||
|
||||
this.dimension = {w: this.element.width(), h: this.element.height()};
|
||||
|
||||
@ -68,7 +63,7 @@
|
||||
this.dimension.h = this.element.attr('height');
|
||||
}
|
||||
|
||||
this.ratio = this.dimension.w / this.dimension.h;
|
||||
this.ratio = this.dimension.w / this.dimension.h;
|
||||
|
||||
var w = this.parent.width(), h = this.parent.height(), width, height;
|
||||
|
||||
@ -85,11 +80,8 @@
|
||||
height = Math.ceil(w / this.ratio);
|
||||
}
|
||||
|
||||
this.element.css({
|
||||
'width' : width,
|
||||
'height' : height
|
||||
});
|
||||
this.element.css({ width : width, height : height });
|
||||
}
|
||||
});
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/cover.min.js
vendored
4
media/uikit/js/core/cover.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";t.component("cover",{defaults:{automute:!0},boot:function(){t.ready(function(i){t.$("[data-uk-cover]",i).each(function(){var i=t.$(this);if(!i.data("cover")){t.cover(i,t.Utils.options(i.attr("data-uk-cover")))}})})},init:function(){if(this.parent=this.element.parent(),t.$win.on("load resize orientationchange",t.Utils.debounce(function(){this.check()}.bind(this),100)),this.on("display.uk.check",function(){this.element.is(":visible")&&this.check()}.bind(this)),this.check(),this.element.is("iframe")&&this.options.automute){var i=this.element.attr("src");this.element.attr("src","").on("load",function(){this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}',"*")}).attr("src",[i,i.indexOf("?")>-1?"&":"?","enablejsapi=1&api=1"].join(""))}},check:function(){this.element.css({width:"",height:""}),this.dimension={w:this.element.width(),h:this.element.height()},this.element.attr("width")&&!isNaN(this.element.attr("width"))&&(this.dimension.w=this.element.attr("width")),this.element.attr("height")&&!isNaN(this.element.attr("height"))&&(this.dimension.h=this.element.attr("height")),this.ratio=this.dimension.w/this.dimension.h;var t,i,e=this.parent.width(),n=this.parent.height();e/this.ratio<n?(t=Math.ceil(n*this.ratio),i=n):(t=e,i=Math.ceil(e/this.ratio)),this.element.css({width:t,height:i})}})}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";t.component("cover",{defaults:{automute:!0},boot:function(){t.ready(function(i){t.$("[data-uk-cover]",i).each(function(){var i=t.$(this);if(!i.data("cover")){t.cover(i,t.Utils.options(i.attr("data-uk-cover")))}})})},init:function(){if(this.parent=this.element.parent(),t.$win.on("load resize orientationchange",t.Utils.debounce(function(){this.check()}.bind(this),100)),this.on("display.uk.check",function(){this.element.is(":visible")&&this.check()}.bind(this)),this.check(),this.element.is("iframe")&&this.options.automute){var i=this.element.attr("src");this.element.attr("src","").on("load",function(){this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}',"*")}).attr("src",[i,i.indexOf("?")>-1?"&":"?","enablejsapi=1&api=1"].join(""))}},check:function(){this.element.css({width:"",height:""}),this.dimension={w:this.element.width(),h:this.element.height()},this.element.attr("width")&&!isNaN(this.element.attr("width"))&&(this.dimension.w=this.element.attr("width")),this.element.attr("height")&&!isNaN(this.element.attr("height"))&&(this.dimension.h=this.element.attr("height")),this.ratio=this.dimension.w/this.dimension.h;var t,i,e=this.parent.width(),n=this.parent.height();e/this.ratio<n?(t=Math.ceil(n*this.ratio),i=n):(t=e,i=Math.ceil(e/this.ratio)),this.element.css({width:t,height:i})}})}(UIkit2);
|
@ -1,88 +1,88 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var active = false, hoverIdle, flips = {
|
||||
'x': {
|
||||
"bottom-left" : 'bottom-right',
|
||||
"bottom-right" : 'bottom-left',
|
||||
"bottom-center" : 'bottom-center',
|
||||
"top-left" : 'top-right',
|
||||
"top-right" : 'top-left',
|
||||
"top-center" : 'top-center',
|
||||
"left-top" : 'right-top',
|
||||
"left-bottom" : 'right-bottom',
|
||||
"left-center" : 'right-center',
|
||||
"right-top" : 'left-top',
|
||||
"right-bottom" : 'left-bottom',
|
||||
"right-center" : 'left-center'
|
||||
x: {
|
||||
'bottom-left' : 'bottom-right',
|
||||
'bottom-right' : 'bottom-left',
|
||||
'bottom-center' : 'bottom-center',
|
||||
'top-left' : 'top-right',
|
||||
'top-right' : 'top-left',
|
||||
'top-center' : 'top-center',
|
||||
'left-top' : 'right-top',
|
||||
'left-bottom' : 'right-bottom',
|
||||
'left-center' : 'right-center',
|
||||
'right-top' : 'left-top',
|
||||
'right-bottom' : 'left-bottom',
|
||||
'right-center' : 'left-center'
|
||||
},
|
||||
'y': {
|
||||
"bottom-left" : 'top-left',
|
||||
"bottom-right" : 'top-right',
|
||||
"bottom-center" : 'top-center',
|
||||
"top-left" : 'bottom-left',
|
||||
"top-right" : 'bottom-right',
|
||||
"top-center" : 'bottom-center',
|
||||
"left-top" : 'left-bottom',
|
||||
"left-bottom" : 'left-top',
|
||||
"left-center" : 'left-center',
|
||||
"right-top" : 'right-bottom',
|
||||
"right-bottom" : 'right-top',
|
||||
"right-center" : 'right-center'
|
||||
y: {
|
||||
'bottom-left' : 'top-left',
|
||||
'bottom-right' : 'top-right',
|
||||
'bottom-center' : 'top-center',
|
||||
'top-left' : 'bottom-left',
|
||||
'top-right' : 'bottom-right',
|
||||
'top-center' : 'bottom-center',
|
||||
'left-top' : 'left-bottom',
|
||||
'left-bottom' : 'left-top',
|
||||
'left-center' : 'left-center',
|
||||
'right-top' : 'right-bottom',
|
||||
'right-bottom' : 'right-top',
|
||||
'right-center' : 'right-center'
|
||||
},
|
||||
'xy': {
|
||||
"bottom-left" : 'top-right',
|
||||
"bottom-right" : 'top-left',
|
||||
"bottom-center" : 'top-center',
|
||||
"top-left" : 'bottom-right',
|
||||
"top-right" : 'bottom-left',
|
||||
"top-center" : 'bottom-center',
|
||||
"left-top" : 'right-bottom',
|
||||
"left-bottom" : 'right-top',
|
||||
"left-center" : 'right-center',
|
||||
"right-top" : 'left-bottom',
|
||||
"right-bottom" : 'left-top',
|
||||
"right-center" : 'left-center'
|
||||
xy: {
|
||||
'bottom-left' : 'top-right',
|
||||
'bottom-right' : 'top-left',
|
||||
'bottom-center' : 'top-center',
|
||||
'top-left' : 'bottom-right',
|
||||
'top-right' : 'bottom-left',
|
||||
'top-center' : 'bottom-center',
|
||||
'left-top' : 'right-bottom',
|
||||
'left-bottom' : 'right-top',
|
||||
'left-center' : 'right-center',
|
||||
'right-top' : 'left-bottom',
|
||||
'right-bottom' : 'left-top',
|
||||
'right-center' : 'left-center'
|
||||
}
|
||||
};
|
||||
|
||||
UI.component('dropdown', {
|
||||
|
||||
defaults: {
|
||||
'mode' : 'hover',
|
||||
'pos' : 'bottom-left',
|
||||
'offset' : 0,
|
||||
'remaintime' : 800,
|
||||
'justify' : false,
|
||||
'boundary' : UI.$win,
|
||||
'delay' : 0,
|
||||
'dropdownSelector': '.uk-dropdown,.uk-dropdown-blank',
|
||||
'hoverDelayIdle' : 250,
|
||||
'preventflip' : false
|
||||
mode : 'hover',
|
||||
pos : 'bottom-left',
|
||||
offset : 0,
|
||||
remaintime : 800,
|
||||
justify : false,
|
||||
boundary : UI.$win,
|
||||
delay : 0,
|
||||
dropdownSelector: '.uk-dropdown,.uk-dropdown-blank',
|
||||
hoverDelayIdle : 250,
|
||||
preventflip : false
|
||||
},
|
||||
|
||||
remainIdle: false,
|
||||
|
||||
boot: function() {
|
||||
|
||||
var triggerevent = UI.support.touch ? "click" : "mouseenter";
|
||||
var triggerevent = UI.support.touch ? 'click' : 'mouseenter';
|
||||
|
||||
// init code
|
||||
UI.$html.on(triggerevent+".dropdown.uikit", "[data-uk-dropdown]", function(e) {
|
||||
UI.$html.on(triggerevent+'.dropdown.uikit focus pointerdown', '[data-uk-dropdown]', function(e) {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("dropdown")) {
|
||||
if (!ele.data('dropdown')) {
|
||||
|
||||
var dropdown = UI.dropdown(ele, UI.Utils.options(ele.attr("data-uk-dropdown")));
|
||||
var dropdown = UI.dropdown(ele, UI.Utils.options(ele.attr('data-uk-dropdown')));
|
||||
|
||||
if (triggerevent=="click" || (triggerevent=="mouseenter" && dropdown.options.mode=="hover")) {
|
||||
if (e.type=='click' || (e.type=='mouseenter' && dropdown.options.mode=='hover')) {
|
||||
dropdown.element.trigger(triggerevent);
|
||||
}
|
||||
|
||||
if (dropdown.element.find(dropdown.options.dropdownSelector).length) {
|
||||
if (dropdown.dropdown.length) {
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
@ -98,6 +98,10 @@
|
||||
return UI.$.inArray(UI.$(this).css('position'), ['relative', 'fixed', 'absolute']) !== -1;
|
||||
}).slice(0,1);
|
||||
|
||||
if (!this.offsetParent.length) {
|
||||
this.offsetParent = this.element;
|
||||
}
|
||||
|
||||
this.centered = this.dropdown.hasClass('uk-dropdown-center');
|
||||
this.justified = this.options.justify ? UI.$(this.options.justify) : false;
|
||||
|
||||
@ -121,17 +125,18 @@
|
||||
|
||||
// Init ARIA
|
||||
this.element.attr('aria-haspopup', 'true');
|
||||
this.element.attr('aria-expanded', this.element.hasClass("uk-open"));
|
||||
this.element.attr('aria-expanded', this.element.hasClass('uk-open'));
|
||||
this.dropdown.attr('aria-hidden', 'true');
|
||||
|
||||
if (this.options.mode == "click" || UI.support.touch) {
|
||||
if (this.options.mode == 'click' || UI.support.touch) {
|
||||
|
||||
this.on("click.uk.dropdown", function(e) {
|
||||
this.on('click.uk.dropdown', function(e) {
|
||||
|
||||
var $target = UI.$(e.target);
|
||||
|
||||
if (!$target.parents($this.options.dropdownSelector).length) {
|
||||
|
||||
if ($target.is("a[href='#']") || $target.parent().is("a[href='#']") || ($this.dropdown.length && !$this.dropdown.is(":visible")) ){
|
||||
if ($target.is("a[href='#']") || $target.parent().is("a[href='#']") || ($this.dropdown.length && !$this.dropdown.is(':visible')) ){
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
@ -144,7 +149,7 @@
|
||||
|
||||
} else {
|
||||
|
||||
if (!$this.dropdown.find(e.target).length || $target.is(".uk-dropdown-close") || $target.parents(".uk-dropdown-close").length) {
|
||||
if (!$this.dropdown.find(e.target).length || $target.is('.uk-dropdown-close') || $target.parents('.uk-dropdown-close').length) {
|
||||
$this.hide();
|
||||
}
|
||||
}
|
||||
@ -152,7 +157,7 @@
|
||||
|
||||
} else {
|
||||
|
||||
this.on("mouseenter", function(e) {
|
||||
this.on('mouseenter', function(e) {
|
||||
|
||||
$this.trigger('pointerenter.uk.dropdown', [$this]);
|
||||
|
||||
@ -180,7 +185,7 @@
|
||||
hoverIdle = setTimeout($this.show.bind($this), $this.options.delay);
|
||||
}
|
||||
|
||||
}).on("mouseleave", function() {
|
||||
}).on('mouseleave', function() {
|
||||
|
||||
if (hoverIdle) {
|
||||
clearTimeout(hoverIdle);
|
||||
@ -192,7 +197,7 @@
|
||||
|
||||
$this.trigger('pointerleave.uk.dropdown', [$this]);
|
||||
|
||||
}).on("click", function(e){
|
||||
}).on('click', function(e){
|
||||
|
||||
var $target = UI.$(e.target);
|
||||
|
||||
@ -201,7 +206,7 @@
|
||||
}
|
||||
|
||||
if (active && active == $this) {
|
||||
if (!$this.dropdown.find(e.target).length || $target.is(".uk-dropdown-close") || $target.parents(".uk-dropdown-close").length) {
|
||||
if (!$this.dropdown.find(e.target).length || $target.is('.uk-dropdown-close') || $target.parents('.uk-dropdown-close').length) {
|
||||
$this.hide();
|
||||
}
|
||||
return;
|
||||
@ -218,7 +223,7 @@
|
||||
|
||||
show: function(){
|
||||
|
||||
UI.$html.off("click.outer.dropdown");
|
||||
UI.$html.off('click.outer.dropdown');
|
||||
|
||||
if (active && active != this) {
|
||||
active.hide(true);
|
||||
@ -235,10 +240,12 @@
|
||||
|
||||
// Update ARIA
|
||||
this.element.attr('aria-expanded', 'true');
|
||||
this.dropdown.attr('aria-hidden', 'false');
|
||||
|
||||
this.trigger('show.uk.dropdown', [this]);
|
||||
|
||||
UI.Utils.checkDisplay(this.dropdown, true);
|
||||
UI.Utils.focus(this.dropdown);
|
||||
active = this;
|
||||
|
||||
this.registerOuterClick();
|
||||
@ -258,6 +265,7 @@
|
||||
|
||||
// Update ARIA
|
||||
this.element.attr('aria-expanded', 'false');
|
||||
this.dropdown.attr('aria-hidden', 'true');
|
||||
|
||||
this.trigger('hide.uk.dropdown', [this, force]);
|
||||
|
||||
@ -268,11 +276,11 @@
|
||||
|
||||
var $this = this;
|
||||
|
||||
UI.$html.off("click.outer.dropdown");
|
||||
UI.$html.off('click.outer.dropdown');
|
||||
|
||||
setTimeout(function() {
|
||||
|
||||
UI.$html.on("click.outer.dropdown", function(e) {
|
||||
UI.$html.on('click.outer.dropdown', function(e) {
|
||||
|
||||
if (hoverIdle) {
|
||||
clearTimeout(hoverIdle);
|
||||
@ -282,7 +290,7 @@
|
||||
|
||||
if (active == $this && !$this.element.find(e.target).length) {
|
||||
$this.hide(true);
|
||||
UI.$html.off("click.outer.dropdown");
|
||||
UI.$html.off('click.outer.dropdown');
|
||||
}
|
||||
});
|
||||
}, 10);
|
||||
@ -293,15 +301,15 @@
|
||||
if (!this.dropdown.length) return;
|
||||
|
||||
// reset
|
||||
this.dropdown.removeClass('uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack').css({
|
||||
'top-left':'',
|
||||
'left':'',
|
||||
'margin-left' :'',
|
||||
'margin-right':''
|
||||
this.dropdown.removeClass('uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack uk-dropdown-autoflip').css({
|
||||
topLeft :'',
|
||||
left :'',
|
||||
marginLeft :'',
|
||||
marginRight :''
|
||||
});
|
||||
|
||||
if (this.justified && this.justified.length) {
|
||||
this.dropdown.css("min-width", "");
|
||||
this.dropdown.css('min-width', '');
|
||||
}
|
||||
|
||||
var $this = this,
|
||||
@ -316,18 +324,18 @@
|
||||
dpos = this.options.pos;
|
||||
|
||||
var variants = {
|
||||
"bottom-left" : {top: 0 + pos.height + posoffset, left: 0},
|
||||
"bottom-right" : {top: 0 + pos.height + posoffset, left: 0 + pos.width - width},
|
||||
"bottom-center" : {top: 0 + pos.height + posoffset, left: 0 + pos.width / 2 - width / 2},
|
||||
"top-left" : {top: 0 - height - posoffset, left: 0},
|
||||
"top-right" : {top: 0 - height - posoffset, left: 0 + pos.width - width},
|
||||
"top-center" : {top: 0 - height - posoffset, left: 0 + pos.width / 2 - width / 2},
|
||||
"left-top" : {top: 0, left: 0 - width - posoffset},
|
||||
"left-bottom" : {top: 0 + pos.height - height, left: 0 - width - posoffset},
|
||||
"left-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 - width - posoffset},
|
||||
"right-top" : {top: 0, left: 0 + pos.width + posoffset},
|
||||
"right-bottom" : {top: 0 + pos.height - height, left: 0 + pos.width + posoffset},
|
||||
"right-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 + pos.width + posoffset}
|
||||
'bottom-left' : {top: 0 + pos.height + posoffset, left: 0},
|
||||
'bottom-right' : {top: 0 + pos.height + posoffset, left: 0 + pos.width - width},
|
||||
'bottom-center' : {top: 0 + pos.height + posoffset, left: 0 + pos.width / 2 - width / 2},
|
||||
'top-left' : {top: 0 - height - posoffset, left: 0},
|
||||
'top-right' : {top: 0 - height - posoffset, left: 0 + pos.width - width},
|
||||
'top-center' : {top: 0 - height - posoffset, left: 0 + pos.width / 2 - width / 2},
|
||||
'left-top' : {top: 0, left: 0 - width - posoffset},
|
||||
'left-bottom' : {top: 0 + pos.height - height, left: 0 - width - posoffset},
|
||||
'left-center' : {top: 0 + pos.height / 2 - height / 2, left: 0 - width - posoffset},
|
||||
'right-top' : {top: 0, left: 0 + pos.width + posoffset},
|
||||
'right-bottom' : {top: 0 + pos.height - height, left: 0 + pos.width + posoffset},
|
||||
'right-center' : {top: 0 + pos.height / 2 - height / 2, left: 0 + pos.width + posoffset}
|
||||
},
|
||||
css = {},
|
||||
pp;
|
||||
@ -360,6 +368,7 @@
|
||||
|
||||
pp = fdpos.split('-');
|
||||
css = variants[fdpos] ? variants[fdpos] : variants['bottom-left'];
|
||||
dropdown.addClass('uk-dropdown-autoflip');
|
||||
|
||||
// check flipped
|
||||
if (this.checkBoundary(pos.left + css.left, pos.top + css.top, width, height, boundarywidth)) {
|
||||
@ -371,11 +380,11 @@
|
||||
}
|
||||
|
||||
if (width > boundarywidth) {
|
||||
dropdown.addClass("uk-dropdown-stack");
|
||||
dropdown.addClass('uk-dropdown-stack');
|
||||
this.trigger('stack.uk.dropdown', [this]);
|
||||
}
|
||||
|
||||
dropdown.css(css).css("display", "").addClass('uk-dropdown-'+pp[0]);
|
||||
dropdown.css(css).css('display', '').addClass('uk-dropdown-'+pp[0]);
|
||||
},
|
||||
|
||||
checkBoundary: function(left, top, width, height, boundarywidth) {
|
||||
@ -398,9 +407,9 @@
|
||||
UI.component('dropdownOverlay', {
|
||||
|
||||
defaults: {
|
||||
'justify' : false,
|
||||
'cls' : '',
|
||||
'duration': 200
|
||||
justify : false,
|
||||
cls : '',
|
||||
duration: 200
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
@ -408,11 +417,11 @@
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-dropdown-overlay]", context).each(function() {
|
||||
UI.$('[data-uk-dropdown-overlay]', context).each(function() {
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("dropdownOverlay")) {
|
||||
UI.dropdownOverlay(ele, UI.Utils.options(ele.attr("data-uk-dropdown-overlay")));
|
||||
if (!ele.data('dropdownOverlay')) {
|
||||
UI.dropdownOverlay(ele, UI.Utils.options(ele.attr('data-uk-dropdown-overlay')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -437,7 +446,7 @@
|
||||
$this.dropdown = dropdown;
|
||||
|
||||
if ($this.justified && $this.justified.length) {
|
||||
justify($this.overlay.css({'display':'block', 'margin-left':'','margin-right':''}), $this.justified, $this.justified.outerWidth());
|
||||
justify($this.overlay.css({display:'block', marginLeft:'', marginRight:''}), $this.justified, $this.justified.outerWidth());
|
||||
}
|
||||
},
|
||||
|
||||
@ -507,19 +516,19 @@
|
||||
|
||||
var jwidth = justifyTo.outerWidth();
|
||||
|
||||
ele.css("min-width", jwidth);
|
||||
ele.css('min-width', jwidth);
|
||||
|
||||
if (UI.langdirection == 'right') {
|
||||
|
||||
var right1 = boundarywidth - (justifyTo.offset().left + jwidth),
|
||||
right2 = boundarywidth - (ele.offset().left + ele.outerWidth());
|
||||
|
||||
ele.css("margin-right", right1 - right2);
|
||||
ele.css('margin-right', right1 - right2);
|
||||
|
||||
} else {
|
||||
ele.css("margin-left", justifyTo.offset().left - offset.left);
|
||||
ele.css('margin-left', justifyTo.offset().left - offset.left);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/dropdown.min.js
vendored
4
media/uikit/js/core/dropdown.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
@ -8,9 +8,10 @@
|
||||
UI.component('gridMatchHeight', {
|
||||
|
||||
defaults: {
|
||||
"target" : false,
|
||||
"row" : true,
|
||||
"ignorestacked" : false
|
||||
target : false,
|
||||
row : true,
|
||||
ignorestacked : false,
|
||||
observe : false
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
@ -18,11 +19,11 @@
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-grid-match]", context).each(function() {
|
||||
UI.$('[data-uk-grid-match]', context).each(function() {
|
||||
var grid = UI.$(this), obj;
|
||||
|
||||
if (!grid.data("gridMatchHeight")) {
|
||||
obj = UI.gridMatchHeight(grid, UI.Utils.options(grid.attr("data-uk-grid-match")));
|
||||
if (!grid.data('gridMatchHeight')) {
|
||||
obj = UI.gridMatchHeight(grid, UI.Utils.options(grid.attr('data-uk-grid-match')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -40,7 +41,7 @@
|
||||
UI.$win.on('load resize orientationchange', (function() {
|
||||
|
||||
var fn = function() {
|
||||
$this.match();
|
||||
if ($this.element.is(':visible')) $this.match();
|
||||
};
|
||||
|
||||
UI.$(function() { fn(); });
|
||||
@ -48,14 +49,15 @@
|
||||
return UI.Utils.debounce(fn, 50);
|
||||
})());
|
||||
|
||||
UI.$html.on("changed.uk.dom", function(e) {
|
||||
$this.columns = $this.element.children();
|
||||
$this.elements = $this.options.target ? $this.find($this.options.target) : $this.columns;
|
||||
$this.match();
|
||||
});
|
||||
if (this.options.observe) {
|
||||
|
||||
this.on("display.uk.check", function(e) {
|
||||
if(this.element.is(":visible")) this.match();
|
||||
UI.domObserve(this.element, function(e) {
|
||||
if ($this.element.is(':visible')) $this.match();
|
||||
});
|
||||
}
|
||||
|
||||
this.on('display.uk.check', function(e) {
|
||||
if(this.element.is(':visible')) this.match();
|
||||
}.bind(this));
|
||||
|
||||
grids.push(this);
|
||||
@ -63,7 +65,7 @@
|
||||
|
||||
match: function() {
|
||||
|
||||
var firstvisible = this.columns.filter(":visible:first");
|
||||
var firstvisible = this.columns.filter(':visible:first');
|
||||
|
||||
if (!firstvisible.length) return;
|
||||
|
||||
@ -96,11 +98,11 @@
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-grid-margin]", context).each(function() {
|
||||
UI.$('[data-uk-grid-margin]', context).each(function() {
|
||||
var grid = UI.$(this), obj;
|
||||
|
||||
if (!grid.data("gridMargin")) {
|
||||
obj = UI.gridMargin(grid, UI.Utils.options(grid.attr("data-uk-grid-margin")));
|
||||
if (!grid.data('gridMargin')) {
|
||||
obj = UI.gridMargin(grid, UI.Utils.options(grid.attr('data-uk-grid-margin')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -112,4 +114,4 @@
|
||||
}
|
||||
});
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/grid.min.js
vendored
4
media/uikit/js/core/grid.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";var i=[];t.component("gridMatchHeight",{defaults:{target:!1,row:!0,ignorestacked:!1},boot:function(){t.ready(function(i){t.$("[data-uk-grid-match]",i).each(function(){var i,n=t.$(this);n.data("gridMatchHeight")||(i=t.gridMatchHeight(n,t.Utils.options(n.attr("data-uk-grid-match"))))})})},init:function(){var n=this;this.columns=this.element.children(),this.elements=this.options.target?this.find(this.options.target):this.columns,this.columns.length&&(t.$win.on("load resize orientationchange",function(){var i=function(){n.match()};return t.$(function(){i()}),t.Utils.debounce(i,50)}()),t.$html.on("changed.uk.dom",function(){n.columns=n.element.children(),n.elements=n.options.target?n.find(n.options.target):n.columns,n.match()}),this.on("display.uk.check",function(){this.element.is(":visible")&&this.match()}.bind(this)),i.push(this))},match:function(){var i=this.columns.filter(":visible:first");if(i.length){var n=Math.ceil(100*parseFloat(i.css("width"))/parseFloat(i.parent().css("width")))>=100;return n&&!this.options.ignorestacked?this.revert():t.Utils.matchHeights(this.elements,this.options),this}},revert:function(){return this.elements.css("min-height",""),this}}),t.component("gridMargin",{defaults:{cls:"uk-grid-margin",rowfirst:"uk-row-first"},boot:function(){t.ready(function(i){t.$("[data-uk-grid-margin]",i).each(function(){var i,n=t.$(this);n.data("gridMargin")||(i=t.gridMargin(n,t.Utils.options(n.attr("data-uk-grid-margin"))))})})},init:function(){t.stackMargin(this.element,this.options)}})}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";var i=[];t.component("gridMatchHeight",{defaults:{target:!1,row:!0,ignorestacked:!1,observe:!1},boot:function(){t.ready(function(i){t.$("[data-uk-grid-match]",i).each(function(){var i,n=t.$(this);n.data("gridMatchHeight")||(i=t.gridMatchHeight(n,t.Utils.options(n.attr("data-uk-grid-match"))))})})},init:function(){var n=this;this.columns=this.element.children(),this.elements=this.options.target?this.find(this.options.target):this.columns,this.columns.length&&(t.$win.on("load resize orientationchange",function(){var i=function(){n.element.is(":visible")&&n.match()};return t.$(function(){i()}),t.Utils.debounce(i,50)}()),this.options.observe&&t.domObserve(this.element,function(){n.element.is(":visible")&&n.match()}),this.on("display.uk.check",function(){this.element.is(":visible")&&this.match()}.bind(this)),i.push(this))},match:function(){var i=this.columns.filter(":visible:first");if(i.length){var n=Math.ceil(100*parseFloat(i.css("width"))/parseFloat(i.parent().css("width")))>=100;return n&&!this.options.ignorestacked?this.revert():t.Utils.matchHeights(this.elements,this.options),this}},revert:function(){return this.elements.css("min-height",""),this}}),t.component("gridMargin",{defaults:{cls:"uk-grid-margin",rowfirst:"uk-row-first"},boot:function(){t.ready(function(i){t.$("[data-uk-grid-margin]",i).each(function(){var i,n=t.$(this);n.data("gridMargin")||(i=t.gridMargin(n,t.Utils.options(n.attr("data-uk-grid-margin"))))})})},init:function(){t.stackMargin(this.element,this.options)}})}(UIkit2);
|
@ -1,10 +1,16 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
|
||||
var active = false, activeCount = 0, $html = UI.$html, body;
|
||||
|
||||
UI.$win.on('resize orientationchange', UI.Utils.debounce(function(){
|
||||
UI.$('.uk-modal.uk-open').each(function(){
|
||||
return UI.$(this).data('modal') && UI.$(this).data('modal').resize();
|
||||
});
|
||||
}, 150));
|
||||
|
||||
UI.component('modal', {
|
||||
|
||||
defaults: {
|
||||
@ -27,18 +33,18 @@
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.paddingdir = "padding-" + (UI.langdirection == 'left' ? "right":"left");
|
||||
this.dialog = this.find(".uk-modal-dialog");
|
||||
this.paddingdir = 'padding-' + (UI.langdirection == 'left' ? 'right':'left');
|
||||
this.dialog = this.find('.uk-modal-dialog');
|
||||
|
||||
this.active = false;
|
||||
|
||||
// Update ARIA
|
||||
this.element.attr('aria-hidden', this.element.hasClass("uk-open"));
|
||||
this.element.attr('aria-hidden', this.element.hasClass('uk-open'));
|
||||
|
||||
this.on("click", ".uk-modal-close", function(e) {
|
||||
this.on('click', '.uk-modal-close', function(e) {
|
||||
e.preventDefault();
|
||||
$this.hide();
|
||||
}).on("click", function(e) {
|
||||
}).on('click', function(e) {
|
||||
|
||||
var target = UI.$(e.target);
|
||||
|
||||
@ -46,10 +52,12 @@
|
||||
$this.hide();
|
||||
}
|
||||
});
|
||||
|
||||
UI.domObserve(this.element, function(e) { $this.resize(); });
|
||||
},
|
||||
|
||||
toggle: function() {
|
||||
return this[this.isActive() ? "hide" : "show"]();
|
||||
return this[this.isActive() ? 'hide' : 'show']();
|
||||
},
|
||||
|
||||
show: function() {
|
||||
@ -64,8 +72,8 @@
|
||||
active.hide(true);
|
||||
}
|
||||
|
||||
this.element.removeClass("uk-open").show();
|
||||
this.resize();
|
||||
this.element.removeClass('uk-open').show();
|
||||
this.resize(true);
|
||||
|
||||
if (this.options.modal) {
|
||||
active = this;
|
||||
@ -79,17 +87,19 @@
|
||||
this.hasTransitioned = false;
|
||||
this.element.one(UI.support.transition.end, function(){
|
||||
$this.hasTransitioned = true;
|
||||
}).addClass("uk-open");
|
||||
UI.Utils.focus($this.dialog, 'a[href]');
|
||||
}).addClass('uk-open');
|
||||
} else {
|
||||
this.element.addClass("uk-open");
|
||||
this.element.addClass('uk-open');
|
||||
UI.Utils.focus(this.dialog, 'a[href]');
|
||||
}
|
||||
|
||||
$html.addClass("uk-modal-page").height(); // force browser engine redraw
|
||||
$html.addClass('uk-modal-page').height(); // force browser engine redraw
|
||||
|
||||
// Update ARIA
|
||||
this.element.attr('aria-hidden', 'false');
|
||||
|
||||
this.element.trigger("show.uk.modal");
|
||||
this.element.trigger('show.uk.modal');
|
||||
|
||||
UI.Utils.checkDisplay(this.dialog, true);
|
||||
|
||||
@ -104,7 +114,7 @@
|
||||
|
||||
this.one(UI.support.transition.end, function() {
|
||||
$this._hide();
|
||||
}).removeClass("uk-open");
|
||||
}).removeClass('uk-open');
|
||||
|
||||
} else {
|
||||
|
||||
@ -114,7 +124,9 @@
|
||||
return this;
|
||||
},
|
||||
|
||||
resize: function() {
|
||||
resize: function(force) {
|
||||
|
||||
if (!this.isActive() && !force) return;
|
||||
|
||||
var bodywidth = body.width();
|
||||
|
||||
@ -130,9 +142,9 @@
|
||||
pad = parseInt(this.dialog.css('margin-top'), 10) + parseInt(this.dialog.css('margin-bottom'), 10);
|
||||
|
||||
if ((dh + pad) < window.innerHeight) {
|
||||
this.dialog.css({'top': (window.innerHeight/2 - dh/2) - pad });
|
||||
this.dialog.css({top: (window.innerHeight/2 - dh/2) - pad });
|
||||
} else {
|
||||
this.dialog.css({'top': ''});
|
||||
this.dialog.css({top: ''});
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -152,8 +164,8 @@
|
||||
h = wh - 2*(offset < 20 ? 20:offset) - dh;
|
||||
|
||||
scrollable.css({
|
||||
'max-height': (h < this.options.minScrollHeight ? '':h),
|
||||
'height':''
|
||||
maxHeight: (h < this.options.minScrollHeight ? '':h),
|
||||
height:''
|
||||
});
|
||||
|
||||
return true;
|
||||
@ -178,13 +190,13 @@
|
||||
body.css(this.paddingdir, "");
|
||||
}
|
||||
|
||||
if(active===this) active = false;
|
||||
if (active===this) active = false;
|
||||
|
||||
this.trigger('hide.uk.modal');
|
||||
},
|
||||
|
||||
isActive: function() {
|
||||
return this.active;
|
||||
return this.element.hasClass('uk-open');
|
||||
}
|
||||
|
||||
});
|
||||
@ -194,16 +206,16 @@
|
||||
boot: function() {
|
||||
|
||||
// init code
|
||||
UI.$html.on("click.modal.uikit", "[data-uk-modal]", function(e) {
|
||||
UI.$html.on('click.modal.uikit', '[data-uk-modal]', function(e) {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (ele.is("a")) {
|
||||
if (ele.is('a')) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
if (!ele.data("modalTrigger")) {
|
||||
var modal = UI.modalTrigger(ele, UI.Utils.options(ele.attr("data-uk-modal")));
|
||||
if (!ele.data('modalTrigger')) {
|
||||
var modal = UI.modalTrigger(ele, UI.Utils.options(ele.attr('data-uk-modal')));
|
||||
modal.show();
|
||||
}
|
||||
|
||||
@ -217,10 +229,6 @@
|
||||
active.hide();
|
||||
}
|
||||
});
|
||||
|
||||
UI.$win.on("resize orientationchange", UI.Utils.debounce(function(){
|
||||
if (active) active.resize();
|
||||
}, 150));
|
||||
},
|
||||
|
||||
init: function() {
|
||||
@ -228,7 +236,7 @@
|
||||
var $this = this;
|
||||
|
||||
this.options = UI.$.extend({
|
||||
"target": $this.element.is("a") ? $this.element.attr("href") : false
|
||||
target: $this.element.is('a') ? $this.element.attr('href') : false
|
||||
}, this.options);
|
||||
|
||||
this.modal = UI.modal(this.options.target, this.options);
|
||||
@ -239,17 +247,17 @@
|
||||
});
|
||||
|
||||
//methods
|
||||
this.proxy(this.modal, "show hide isActive");
|
||||
this.proxy(this.modal, 'show hide isActive');
|
||||
}
|
||||
});
|
||||
|
||||
UI.modal.dialog = function(content, options) {
|
||||
|
||||
var modal = UI.modal(UI.$(UI.modal.dialog.template).appendTo("body"), options);
|
||||
var modal = UI.modal(UI.$(UI.modal.dialog.template).appendTo('body'), options);
|
||||
|
||||
modal.on("hide.uk.modal", function(){
|
||||
modal.on('hide.uk.modal', function(){
|
||||
if (modal.persist) {
|
||||
modal.persist.appendTo(modal.persist.data("modalPersistParent"));
|
||||
modal.persist.appendTo(modal.persist.data('modalPersistParent'));
|
||||
modal.persist = false;
|
||||
}
|
||||
modal.element.remove();
|
||||
@ -320,22 +328,16 @@
|
||||
|
||||
input = modal.element.find("input[type='text']").val(value || '').on('keyup', function(e){
|
||||
if (e.keyCode == 13) {
|
||||
modal.element.find(".js-modal-ok").trigger('click');
|
||||
modal.element.find('.js-modal-ok').trigger('click');
|
||||
}
|
||||
});
|
||||
|
||||
modal.element.find(".js-modal-ok").on("click", function(){
|
||||
modal.element.find('.js-modal-ok').on('click', function(){
|
||||
if (onsubmit(input.val())!==false){
|
||||
modal.hide();
|
||||
}
|
||||
});
|
||||
|
||||
modal.on('show.uk.modal', function(){
|
||||
setTimeout(function(){
|
||||
input.focus();
|
||||
}, 50);
|
||||
});
|
||||
|
||||
return modal.show();
|
||||
};
|
||||
|
||||
@ -350,13 +352,11 @@
|
||||
return modal.show();
|
||||
};
|
||||
|
||||
|
||||
UI.modal.labels = {
|
||||
'Ok': 'Ok',
|
||||
'Cancel': 'Cancel'
|
||||
Ok: 'Ok',
|
||||
Cancel: 'Cancel'
|
||||
};
|
||||
|
||||
|
||||
// helper functions
|
||||
function setContent(content, modal){
|
||||
|
||||
@ -369,14 +369,14 @@
|
||||
|
||||
if(content.parent().length) {
|
||||
modal.persist = content;
|
||||
modal.persist.data("modalPersistParent", content.parent());
|
||||
modal.persist.data('modalPersistParent', content.parent());
|
||||
}
|
||||
}else if (typeof content === 'string' || typeof content === 'number') {
|
||||
// just insert the data as innerHTML
|
||||
content = UI.$('<div></div>').html(content);
|
||||
}else {
|
||||
// unsupported data type!
|
||||
content = UI.$('<div></div>').html('UIkit.modal Error: Unsupported data type: ' + typeof content);
|
||||
content = UI.$('<div></div>').html('UIkit2.modal Error: Unsupported data type: ' + typeof content);
|
||||
}
|
||||
|
||||
content.appendTo(modal.element.find('.uk-modal-dialog'));
|
||||
@ -384,4 +384,4 @@
|
||||
return modal;
|
||||
}
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/modal.min.js
vendored
4
media/uikit/js/core/modal.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
@ -6,9 +6,9 @@
|
||||
UI.component('nav', {
|
||||
|
||||
defaults: {
|
||||
"toggle": ">li.uk-parent > a[href='#']",
|
||||
"lists": ">li.uk-parent > ul",
|
||||
"multiple": false
|
||||
toggle: '>li.uk-parent > a[href="#"]',
|
||||
lists: '>li.uk-parent > ul',
|
||||
multiple: false
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
@ -16,11 +16,11 @@
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-nav]", context).each(function() {
|
||||
UI.$('[data-uk-nav]', context).each(function() {
|
||||
var nav = UI.$(this);
|
||||
|
||||
if (!nav.data("nav")) {
|
||||
var obj = UI.nav(nav, UI.Utils.options(nav.attr("data-uk-nav")));
|
||||
if (!nav.data('nav')) {
|
||||
var obj = UI.nav(nav, UI.Utils.options(nav.attr('data-uk-nav')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -30,26 +30,41 @@
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.on("click.uk.nav", this.options.toggle, function(e) {
|
||||
this.on('click.uk.nav', this.options.toggle, function(e) {
|
||||
e.preventDefault();
|
||||
var ele = UI.$(this);
|
||||
$this.open(ele.parent()[0] == $this.element[0] ? ele : ele.parent("li"));
|
||||
});
|
||||
|
||||
this.update();
|
||||
|
||||
UI.domObserve(this.element, function(e) {
|
||||
if ($this.element.find($this.options.lists).not('[role]').length) {
|
||||
$this.update();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
update: function() {
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.find(this.options.lists).each(function() {
|
||||
var $ele = UI.$(this),
|
||||
parent = $ele.parent(),
|
||||
|
||||
var $ele = UI.$(this).attr('role', 'menu'),
|
||||
parent = $ele.closest('li'),
|
||||
active = parent.hasClass("uk-active");
|
||||
|
||||
$ele.wrap('<div style="overflow:hidden;height:0;position:relative;"></div>');
|
||||
parent.data("list-container", $ele.parent()[active ? 'removeClass':'addClass']('uk-hidden'));
|
||||
if (!parent.data('list-container')) {
|
||||
$ele.wrap('<div style="overflow:hidden;height:0;position:relative;"></div>');
|
||||
parent.data('list-container', $ele.parent()[active ? 'removeClass':'addClass']('uk-hidden'));
|
||||
}
|
||||
|
||||
// Init ARIA
|
||||
parent.attr('aria-expanded', parent.hasClass("uk-open"));
|
||||
|
||||
if (active) $this.open(parent, true);
|
||||
});
|
||||
|
||||
},
|
||||
|
||||
open: function(li, noanimation) {
|
||||
@ -114,15 +129,17 @@
|
||||
// helper
|
||||
|
||||
function getHeight(ele) {
|
||||
var $ele = UI.$(ele), height = "auto";
|
||||
|
||||
if ($ele.is(":visible")) {
|
||||
var $ele = UI.$(ele), height = 'auto';
|
||||
|
||||
if ($ele.is(':visible')) {
|
||||
height = $ele.outerHeight();
|
||||
} else {
|
||||
|
||||
var tmp = {
|
||||
position: $ele.css("position"),
|
||||
visibility: $ele.css("visibility"),
|
||||
display: $ele.css("display")
|
||||
position: $ele.css('position'),
|
||||
visibility: $ele.css('visibility'),
|
||||
display: $ele.css('display')
|
||||
};
|
||||
|
||||
height = $ele.css({position: 'absolute', visibility: 'hidden', display: 'block'}).outerHeight();
|
||||
@ -133,4 +150,4 @@
|
||||
return height;
|
||||
}
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/nav.min.js
vendored
4
media/uikit/js/core/nav.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(i){"use strict";function t(t){var s=i.$(t),a="auto";if(s.is(":visible"))a=s.outerHeight();else{var e={position:s.css("position"),visibility:s.css("visibility"),display:s.css("display")};a=s.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),s.css(e)}return a}i.component("nav",{defaults:{toggle:">li.uk-parent > a[href='#']",lists:">li.uk-parent > ul",multiple:!1},boot:function(){i.ready(function(t){i.$("[data-uk-nav]",t).each(function(){var t=i.$(this);if(!t.data("nav")){i.nav(t,i.Utils.options(t.attr("data-uk-nav")))}})})},init:function(){var t=this;this.on("click.uk.nav",this.options.toggle,function(s){s.preventDefault();var a=i.$(this);t.open(a.parent()[0]==t.element[0]?a:a.parent("li"))}),this.find(this.options.lists).each(function(){var s=i.$(this),a=s.parent(),e=a.hasClass("uk-active");s.wrap('<div style="overflow:hidden;height:0;position:relative;"></div>'),a.data("list-container",s.parent()[e?"removeClass":"addClass"]("uk-hidden")),a.attr("aria-expanded",a.hasClass("uk-open")),e&&t.open(a,!0)})},open:function(s,a){var e=this,n=this.element,o=i.$(s),l=o.data("list-container");this.options.multiple||n.children(".uk-open").not(s).each(function(){var t=i.$(this);t.data("list-container")&&t.data("list-container").stop().animate({height:0},function(){i.$(this).parent().removeClass("uk-open").end().addClass("uk-hidden")})}),o.toggleClass("uk-open"),o.attr("aria-expanded",o.hasClass("uk-open")),l&&(o.hasClass("uk-open")&&l.removeClass("uk-hidden"),a?(l.stop().height(o.hasClass("uk-open")?"auto":0),o.hasClass("uk-open")||l.addClass("uk-hidden"),this.trigger("display.uk.check")):l.stop().animate({height:o.hasClass("uk-open")?t(l.find("ul:first")):0},function(){o.hasClass("uk-open")?l.css("height",""):l.addClass("uk-hidden"),e.trigger("display.uk.check")}))}})}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";function i(i){var s=t.$(i),e="auto";if(s.is(":visible"))e=s.outerHeight();else{var a={position:s.css("position"),visibility:s.css("visibility"),display:s.css("display")};e=s.css({position:"absolute",visibility:"hidden",display:"block"}).outerHeight(),s.css(a)}return e}t.component("nav",{defaults:{toggle:'>li.uk-parent > a[href="#"]',lists:">li.uk-parent > ul",multiple:!1},boot:function(){t.ready(function(i){t.$("[data-uk-nav]",i).each(function(){var i=t.$(this);if(!i.data("nav")){t.nav(i,t.Utils.options(i.attr("data-uk-nav")))}})})},init:function(){var i=this;this.on("click.uk.nav",this.options.toggle,function(s){s.preventDefault();var e=t.$(this);i.open(e.parent()[0]==i.element[0]?e:e.parent("li"))}),this.update(),t.domObserve(this.element,function(){i.element.find(i.options.lists).not("[role]").length&&i.update()})},update:function(){var i=this;this.find(this.options.lists).each(function(){var s=t.$(this).attr("role","menu"),e=s.closest("li"),a=e.hasClass("uk-active");e.data("list-container")||(s.wrap('<div style="overflow:hidden;height:0;position:relative;"></div>'),e.data("list-container",s.parent()[a?"removeClass":"addClass"]("uk-hidden"))),e.attr("aria-expanded",e.hasClass("uk-open")),a&&i.open(e,!0)})},open:function(s,e){var a=this,n=this.element,o=t.$(s),l=o.data("list-container");this.options.multiple||n.children(".uk-open").not(s).each(function(){var i=t.$(this);i.data("list-container")&&i.data("list-container").stop().animate({height:0},function(){t.$(this).parent().removeClass("uk-open").end().addClass("uk-hidden")})}),o.toggleClass("uk-open"),o.attr("aria-expanded",o.hasClass("uk-open")),l&&(o.hasClass("uk-open")&&l.removeClass("uk-hidden"),e?(l.stop().height(o.hasClass("uk-open")?"auto":0),o.hasClass("uk-open")||l.addClass("uk-hidden"),this.trigger("display.uk.check")):l.stop().animate({height:o.hasClass("uk-open")?i(l.find("ul:first")):0},function(){o.hasClass("uk-open")?l.css("height",""):l.addClass("uk-hidden"),a.trigger("display.uk.check")}))}})}(UIkit2);
|
@ -1,4 +1,4 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
@ -9,30 +9,41 @@
|
||||
$html = UI.$html,
|
||||
Offcanvas = {
|
||||
|
||||
show: function(element) {
|
||||
show: function(element, options) {
|
||||
|
||||
element = UI.$(element);
|
||||
|
||||
if (!element.length) return;
|
||||
|
||||
options = UI.$.extend({mode: 'push'}, options);
|
||||
|
||||
var $body = UI.$('body'),
|
||||
bar = element.find(".uk-offcanvas-bar:first"),
|
||||
rtl = (UI.langdirection == "right"),
|
||||
flip = bar.hasClass("uk-offcanvas-bar-flip") ? -1:1,
|
||||
bar = element.find('.uk-offcanvas-bar:first'),
|
||||
rtl = (UI.langdirection == 'right'),
|
||||
flip = bar.hasClass('uk-offcanvas-bar-flip') ? -1:1,
|
||||
dir = flip * (rtl ? -1 : 1),
|
||||
|
||||
scrollbarwidth = window.innerWidth - $body.width();
|
||||
|
||||
scrollpos = {x: window.pageXOffset, y: window.pageYOffset};
|
||||
|
||||
element.addClass("uk-active");
|
||||
bar.attr('mode', options.mode);
|
||||
element.addClass('uk-active');
|
||||
|
||||
$body.css({"width": window.innerWidth - scrollbarwidth, "height": window.innerHeight}).addClass("uk-offcanvas-page");
|
||||
$body.css((rtl ? "margin-right" : "margin-left"), (rtl ? -1 : 1) * (bar.outerWidth() * dir)).width(); // .width() - force redraw
|
||||
$body.css({width: window.innerWidth - scrollbarwidth, height: window.innerHeight}).addClass('uk-offcanvas-page');
|
||||
|
||||
$html.css('margin-top', scrollpos.y * -1);
|
||||
if (options.mode == 'push' || options.mode == 'reveal') {
|
||||
$body.css((rtl ? 'margin-right' : 'margin-left'), (rtl ? -1 : 1) * (bar.outerWidth() * dir));
|
||||
}
|
||||
|
||||
bar.addClass("uk-offcanvas-bar-show");
|
||||
if (options.mode == 'reveal') {
|
||||
bar.css('clip', 'rect(0, '+bar.outerWidth()+'px, 100vh, 0)');
|
||||
}
|
||||
|
||||
$html.css('margin-top', scrollpos.y * -1).width(); // .width() - force redraw
|
||||
|
||||
|
||||
bar.addClass('uk-offcanvas-bar-show');
|
||||
|
||||
this._initElement(element);
|
||||
|
||||
@ -45,14 +56,14 @@
|
||||
hide: function(force) {
|
||||
|
||||
var $body = UI.$('body'),
|
||||
panel = UI.$(".uk-offcanvas.uk-active"),
|
||||
rtl = (UI.langdirection == "right"),
|
||||
bar = panel.find(".uk-offcanvas-bar:first"),
|
||||
panel = UI.$('.uk-offcanvas.uk-active'),
|
||||
rtl = (UI.langdirection == 'right'),
|
||||
bar = panel.find('.uk-offcanvas-bar:first'),
|
||||
finalize = function() {
|
||||
$body.removeClass("uk-offcanvas-page").css({"width": "", "height": "", "margin-left": "", "margin-right": ""});
|
||||
panel.removeClass("uk-active");
|
||||
$body.removeClass('uk-offcanvas-page').css({width: '', height: '', marginLeft: '', marginRight: ''});
|
||||
panel.removeClass('uk-active');
|
||||
|
||||
bar.removeClass("uk-offcanvas-bar-show");
|
||||
bar.removeClass('uk-offcanvas-bar-show');
|
||||
$html.css('margin-top', '');
|
||||
window.scrollTo(scrollpos.x, scrollpos.y);
|
||||
bar.trigger('hide.uk.offcanvas', [panel, bar]);
|
||||
@ -62,15 +73,20 @@
|
||||
};
|
||||
|
||||
if (!panel.length) return;
|
||||
if (bar.attr('mode') == 'none') force = true;
|
||||
|
||||
if (UI.support.transition && !force) {
|
||||
|
||||
$body.one(UI.support.transition.end, function() {
|
||||
finalize();
|
||||
}).css((rtl ? "margin-right" : "margin-left"), "");
|
||||
}).css((rtl ? 'margin-right' : 'margin-left'), '');
|
||||
|
||||
if (bar.attr('mode') == 'reveal') {
|
||||
bar.css('clip', '');
|
||||
}
|
||||
|
||||
setTimeout(function(){
|
||||
bar.removeClass("uk-offcanvas-bar-show");
|
||||
bar.removeClass('uk-offcanvas-bar-show');
|
||||
}, 0);
|
||||
|
||||
} else {
|
||||
@ -80,17 +96,17 @@
|
||||
|
||||
_initElement: function(element) {
|
||||
|
||||
if (element.data("OffcanvasInit")) return;
|
||||
if (element.data('OffcanvasInit')) return;
|
||||
|
||||
element.on("click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas", function(e) {
|
||||
element.on('click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas', function(e) {
|
||||
|
||||
var target = UI.$(e.target);
|
||||
|
||||
if (!e.type.match(/swipe/)) {
|
||||
|
||||
if (!target.hasClass("uk-offcanvas-close")) {
|
||||
if (target.hasClass("uk-offcanvas-bar")) return;
|
||||
if (target.parents(".uk-offcanvas-bar:first").length) return;
|
||||
if (!target.hasClass('uk-offcanvas-close')) {
|
||||
if (target.hasClass('uk-offcanvas-bar')) return;
|
||||
if (target.parents('.uk-offcanvas-bar:first').length) return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,12 +114,12 @@
|
||||
Offcanvas.hide();
|
||||
});
|
||||
|
||||
element.on("click", "a[href*='#']", function(e){
|
||||
element.on('click', 'a[href*="#"]', function(e){
|
||||
|
||||
var link = UI.$(this),
|
||||
href = link.attr("href");
|
||||
href = link.attr('href');
|
||||
|
||||
if (href == "#") {
|
||||
if (href == '#') {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -131,7 +147,7 @@
|
||||
Offcanvas.hide();
|
||||
});
|
||||
|
||||
element.data("OffcanvasInit", true);
|
||||
element.data('OffcanvasInit', true);
|
||||
}
|
||||
};
|
||||
|
||||
@ -140,14 +156,14 @@
|
||||
boot: function() {
|
||||
|
||||
// init code
|
||||
$html.on("click.offcanvas.uikit", "[data-uk-offcanvas]", function(e) {
|
||||
$html.on('click.offcanvas.uikit', '[data-uk-offcanvas]', function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("offcanvasTrigger")) {
|
||||
var obj = UI.offcanvasTrigger(ele, UI.Utils.options(ele.attr("data-uk-offcanvas")));
|
||||
if (!ele.data('offcanvasTrigger')) {
|
||||
var obj = UI.offcanvasTrigger(ele, UI.Utils.options(ele.attr('data-uk-offcanvas')));
|
||||
ele.trigger("click");
|
||||
}
|
||||
});
|
||||
@ -165,16 +181,17 @@
|
||||
var $this = this;
|
||||
|
||||
this.options = UI.$.extend({
|
||||
"target": $this.element.is("a") ? $this.element.attr("href") : false
|
||||
target: $this.element.is('a') ? $this.element.attr('href') : false,
|
||||
mode: 'push'
|
||||
}, this.options);
|
||||
|
||||
this.on("click", function(e) {
|
||||
this.on('click', function(e) {
|
||||
e.preventDefault();
|
||||
Offcanvas.show($this.options.target);
|
||||
Offcanvas.show($this.options.target, $this.options);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
UI.offcanvas = Offcanvas;
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/offcanvas.min.js
vendored
4
media/uikit/js/core/offcanvas.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(a){"use strict";var t={x:window.scrollX,y:window.scrollY},n=(a.$win,a.$doc,a.$html),i={show:function(i){if(i=a.$(i),i.length){var o=a.$("body"),s=i.find(".uk-offcanvas-bar:first"),e="right"==a.langdirection,f=s.hasClass("uk-offcanvas-bar-flip")?-1:1,r=f*(e?-1:1),c=window.innerWidth-o.width();t={x:window.pageXOffset,y:window.pageYOffset},i.addClass("uk-active"),o.css({width:window.innerWidth-c,height:window.innerHeight}).addClass("uk-offcanvas-page"),o.css(e?"margin-right":"margin-left",(e?-1:1)*s.outerWidth()*r).width(),n.css("margin-top",-1*t.y),s.addClass("uk-offcanvas-bar-show"),this._initElement(i),s.trigger("show.uk.offcanvas",[i,s]),i.attr("aria-hidden","false")}},hide:function(i){var o=a.$("body"),s=a.$(".uk-offcanvas.uk-active"),e="right"==a.langdirection,f=s.find(".uk-offcanvas-bar:first"),r=function(){o.removeClass("uk-offcanvas-page").css({width:"",height:"","margin-left":"","margin-right":""}),s.removeClass("uk-active"),f.removeClass("uk-offcanvas-bar-show"),n.css("margin-top",""),window.scrollTo(t.x,t.y),f.trigger("hide.uk.offcanvas",[s,f]),s.attr("aria-hidden","true")};s.length&&(a.support.transition&&!i?(o.one(a.support.transition.end,function(){r()}).css(e?"margin-right":"margin-left",""),setTimeout(function(){f.removeClass("uk-offcanvas-bar-show")},0)):r())},_initElement:function(t){t.data("OffcanvasInit")||(t.on("click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas",function(t){var n=a.$(t.target);if(!t.type.match(/swipe/)&&!n.hasClass("uk-offcanvas-close")){if(n.hasClass("uk-offcanvas-bar"))return;if(n.parents(".uk-offcanvas-bar:first").length)return}t.stopImmediatePropagation(),i.hide()}),t.on("click","a[href*='#']",function(){var t=a.$(this),n=t.attr("href");"#"!=n&&(a.$doc.one("hide.uk.offcanvas",function(){var i;try{i=a.$(t[0].hash)}catch(o){i=""}i.length||(i=a.$('[name="'+t[0].hash.replace("#","")+'"]')),i.length&&a.Utils.scrollToElement?a.Utils.scrollToElement(i,a.Utils.options(t.attr("data-uk-smooth-scroll")||"{}")):window.location.href=n}),i.hide())}),t.data("OffcanvasInit",!0))}};a.component("offcanvasTrigger",{boot:function(){n.on("click.offcanvas.uikit","[data-uk-offcanvas]",function(t){t.preventDefault();var n=a.$(this);if(!n.data("offcanvasTrigger")){{a.offcanvasTrigger(n,a.Utils.options(n.attr("data-uk-offcanvas")))}n.trigger("click")}}),n.on("keydown.uk.offcanvas",function(a){27===a.keyCode&&i.hide()})},init:function(){var t=this;this.options=a.$.extend({target:t.element.is("a")?t.element.attr("href"):!1},this.options),this.on("click",function(a){a.preventDefault(),i.show(t.options.target)})}}),a.offcanvas=i}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(a){"use strict";var t={x:window.scrollX,y:window.scrollY},n=(a.$win,a.$doc,a.$html),i={show:function(i,o){if(i=a.$(i),i.length){o=a.$.extend({mode:"push"},o);var e=a.$("body"),s=i.find(".uk-offcanvas-bar:first"),r="right"==a.langdirection,f=s.hasClass("uk-offcanvas-bar-flip")?-1:1,c=f*(r?-1:1),h=window.innerWidth-e.width();t={x:window.pageXOffset,y:window.pageYOffset},s.attr("mode",o.mode),i.addClass("uk-active"),e.css({width:window.innerWidth-h,height:window.innerHeight}).addClass("uk-offcanvas-page"),("push"==o.mode||"reveal"==o.mode)&&e.css(r?"margin-right":"margin-left",(r?-1:1)*s.outerWidth()*c),"reveal"==o.mode&&s.css("clip","rect(0, "+s.outerWidth()+"px, 100vh, 0)"),n.css("margin-top",-1*t.y).width(),s.addClass("uk-offcanvas-bar-show"),this._initElement(i),s.trigger("show.uk.offcanvas",[i,s]),i.attr("aria-hidden","false")}},hide:function(i){var o=a.$("body"),e=a.$(".uk-offcanvas.uk-active"),s="right"==a.langdirection,r=e.find(".uk-offcanvas-bar:first"),f=function(){o.removeClass("uk-offcanvas-page").css({width:"",height:"",marginLeft:"",marginRight:""}),e.removeClass("uk-active"),r.removeClass("uk-offcanvas-bar-show"),n.css("margin-top",""),window.scrollTo(t.x,t.y),r.trigger("hide.uk.offcanvas",[e,r]),e.attr("aria-hidden","true")};e.length&&("none"==r.attr("mode")&&(i=!0),a.support.transition&&!i?(o.one(a.support.transition.end,function(){f()}).css(s?"margin-right":"margin-left",""),"reveal"==r.attr("mode")&&r.css("clip",""),setTimeout(function(){r.removeClass("uk-offcanvas-bar-show")},0)):f())},_initElement:function(t){t.data("OffcanvasInit")||(t.on("click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas",function(t){var n=a.$(t.target);if(!t.type.match(/swipe/)&&!n.hasClass("uk-offcanvas-close")){if(n.hasClass("uk-offcanvas-bar"))return;if(n.parents(".uk-offcanvas-bar:first").length)return}t.stopImmediatePropagation(),i.hide()}),t.on("click",'a[href*="#"]',function(){var t=a.$(this),n=t.attr("href");"#"!=n&&(a.$doc.one("hide.uk.offcanvas",function(){var i;try{i=a.$(t[0].hash)}catch(o){i=""}i.length||(i=a.$('[name="'+t[0].hash.replace("#","")+'"]')),i.length&&a.Utils.scrollToElement?a.Utils.scrollToElement(i,a.Utils.options(t.attr("data-uk-smooth-scroll")||"{}")):window.location.href=n}),i.hide())}),t.data("OffcanvasInit",!0))}};a.component("offcanvasTrigger",{boot:function(){n.on("click.offcanvas.uikit","[data-uk-offcanvas]",function(t){t.preventDefault();var n=a.$(this);if(!n.data("offcanvasTrigger")){{a.offcanvasTrigger(n,a.Utils.options(n.attr("data-uk-offcanvas")))}n.trigger("click")}}),n.on("keydown.uk.offcanvas",function(a){27===a.keyCode&&i.hide()})},init:function(){var t=this;this.options=a.$.extend({target:t.element.is("a")?t.element.attr("href"):!1,mode:"push"},this.options),this.on("click",function(a){a.preventDefault(),i.show(t.options.target,t.options)})}}),a.offcanvas=i}(UIkit2);
|
@ -1,4 +1,4 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
@ -15,30 +15,30 @@
|
||||
UI.component('scrollspy', {
|
||||
|
||||
defaults: {
|
||||
"target" : false,
|
||||
"cls" : "uk-scrollspy-inview",
|
||||
"initcls" : "uk-scrollspy-init-inview",
|
||||
"topoffset" : 0,
|
||||
"leftoffset" : 0,
|
||||
"repeat" : false,
|
||||
"delay" : 0
|
||||
target : false,
|
||||
cls : 'uk-scrollspy-inview',
|
||||
initcls : 'uk-scrollspy-init-inview',
|
||||
topoffset : 0,
|
||||
leftoffset : 0,
|
||||
repeat : false,
|
||||
delay : 0
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
|
||||
// listen to scroll and resize
|
||||
$doc.on("scrolling.uk.document", checkScrollSpy);
|
||||
$win.on("load resize orientationchange", UI.Utils.debounce(checkScrollSpy, 50));
|
||||
$doc.on('scrolling.uk.document', checkScrollSpy);
|
||||
$win.on('load resize orientationchange', UI.Utils.debounce(checkScrollSpy, 50));
|
||||
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-scrollspy]", context).each(function() {
|
||||
UI.$('[data-uk-scrollspy]', context).each(function() {
|
||||
|
||||
var element = UI.$(this);
|
||||
|
||||
if (!element.data("scrollspy")) {
|
||||
var obj = UI.scrollspy(element, UI.Utils.options(element.attr("data-uk-scrollspy")));
|
||||
if (!element.data('scrollspy')) {
|
||||
var obj = UI.scrollspy(element, UI.Utils.options(element.attr('data-uk-scrollspy')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -57,7 +57,7 @@
|
||||
var element = UI.$(this),
|
||||
inviewstate = element.data('inviewstate'),
|
||||
inview = UI.Utils.isInView(element, $this.options),
|
||||
toggle = element.data('ukScrollspyCls') || togglecls[toggleclsIdx].trim();
|
||||
toggle = element.attr('data-uk-scrollspy-cls') || togglecls[toggleclsIdx].trim();
|
||||
|
||||
if (inview && !inviewstate && !element.data('scrollspy-idle')) {
|
||||
|
||||
@ -66,13 +66,13 @@
|
||||
$this.offset = element.offset();
|
||||
initinview = true;
|
||||
|
||||
element.trigger("init.uk.scrollspy");
|
||||
element.trigger('init.uk.scrollspy');
|
||||
}
|
||||
|
||||
element.data('scrollspy-idle', setTimeout(function(){
|
||||
|
||||
element.addClass("uk-scrollspy-inview").toggleClass(toggle).width();
|
||||
element.trigger("inview.uk.scrollspy");
|
||||
element.addClass('uk-scrollspy-inview').toggleClass(toggle).width();
|
||||
element.trigger('inview.uk.scrollspy');
|
||||
|
||||
element.data('scrollspy-idle', false);
|
||||
element.data('inviewstate', true);
|
||||
@ -89,10 +89,10 @@
|
||||
element.data('scrollspy-idle', false);
|
||||
}
|
||||
|
||||
element.removeClass("uk-scrollspy-inview").toggleClass(toggle);
|
||||
element.removeClass('uk-scrollspy-inview').toggleClass(toggle);
|
||||
element.data('inviewstate', false);
|
||||
|
||||
element.trigger("outview.uk.scrollspy");
|
||||
element.trigger('outview.uk.scrollspy');
|
||||
}
|
||||
|
||||
toggleclsIdx = togglecls[toggleclsIdx + 1] ? (toggleclsIdx + 1) : 0;
|
||||
@ -119,28 +119,28 @@
|
||||
UI.component('scrollspynav', {
|
||||
|
||||
defaults: {
|
||||
"cls" : 'uk-active',
|
||||
"closest" : false,
|
||||
"topoffset" : 0,
|
||||
"leftoffset" : 0,
|
||||
"smoothscroll" : false
|
||||
cls : 'uk-active',
|
||||
closest : false,
|
||||
topoffset : 0,
|
||||
leftoffset : 0,
|
||||
smoothscroll : false
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
|
||||
// listen to scroll and resize
|
||||
$doc.on("scrolling.uk.document", checkScrollSpyNavs);
|
||||
$win.on("resize orientationchange", UI.Utils.debounce(checkScrollSpyNavs, 50));
|
||||
$doc.on('scrolling.uk.document', checkScrollSpyNavs);
|
||||
$win.on('resize orientationchange', UI.Utils.debounce(checkScrollSpyNavs, 50));
|
||||
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-scrollspy-nav]", context).each(function() {
|
||||
UI.$('[data-uk-scrollspy-nav]', context).each(function() {
|
||||
|
||||
var element = UI.$(this);
|
||||
|
||||
if (!element.data("scrollspynav")) {
|
||||
var obj = UI.scrollspynav(element, UI.Utils.options(element.attr("data-uk-scrollspy-nav")));
|
||||
if (!element.data('scrollspynav')) {
|
||||
var obj = UI.scrollspynav(element, UI.Utils.options(element.attr('data-uk-scrollspy-nav')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -149,7 +149,7 @@
|
||||
init: function() {
|
||||
|
||||
var ids = [],
|
||||
links = this.find("a[href^='#']").each(function(){ if(this.getAttribute("href").trim()!=='#') ids.push(this.getAttribute("href")); }),
|
||||
links = this.find("a[href^='#']").each(function(){ if(this.getAttribute('href').trim()!=='#') ids.push(this.getAttribute('href')); }),
|
||||
targets = UI.$(ids.join(",")),
|
||||
|
||||
clsActive = this.options.cls,
|
||||
@ -171,7 +171,7 @@
|
||||
scrollTop = $win.scrollTop(),
|
||||
target = (function(){
|
||||
for(var i=0; i< inviews.length;i++){
|
||||
if(inviews[i].offset().top >= scrollTop){
|
||||
if (inviews[i].offset().top - $this.options.topoffset >= scrollTop){
|
||||
return inviews[i];
|
||||
}
|
||||
}
|
||||
@ -181,12 +181,12 @@
|
||||
|
||||
if ($this.options.closest) {
|
||||
links.blur().closest(clsClosest).removeClass(clsActive);
|
||||
navitems = links.filter("a[href='#"+target.attr("id")+"']").closest(clsClosest).addClass(clsActive);
|
||||
navitems = links.filter("a[href='#"+target.attr('id')+"']").closest(clsClosest).addClass(clsActive);
|
||||
} else {
|
||||
navitems = links.removeClass(clsActive).filter("a[href='#"+target.attr("id")+"']").addClass(clsActive);
|
||||
}
|
||||
|
||||
$this.element.trigger("inview.uk.scrollspynav", [target, navitems]);
|
||||
$this.element.trigger('inview.uk.scrollspynav', [target, navitems]);
|
||||
}
|
||||
};
|
||||
|
||||
@ -198,7 +198,7 @@
|
||||
|
||||
fn();
|
||||
|
||||
this.element.data("scrollspynav", this);
|
||||
this.element.data('scrollspynav', this);
|
||||
|
||||
this.check = fn;
|
||||
scrollspynavs.push(this);
|
||||
@ -206,4 +206,4 @@
|
||||
}
|
||||
});
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/scrollspy.min.js
vendored
4
media/uikit/js/core/scrollspy.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";var s=t.$win,o=t.$doc,i=[],e=function(){for(var t=0;t<i.length;t++)window.requestAnimationFrame.apply(window,[i[t].check])};t.component("scrollspy",{defaults:{target:!1,cls:"uk-scrollspy-inview",initcls:"uk-scrollspy-init-inview",topoffset:0,leftoffset:0,repeat:!1,delay:0},boot:function(){o.on("scrolling.uk.document",e),s.on("load resize orientationchange",t.Utils.debounce(e,50)),t.ready(function(s){t.$("[data-uk-scrollspy]",s).each(function(){var s=t.$(this);if(!s.data("scrollspy")){t.scrollspy(s,t.Utils.options(s.attr("data-uk-scrollspy")))}})})},init:function(){var s,o=this,e=this.options.cls.split(/,/),l=function(){var i=o.options.target?o.element.find(o.options.target):o.element,l=1===i.length?1:0,n=0;i.each(function(){var i=t.$(this),a=i.data("inviewstate"),r=t.Utils.isInView(i,o.options),c=i.data("ukScrollspyCls")||e[n].trim();!r||a||i.data("scrollspy-idle")||(s||(i.addClass(o.options.initcls),o.offset=i.offset(),s=!0,i.trigger("init.uk.scrollspy")),i.data("scrollspy-idle",setTimeout(function(){i.addClass("uk-scrollspy-inview").toggleClass(c).width(),i.trigger("inview.uk.scrollspy"),i.data("scrollspy-idle",!1),i.data("inviewstate",!0)},o.options.delay*l)),l++),!r&&a&&o.options.repeat&&(i.data("scrollspy-idle")&&(clearTimeout(i.data("scrollspy-idle")),i.data("scrollspy-idle",!1)),i.removeClass("uk-scrollspy-inview").toggleClass(c),i.data("inviewstate",!1),i.trigger("outview.uk.scrollspy")),n=e[n+1]?n+1:0})};l(),this.check=l,i.push(this)}});var l=[],n=function(){for(var t=0;t<l.length;t++)window.requestAnimationFrame.apply(window,[l[t].check])};t.component("scrollspynav",{defaults:{cls:"uk-active",closest:!1,topoffset:0,leftoffset:0,smoothscroll:!1},boot:function(){o.on("scrolling.uk.document",n),s.on("resize orientationchange",t.Utils.debounce(n,50)),t.ready(function(s){t.$("[data-uk-scrollspy-nav]",s).each(function(){var s=t.$(this);if(!s.data("scrollspynav")){t.scrollspynav(s,t.Utils.options(s.attr("data-uk-scrollspy-nav")))}})})},init:function(){var o,i=[],e=this.find("a[href^='#']").each(function(){"#"!==this.getAttribute("href").trim()&&i.push(this.getAttribute("href"))}),n=t.$(i.join(",")),a=this.options.cls,r=this.options.closest||this.options.closest,c=this,p=function(){o=[];for(var i=0;i<n.length;i++)t.Utils.isInView(n.eq(i),c.options)&&o.push(n.eq(i));if(o.length){var l,p=s.scrollTop(),u=function(){for(var t=0;t<o.length;t++)if(o[t].offset().top>=p)return o[t]}();if(!u)return;c.options.closest?(e.blur().closest(r).removeClass(a),l=e.filter("a[href='#"+u.attr("id")+"']").closest(r).addClass(a)):l=e.removeClass(a).filter("a[href='#"+u.attr("id")+"']").addClass(a),c.element.trigger("inview.uk.scrollspynav",[u,l])}};this.options.smoothscroll&&t.smoothScroll&&e.each(function(){t.smoothScroll(this,c.options.smoothscroll)}),p(),this.element.data("scrollspynav",this),this.check=p,l.push(this)}})}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";var s=t.$win,o=t.$doc,i=[],e=function(){for(var t=0;t<i.length;t++)window.requestAnimationFrame.apply(window,[i[t].check])};t.component("scrollspy",{defaults:{target:!1,cls:"uk-scrollspy-inview",initcls:"uk-scrollspy-init-inview",topoffset:0,leftoffset:0,repeat:!1,delay:0},boot:function(){o.on("scrolling.uk.document",e),s.on("load resize orientationchange",t.Utils.debounce(e,50)),t.ready(function(s){t.$("[data-uk-scrollspy]",s).each(function(){var s=t.$(this);if(!s.data("scrollspy")){t.scrollspy(s,t.Utils.options(s.attr("data-uk-scrollspy")))}})})},init:function(){var s,o=this,e=this.options.cls.split(/,/),l=function(){var i=o.options.target?o.element.find(o.options.target):o.element,l=1===i.length?1:0,n=0;i.each(function(){var i=t.$(this),a=i.data("inviewstate"),r=t.Utils.isInView(i,o.options),c=i.attr("data-uk-scrollspy-cls")||e[n].trim();!r||a||i.data("scrollspy-idle")||(s||(i.addClass(o.options.initcls),o.offset=i.offset(),s=!0,i.trigger("init.uk.scrollspy")),i.data("scrollspy-idle",setTimeout(function(){i.addClass("uk-scrollspy-inview").toggleClass(c).width(),i.trigger("inview.uk.scrollspy"),i.data("scrollspy-idle",!1),i.data("inviewstate",!0)},o.options.delay*l)),l++),!r&&a&&o.options.repeat&&(i.data("scrollspy-idle")&&(clearTimeout(i.data("scrollspy-idle")),i.data("scrollspy-idle",!1)),i.removeClass("uk-scrollspy-inview").toggleClass(c),i.data("inviewstate",!1),i.trigger("outview.uk.scrollspy")),n=e[n+1]?n+1:0})};l(),this.check=l,i.push(this)}});var l=[],n=function(){for(var t=0;t<l.length;t++)window.requestAnimationFrame.apply(window,[l[t].check])};t.component("scrollspynav",{defaults:{cls:"uk-active",closest:!1,topoffset:0,leftoffset:0,smoothscroll:!1},boot:function(){o.on("scrolling.uk.document",n),s.on("resize orientationchange",t.Utils.debounce(n,50)),t.ready(function(s){t.$("[data-uk-scrollspy-nav]",s).each(function(){var s=t.$(this);if(!s.data("scrollspynav")){t.scrollspynav(s,t.Utils.options(s.attr("data-uk-scrollspy-nav")))}})})},init:function(){var o,i=[],e=this.find("a[href^='#']").each(function(){"#"!==this.getAttribute("href").trim()&&i.push(this.getAttribute("href"))}),n=t.$(i.join(",")),a=this.options.cls,r=this.options.closest||this.options.closest,c=this,p=function(){o=[];for(var i=0;i<n.length;i++)t.Utils.isInView(n.eq(i),c.options)&&o.push(n.eq(i));if(o.length){var l,p=s.scrollTop(),f=function(){for(var t=0;t<o.length;t++)if(o[t].offset().top-c.options.topoffset>=p)return o[t]}();if(!f)return;c.options.closest?(e.blur().closest(r).removeClass(a),l=e.filter("a[href='#"+f.attr("id")+"']").closest(r).addClass(a)):l=e.removeClass(a).filter("a[href='#"+f.attr("id")+"']").addClass(a),c.element.trigger("inview.uk.scrollspynav",[f,l])}};this.options.smoothscroll&&t.smoothScroll&&e.each(function(){t.smoothScroll(this,c.options.smoothscroll)}),p(),this.element.data("scrollspynav",this),this.check=p,l.push(this)}})}(UIkit2);
|
@ -1,4 +1,4 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
@ -8,12 +8,12 @@
|
||||
boot: function() {
|
||||
|
||||
// init code
|
||||
UI.$html.on("click.smooth-scroll.uikit", "[data-uk-smooth-scroll]", function(e) {
|
||||
UI.$html.on('click.smooth-scroll.uikit', '[data-uk-smooth-scroll]', function(e) {
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("smoothScroll")) {
|
||||
var obj = UI.smoothScroll(ele, UI.Utils.options(ele.attr("data-uk-smooth-scroll")));
|
||||
ele.trigger("click");
|
||||
if (!ele.data('smoothScroll')) {
|
||||
var obj = UI.smoothScroll(ele, UI.Utils.options(ele.attr('data-uk-smooth-scroll')));
|
||||
ele.trigger('click');
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -24,9 +24,9 @@
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.on("click", function(e) {
|
||||
this.on('click', function(e) {
|
||||
e.preventDefault();
|
||||
scrollToElement(UI.$(this.hash).length ? UI.$(this.hash) : UI.$("body"), $this.options);
|
||||
scrollToElement(UI.$(this.hash).length ? UI.$(this.hash) : UI.$('body'), $this.options);
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -50,7 +50,7 @@
|
||||
}
|
||||
|
||||
// animate to target, fire callback when done
|
||||
UI.$("html,body").stop().animate({scrollTop: target}, options.duration, options.transition).promise().done(options.complete);
|
||||
UI.$('html,body').stop().animate({scrollTop: target}, options.duration, options.transition).promise().done(options.complete);
|
||||
}
|
||||
|
||||
UI.Utils.scrollToElement = scrollToElement;
|
||||
@ -59,4 +59,4 @@
|
||||
UI.$.easing.easeOutExpo = function(x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; };
|
||||
}
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/smooth-scroll.min.js
vendored
4
media/uikit/js/core/smooth-scroll.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";function o(o,i){i=t.$.extend({duration:1e3,transition:"easeOutExpo",offset:0,complete:function(){}},i);var n=o.offset().top-i.offset,s=t.$doc.height(),e=window.innerHeight;n+e>s&&(n=s-e),t.$("html,body").stop().animate({scrollTop:n},i.duration,i.transition).promise().done(i.complete)}t.component("smoothScroll",{boot:function(){t.$html.on("click.smooth-scroll.uikit","[data-uk-smooth-scroll]",function(){var o=t.$(this);if(!o.data("smoothScroll")){{t.smoothScroll(o,t.Utils.options(o.attr("data-uk-smooth-scroll")))}o.trigger("click")}return!1})},init:function(){var i=this;this.on("click",function(n){n.preventDefault(),o(t.$(this.hash).length?t.$(this.hash):t.$("body"),i.options)})}}),t.Utils.scrollToElement=o,t.$.easing.easeOutExpo||(t.$.easing.easeOutExpo=function(t,o,i,n,s){return o==s?i+n:n*(-Math.pow(2,-10*o/s)+1)+i})}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";function o(o,i){i=t.$.extend({duration:1e3,transition:"easeOutExpo",offset:0,complete:function(){}},i);var n=o.offset().top-i.offset,s=t.$doc.height(),e=window.innerHeight;n+e>s&&(n=s-e),t.$("html,body").stop().animate({scrollTop:n},i.duration,i.transition).promise().done(i.complete)}t.component("smoothScroll",{boot:function(){t.$html.on("click.smooth-scroll.uikit","[data-uk-smooth-scroll]",function(){var o=t.$(this);if(!o.data("smoothScroll")){{t.smoothScroll(o,t.Utils.options(o.attr("data-uk-smooth-scroll")))}o.trigger("click")}return!1})},init:function(){var i=this;this.on("click",function(n){n.preventDefault(),o(t.$(this.hash).length?t.$(this.hash):t.$("body"),i.options)})}}),t.Utils.scrollToElement=o,t.$.easing.easeOutExpo||(t.$.easing.easeOutExpo=function(t,o,i,n,s){return o==s?i+n:n*(-Math.pow(2,-10*o/s)+1)+i})}(UIkit2);
|
@ -1,4 +1,4 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
@ -9,7 +9,7 @@
|
||||
|
||||
defaults: {
|
||||
connect : false,
|
||||
toggle : ">*",
|
||||
toggle : '>*',
|
||||
active : 0,
|
||||
animation : false,
|
||||
duration : 200,
|
||||
@ -23,11 +23,11 @@
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-switcher]", context).each(function() {
|
||||
UI.$('[data-uk-switcher]', context).each(function() {
|
||||
var switcher = UI.$(this);
|
||||
|
||||
if (!switcher.data("switcher")) {
|
||||
var obj = UI.switcher(switcher, UI.Utils.options(switcher.attr("data-uk-switcher")));
|
||||
if (!switcher.data('switcher')) {
|
||||
var obj = UI.switcher(switcher, UI.Utils.options(switcher.attr('data-uk-switcher')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -37,74 +37,72 @@
|
||||
|
||||
var $this = this;
|
||||
|
||||
this.on("click.uk.switcher", this.options.toggle, function(e) {
|
||||
this.on('click.uk.switcher', this.options.toggle, function(e) {
|
||||
e.preventDefault();
|
||||
$this.show(this);
|
||||
});
|
||||
|
||||
if (this.options.connect) {
|
||||
if (!this.options.connect) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.connect = UI.$(this.options.connect);
|
||||
this.connect = UI.$(this.options.connect);
|
||||
|
||||
this.connect.find(".uk-active").removeClass(".uk-active");
|
||||
if (!this.connect.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
// delegate switch commands within container content
|
||||
if (this.connect.length) {
|
||||
this.connect.on('click.uk.switcher', '[data-uk-switcher-item]', function(e) {
|
||||
|
||||
// Init ARIA for connect
|
||||
this.connect.children().attr('aria-hidden', 'true');
|
||||
e.preventDefault();
|
||||
|
||||
this.connect.on("click", '[data-uk-switcher-item]', function(e) {
|
||||
var item = UI.$(this).attr('data-uk-switcher-item');
|
||||
|
||||
e.preventDefault();
|
||||
if ($this.index == item) return;
|
||||
|
||||
var item = UI.$(this).attr('data-uk-switcher-item');
|
||||
switch(item) {
|
||||
case 'next':
|
||||
case 'previous':
|
||||
$this.show($this.index + (item=='next' ? 1:-1));
|
||||
break;
|
||||
default:
|
||||
$this.show(parseInt(item, 10));
|
||||
}
|
||||
});
|
||||
|
||||
if ($this.index == item) return;
|
||||
if (this.options.swiping) {
|
||||
|
||||
switch(item) {
|
||||
case 'next':
|
||||
case 'previous':
|
||||
$this.show($this.index + (item=='next' ? 1:-1));
|
||||
break;
|
||||
default:
|
||||
$this.show(parseInt(item, 10));
|
||||
}
|
||||
});
|
||||
|
||||
if (this.options.swiping) {
|
||||
|
||||
this.connect.on('swipeRight swipeLeft', function(e) {
|
||||
e.preventDefault();
|
||||
if(!window.getSelection().toString()) {
|
||||
$this.show($this.index + (e.type == 'swipeLeft' ? 1 : -1));
|
||||
}
|
||||
});
|
||||
this.connect.on('swipeRight swipeLeft', function(e) {
|
||||
e.preventDefault();
|
||||
if (!window.getSelection().toString()) {
|
||||
$this.show($this.index + (e.type == 'swipeLeft' ? 1 : -1));
|
||||
}
|
||||
}
|
||||
|
||||
var toggles = this.find(this.options.toggle),
|
||||
active = toggles.filter(".uk-active");
|
||||
|
||||
if (active.length) {
|
||||
this.show(active, false);
|
||||
} else {
|
||||
|
||||
if (this.options.active===false) return;
|
||||
|
||||
active = toggles.eq(this.options.active);
|
||||
this.show(active.length ? active : toggles.eq(0), false);
|
||||
}
|
||||
|
||||
// Init ARIA for toggles
|
||||
toggles.not(active).attr('aria-expanded', 'false');
|
||||
active.attr('aria-expanded', 'true');
|
||||
|
||||
this.on('changed.uk.dom', function() {
|
||||
$this.connect = UI.$($this.options.connect);
|
||||
});
|
||||
}
|
||||
|
||||
this.update();
|
||||
},
|
||||
|
||||
update: function() {
|
||||
|
||||
this.connect.children().removeClass('uk-active').attr('aria-hidden', 'true');
|
||||
|
||||
var toggles = this.find(this.options.toggle),
|
||||
active = toggles.filter('.uk-active');
|
||||
|
||||
if (active.length) {
|
||||
this.show(active, false);
|
||||
} else {
|
||||
|
||||
if (this.options.active===false) return;
|
||||
|
||||
active = toggles.eq(this.options.active);
|
||||
this.show(active.length ? active : toggles.eq(0), false);
|
||||
}
|
||||
|
||||
// Init ARIA for toggles
|
||||
toggles.not(active).attr('aria-expanded', 'false');
|
||||
active.attr('aria-expanded', 'true');
|
||||
},
|
||||
|
||||
show: function(tab, animate) {
|
||||
@ -113,18 +111,16 @@
|
||||
return;
|
||||
}
|
||||
|
||||
var toggles = this.find(this.options.toggle);
|
||||
|
||||
if (isNaN(tab)) {
|
||||
tab = UI.$(tab);
|
||||
} else {
|
||||
|
||||
var toggles = this.find(this.options.toggle);
|
||||
|
||||
tab = tab < 0 ? toggles.length-1 : tab;
|
||||
tab = toggles.eq(toggles[tab] ? tab : 0);
|
||||
}
|
||||
|
||||
var $this = this,
|
||||
toggles = this.find(this.options.toggle),
|
||||
active = UI.$(tab),
|
||||
animation = Animations[this.options.animation] || function(current, next) {
|
||||
|
||||
@ -277,7 +273,9 @@
|
||||
|
||||
next.addClass(clsIn).one(UI.support.animation.end, function() {
|
||||
|
||||
next.removeClass(''+clsIn+'').css({opacity:'', display:''});
|
||||
setTimeout(function () {
|
||||
next.removeClass(''+clsIn+'').css({opacity:'', display:''});
|
||||
}, 0);
|
||||
|
||||
d.resolve();
|
||||
|
||||
@ -306,4 +304,4 @@
|
||||
return d.promise();
|
||||
}
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/switcher.min.js
vendored
4
media/uikit/js/core/switcher.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";function i(i,n,e){var s,a=t.$.Deferred(),o=i,r=i;return e[0]===n[0]?(a.resolve(),a.promise()):("object"==typeof i&&(o=i[0],r=i[1]||i[0]),t.$body.css("overflow-x","hidden"),s=function(){n&&n.hide().removeClass("uk-active "+r+" uk-animation-reverse"),e.addClass(o).one(t.support.animation.end,function(){e.removeClass(""+o).css({opacity:"",display:""}),a.resolve(),t.$body.css("overflow-x",""),n&&n.css({opacity:"",display:""})}.bind(this)).show()},e.css("animation-duration",this.options.duration+"ms"),n&&n.length?(n.css("animation-duration",this.options.duration+"ms"),n.css("display","none").addClass(r+" uk-animation-reverse").one(t.support.animation.end,function(){s()}.bind(this)).css("display","")):(e.addClass("uk-active"),s()),a.promise())}var n;t.component("switcher",{defaults:{connect:!1,toggle:">*",active:0,animation:!1,duration:200,swiping:!0},animating:!1,boot:function(){t.ready(function(i){t.$("[data-uk-switcher]",i).each(function(){var i=t.$(this);if(!i.data("switcher")){t.switcher(i,t.Utils.options(i.attr("data-uk-switcher")))}})})},init:function(){var i=this;if(this.on("click.uk.switcher",this.options.toggle,function(t){t.preventDefault(),i.show(this)}),this.options.connect){this.connect=t.$(this.options.connect),this.connect.find(".uk-active").removeClass(".uk-active"),this.connect.length&&(this.connect.children().attr("aria-hidden","true"),this.connect.on("click","[data-uk-switcher-item]",function(n){n.preventDefault();var e=t.$(this).attr("data-uk-switcher-item");if(i.index!=e)switch(e){case"next":case"previous":i.show(i.index+("next"==e?1:-1));break;default:i.show(parseInt(e,10))}}),this.options.swiping&&this.connect.on("swipeRight swipeLeft",function(t){t.preventDefault(),window.getSelection().toString()||i.show(i.index+("swipeLeft"==t.type?1:-1))}));var n=this.find(this.options.toggle),e=n.filter(".uk-active");if(e.length)this.show(e,!1);else{if(this.options.active===!1)return;e=n.eq(this.options.active),this.show(e.length?e:n.eq(0),!1)}n.not(e).attr("aria-expanded","false"),e.attr("aria-expanded","true"),this.on("changed.uk.dom",function(){i.connect=t.$(i.options.connect)})}},show:function(e,s){if(!this.animating){if(isNaN(e))e=t.$(e);else{var a=this.find(this.options.toggle);e=0>e?a.length-1:e,e=a.eq(a[e]?e:0)}var o=this,a=this.find(this.options.toggle),r=t.$(e),c=n[this.options.animation]||function(t,e){if(!o.options.animation)return n.none.apply(o);var s=o.options.animation.split(",");return 1==s.length&&(s[1]=s[0]),s[0]=s[0].trim(),s[1]=s[1].trim(),i.apply(o,[s,t,e])};s!==!1&&t.support.animation||(c=n.none),r.hasClass("uk-disabled")||(a.attr("aria-expanded","false"),r.attr("aria-expanded","true"),a.filter(".uk-active").removeClass("uk-active"),r.addClass("uk-active"),this.options.connect&&this.connect.length&&(this.index=this.find(this.options.toggle).index(r),-1==this.index&&(this.index=0),this.connect.each(function(){var i=t.$(this),n=t.$(i.children()),e=t.$(n.filter(".uk-active")),s=t.$(n.eq(o.index));o.animating=!0,c.apply(o,[e,s]).then(function(){e.removeClass("uk-active"),s.addClass("uk-active"),e.attr("aria-hidden","true"),s.attr("aria-hidden","false"),t.Utils.checkDisplay(s,!0),o.animating=!1})})),this.trigger("show.uk.switcher",[r]))}}}),n={none:function(){var i=t.$.Deferred();return i.resolve(),i.promise()},fade:function(t,n){return i.apply(this,["uk-animation-fade",t,n])},"slide-bottom":function(t,n){return i.apply(this,["uk-animation-slide-bottom",t,n])},"slide-top":function(t,n){return i.apply(this,["uk-animation-slide-top",t,n])},"slide-vertical":function(t,n){var e=["uk-animation-slide-top","uk-animation-slide-bottom"];return t&&t.index()>n.index()&&e.reverse(),i.apply(this,[e,t,n])},"slide-left":function(t,n){return i.apply(this,["uk-animation-slide-left",t,n])},"slide-right":function(t,n){return i.apply(this,["uk-animation-slide-right",t,n])},"slide-horizontal":function(t,n){var e=["uk-animation-slide-right","uk-animation-slide-left"];return t&&t.index()>n.index()&&e.reverse(),i.apply(this,[e,t,n])},scale:function(t,n){return i.apply(this,["uk-animation-scale-up",t,n])}},t.switcher.animations=n}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";function i(i,n,e){var s,a=t.$.Deferred(),o=i,r=i;return e[0]===n[0]?(a.resolve(),a.promise()):("object"==typeof i&&(o=i[0],r=i[1]||i[0]),t.$body.css("overflow-x","hidden"),s=function(){n&&n.hide().removeClass("uk-active "+r+" uk-animation-reverse"),e.addClass(o).one(t.support.animation.end,function(){setTimeout(function(){e.removeClass(""+o).css({opacity:"",display:""})},0),a.resolve(),t.$body.css("overflow-x",""),n&&n.css({opacity:"",display:""})}.bind(this)).show()},e.css("animation-duration",this.options.duration+"ms"),n&&n.length?(n.css("animation-duration",this.options.duration+"ms"),n.css("display","none").addClass(r+" uk-animation-reverse").one(t.support.animation.end,function(){s()}.bind(this)).css("display","")):(e.addClass("uk-active"),s()),a.promise())}var n;t.component("switcher",{defaults:{connect:!1,toggle:">*",active:0,animation:!1,duration:200,swiping:!0},animating:!1,boot:function(){t.ready(function(i){t.$("[data-uk-switcher]",i).each(function(){var i=t.$(this);if(!i.data("switcher")){t.switcher(i,t.Utils.options(i.attr("data-uk-switcher")))}})})},init:function(){var i=this;this.on("click.uk.switcher",this.options.toggle,function(t){t.preventDefault(),i.show(this)}),this.options.connect&&(this.connect=t.$(this.options.connect),this.connect.length&&(this.connect.on("click.uk.switcher","[data-uk-switcher-item]",function(n){n.preventDefault();var e=t.$(this).attr("data-uk-switcher-item");if(i.index!=e)switch(e){case"next":case"previous":i.show(i.index+("next"==e?1:-1));break;default:i.show(parseInt(e,10))}}),this.options.swiping&&this.connect.on("swipeRight swipeLeft",function(t){t.preventDefault(),window.getSelection().toString()||i.show(i.index+("swipeLeft"==t.type?1:-1))}),this.update()))},update:function(){this.connect.children().removeClass("uk-active").attr("aria-hidden","true");var t=this.find(this.options.toggle),i=t.filter(".uk-active");if(i.length)this.show(i,!1);else{if(this.options.active===!1)return;i=t.eq(this.options.active),this.show(i.length?i:t.eq(0),!1)}t.not(i).attr("aria-expanded","false"),i.attr("aria-expanded","true")},show:function(e,s){if(!this.animating){var a=this.find(this.options.toggle);isNaN(e)?e=t.$(e):(e=0>e?a.length-1:e,e=a.eq(a[e]?e:0));var o=this,r=t.$(e),c=n[this.options.animation]||function(t,e){if(!o.options.animation)return n.none.apply(o);var s=o.options.animation.split(",");return 1==s.length&&(s[1]=s[0]),s[0]=s[0].trim(),s[1]=s[1].trim(),i.apply(o,[s,t,e])};s!==!1&&t.support.animation||(c=n.none),r.hasClass("uk-disabled")||(a.attr("aria-expanded","false"),r.attr("aria-expanded","true"),a.filter(".uk-active").removeClass("uk-active"),r.addClass("uk-active"),this.options.connect&&this.connect.length&&(this.index=this.find(this.options.toggle).index(r),-1==this.index&&(this.index=0),this.connect.each(function(){var i=t.$(this),n=t.$(i.children()),e=t.$(n.filter(".uk-active")),s=t.$(n.eq(o.index));o.animating=!0,c.apply(o,[e,s]).then(function(){e.removeClass("uk-active"),s.addClass("uk-active"),e.attr("aria-hidden","true"),s.attr("aria-hidden","false"),t.Utils.checkDisplay(s,!0),o.animating=!1})})),this.trigger("show.uk.switcher",[r]))}}}),n={none:function(){var i=t.$.Deferred();return i.resolve(),i.promise()},fade:function(t,n){return i.apply(this,["uk-animation-fade",t,n])},"slide-bottom":function(t,n){return i.apply(this,["uk-animation-slide-bottom",t,n])},"slide-top":function(t,n){return i.apply(this,["uk-animation-slide-top",t,n])},"slide-vertical":function(t,n){var e=["uk-animation-slide-top","uk-animation-slide-bottom"];return t&&t.index()>n.index()&&e.reverse(),i.apply(this,[e,t,n])},"slide-left":function(t,n){return i.apply(this,["uk-animation-slide-left",t,n])},"slide-right":function(t,n){return i.apply(this,["uk-animation-slide-right",t,n])},"slide-horizontal":function(t,n){var e=["uk-animation-slide-right","uk-animation-slide-left"];return t&&t.index()>n.index()&&e.reverse(),i.apply(this,[e,t,n])},scale:function(t,n){return i.apply(this,["uk-animation-scale-up",t,n])}},t.switcher.animations=n}(UIkit2);
|
@ -1,4 +1,4 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
@ -6,12 +6,12 @@
|
||||
UI.component('tab', {
|
||||
|
||||
defaults: {
|
||||
'target' : '>li:not(.uk-tab-responsive, .uk-disabled)',
|
||||
'connect' : false,
|
||||
'active' : 0,
|
||||
'animation' : false,
|
||||
'duration' : 200,
|
||||
'swiping' : true
|
||||
target : '>li:not(.uk-tab-responsive, .uk-disabled)',
|
||||
connect : false,
|
||||
active : 0,
|
||||
animation : false,
|
||||
duration : 200,
|
||||
swiping : true
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
@ -19,12 +19,12 @@
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-tab]", context).each(function() {
|
||||
UI.$('[data-uk-tab]', context).each(function() {
|
||||
|
||||
var tab = UI.$(this);
|
||||
|
||||
if (!tab.data("tab")) {
|
||||
var obj = UI.tab(tab, UI.Utils.options(tab.attr("data-uk-tab")));
|
||||
if (!tab.data('tab')) {
|
||||
var obj = UI.tab(tab, UI.Utils.options(tab.attr('data-uk-tab')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
this.current = false;
|
||||
|
||||
this.on("click.uk.tab", this.options.target, function(e) {
|
||||
this.on('click.uk.tab', this.options.target, function(e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
@ -46,9 +46,9 @@
|
||||
|
||||
var current = $this.find($this.options.target).not(this);
|
||||
|
||||
current.removeClass("uk-active").blur();
|
||||
current.removeClass('uk-active').blur();
|
||||
|
||||
$this.trigger("change.uk.tab", [UI.$(this).addClass("uk-active"), $this.current]);
|
||||
$this.trigger('change.uk.tab', [UI.$(this).addClass('uk-active'), $this.current]);
|
||||
|
||||
$this.current = UI.$(this);
|
||||
|
||||
@ -70,7 +70,7 @@
|
||||
this.responsivetab.lst = this.responsivetab.dropdown.find('ul');
|
||||
this.responsivetab.caption = this.responsivetab.find('a:first');
|
||||
|
||||
if (this.element.hasClass("uk-tab-bottom")) this.responsivetab.dropdown.addClass("uk-dropdown-up");
|
||||
if (this.element.hasClass('uk-tab-bottom')) this.responsivetab.dropdown.addClass('uk-dropdown-up');
|
||||
|
||||
// handle click
|
||||
this.responsivetab.lst.on('click.uk.tab', 'a', function(e) {
|
||||
@ -91,29 +91,30 @@
|
||||
|
||||
// init UIkit components
|
||||
if (this.options.connect) {
|
||||
|
||||
this.switcher = UI.switcher(this.element, {
|
||||
'toggle' : '>li:not(.uk-tab-responsive)',
|
||||
'connect' : this.options.connect,
|
||||
'active' : this.options.active,
|
||||
'animation' : this.options.animation,
|
||||
'duration' : this.options.duration,
|
||||
'swiping' : this.options.swiping
|
||||
toggle : '>li:not(.uk-tab-responsive)',
|
||||
connect : this.options.connect,
|
||||
active : this.options.active,
|
||||
animation : this.options.animation,
|
||||
duration : this.options.duration,
|
||||
swiping : this.options.swiping
|
||||
});
|
||||
}
|
||||
|
||||
UI.dropdown(this.responsivetab, {"mode": "click", "preventflip": "y"});
|
||||
UI.dropdown(this.responsivetab, {mode: 'click', preventflip: 'y'});
|
||||
|
||||
// init
|
||||
$this.trigger("change.uk.tab", [this.element.find(this.options.target).not('.uk-tab-responsive').filter('.uk-active')]);
|
||||
$this.trigger('change.uk.tab', [this.element.find(this.options.target).not('.uk-tab-responsive').filter('.uk-active')]);
|
||||
|
||||
this.check();
|
||||
|
||||
UI.$win.on('resize orientationchange', UI.Utils.debounce(function(){
|
||||
if ($this.element.is(":visible")) $this.check();
|
||||
if ($this.element.is(':visible')) $this.check();
|
||||
}, 100));
|
||||
|
||||
this.on('display.uk.check', function(){
|
||||
if ($this.element.is(":visible")) $this.check();
|
||||
if ($this.element.is(':visible')) $this.check();
|
||||
});
|
||||
},
|
||||
|
||||
@ -150,7 +151,8 @@
|
||||
|
||||
if (!item.hasClass('uk-disabled')) {
|
||||
|
||||
clone = item[0].outerHTML.replace('<a ', '<a data-index="'+i+'" ');
|
||||
clone = UI.$(item[0].outerHTML);
|
||||
clone.find('a').data('index', i);
|
||||
|
||||
this.responsivetab.lst.append(clone);
|
||||
}
|
||||
@ -164,4 +166,4 @@
|
||||
}
|
||||
});
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/tab.min.js
vendored
4
media/uikit/js/core/tab.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";t.component("tab",{defaults:{target:">li:not(.uk-tab-responsive, .uk-disabled)",connect:!1,active:0,animation:!1,duration:200,swiping:!0},boot:function(){t.ready(function(i){t.$("[data-uk-tab]",i).each(function(){var i=t.$(this);if(!i.data("tab")){t.tab(i,t.Utils.options(i.attr("data-uk-tab")))}})})},init:function(){var i=this;this.current=!1,this.on("click.uk.tab",this.options.target,function(e){if(e.preventDefault(),!i.switcher||!i.switcher.animating){var s=i.find(i.options.target).not(this);s.removeClass("uk-active").blur(),i.trigger("change.uk.tab",[t.$(this).addClass("uk-active"),i.current]),i.current=t.$(this),i.options.connect||(s.attr("aria-expanded","false"),t.$(this).attr("aria-expanded","true"))}}),this.options.connect&&(this.connect=t.$(this.options.connect)),this.responsivetab=t.$('<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>'),this.responsivetab.dropdown=this.responsivetab.find(".uk-dropdown"),this.responsivetab.lst=this.responsivetab.dropdown.find("ul"),this.responsivetab.caption=this.responsivetab.find("a:first"),this.element.hasClass("uk-tab-bottom")&&this.responsivetab.dropdown.addClass("uk-dropdown-up"),this.responsivetab.lst.on("click.uk.tab","a",function(e){e.preventDefault(),e.stopPropagation();var s=t.$(this);i.element.children("li:not(.uk-tab-responsive)").eq(s.data("index")).trigger("click")}),this.on("show.uk.switcher change.uk.tab",function(t,e){i.responsivetab.caption.html(e.text())}),this.element.append(this.responsivetab),this.options.connect&&(this.switcher=t.switcher(this.element,{toggle:">li:not(.uk-tab-responsive)",connect:this.options.connect,active:this.options.active,animation:this.options.animation,duration:this.options.duration,swiping:this.options.swiping})),t.dropdown(this.responsivetab,{mode:"click",preventflip:"y"}),i.trigger("change.uk.tab",[this.element.find(this.options.target).not(".uk-tab-responsive").filter(".uk-active")]),this.check(),t.$win.on("resize orientationchange",t.Utils.debounce(function(){i.element.is(":visible")&&i.check()},100)),this.on("display.uk.check",function(){i.element.is(":visible")&&i.check()})},check:function(){var i=this.element.children("li:not(.uk-tab-responsive)").removeClass("uk-hidden");if(!i.length)return this.responsivetab.addClass("uk-hidden"),void 0;var e,s,n,a=i.eq(0).offset().top+Math.ceil(i.eq(0).height()/2),o=!1;if(this.responsivetab.lst.empty(),i.each(function(){t.$(this).offset().top>a&&(o=!0)}),o)for(var r=0;r<i.length;r++)e=t.$(i.eq(r)),s=e.find("a"),"none"==e.css("float")||e.attr("uk-dropdown")||(e.hasClass("uk-disabled")||(n=e[0].outerHTML.replace("<a ",'<a data-index="'+r+'" '),this.responsivetab.lst.append(n)),e.addClass("uk-hidden"));this.responsivetab[this.responsivetab.lst.children("li").length?"removeClass":"addClass"]("uk-hidden")}})}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";t.component("tab",{defaults:{target:">li:not(.uk-tab-responsive, .uk-disabled)",connect:!1,active:0,animation:!1,duration:200,swiping:!0},boot:function(){t.ready(function(i){t.$("[data-uk-tab]",i).each(function(){var i=t.$(this);if(!i.data("tab")){t.tab(i,t.Utils.options(i.attr("data-uk-tab")))}})})},init:function(){var i=this;this.current=!1,this.on("click.uk.tab",this.options.target,function(e){if(e.preventDefault(),!i.switcher||!i.switcher.animating){var n=i.find(i.options.target).not(this);n.removeClass("uk-active").blur(),i.trigger("change.uk.tab",[t.$(this).addClass("uk-active"),i.current]),i.current=t.$(this),i.options.connect||(n.attr("aria-expanded","false"),t.$(this).attr("aria-expanded","true"))}}),this.options.connect&&(this.connect=t.$(this.options.connect)),this.responsivetab=t.$('<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>'),this.responsivetab.dropdown=this.responsivetab.find(".uk-dropdown"),this.responsivetab.lst=this.responsivetab.dropdown.find("ul"),this.responsivetab.caption=this.responsivetab.find("a:first"),this.element.hasClass("uk-tab-bottom")&&this.responsivetab.dropdown.addClass("uk-dropdown-up"),this.responsivetab.lst.on("click.uk.tab","a",function(e){e.preventDefault(),e.stopPropagation();var n=t.$(this);i.element.children("li:not(.uk-tab-responsive)").eq(n.data("index")).trigger("click")}),this.on("show.uk.switcher change.uk.tab",function(t,e){i.responsivetab.caption.html(e.text())}),this.element.append(this.responsivetab),this.options.connect&&(this.switcher=t.switcher(this.element,{toggle:">li:not(.uk-tab-responsive)",connect:this.options.connect,active:this.options.active,animation:this.options.animation,duration:this.options.duration,swiping:this.options.swiping})),t.dropdown(this.responsivetab,{mode:"click",preventflip:"y"}),i.trigger("change.uk.tab",[this.element.find(this.options.target).not(".uk-tab-responsive").filter(".uk-active")]),this.check(),t.$win.on("resize orientationchange",t.Utils.debounce(function(){i.element.is(":visible")&&i.check()},100)),this.on("display.uk.check",function(){i.element.is(":visible")&&i.check()})},check:function(){var i=this.element.children("li:not(.uk-tab-responsive)").removeClass("uk-hidden");if(!i.length)return this.responsivetab.addClass("uk-hidden"),void 0;var e,n,s,a=i.eq(0).offset().top+Math.ceil(i.eq(0).height()/2),o=!1;if(this.responsivetab.lst.empty(),i.each(function(){t.$(this).offset().top>a&&(o=!0)}),o)for(var r=0;r<i.length;r++)e=t.$(i.eq(r)),n=e.find("a"),"none"==e.css("float")||e.attr("uk-dropdown")||(e.hasClass("uk-disabled")||(s=t.$(e[0].outerHTML),s.find("a").data("index",r),this.responsivetab.lst.append(s)),e.addClass("uk-hidden"));this.responsivetab[this.responsivetab.lst.children("li").length?"removeClass":"addClass"]("uk-hidden")}})}(UIkit2);
|
@ -1,4 +1,4 @@
|
||||
/*! 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(UI){
|
||||
|
||||
"use strict";
|
||||
@ -19,11 +19,11 @@
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-toggle]", context).each(function() {
|
||||
UI.$('[data-uk-toggle]', context).each(function() {
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("toggle")) {
|
||||
var obj = UI.toggle(ele, UI.Utils.options(ele.attr("data-uk-toggle")));
|
||||
if (!ele.data('toggle')) {
|
||||
var obj = UI.toggle(ele, UI.Utils.options(ele.attr('data-uk-toggle')));
|
||||
}
|
||||
});
|
||||
|
||||
@ -43,10 +43,12 @@
|
||||
|
||||
this.aria = (this.options.cls.indexOf('uk-hidden') !== -1);
|
||||
|
||||
this.getToggles();
|
||||
this.on('click', function(e) {
|
||||
|
||||
if ($this.element.is('a[href="#"]')) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
this.on("click", function(e) {
|
||||
if ($this.element.is('a[href="#"]')) e.preventDefault();
|
||||
$this.toggle();
|
||||
});
|
||||
|
||||
@ -55,6 +57,8 @@
|
||||
|
||||
toggle: function() {
|
||||
|
||||
this.getToggles();
|
||||
|
||||
if(!this.totoggle.length) return;
|
||||
|
||||
if (this.options.animation && UI.support.animation) {
|
||||
@ -110,11 +114,11 @@
|
||||
|
||||
updateAria: function() {
|
||||
if (this.aria && this.totoggle.length) {
|
||||
this.totoggle.each(function(){
|
||||
this.totoggle.not('[aria-hidden]').each(function(){
|
||||
UI.$(this).attr('aria-hidden', UI.$(this).hasClass('uk-hidden'));
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(UIkit);
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/toggle.min.js
vendored
4
media/uikit/js/core/toggle.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";var i=[];t.component("toggle",{defaults:{target:!1,cls:"uk-hidden",animation:!1,duration:200},boot:function(){t.ready(function(o){t.$("[data-uk-toggle]",o).each(function(){var i=t.$(this);if(!i.data("toggle")){t.toggle(i,t.Utils.options(i.attr("data-uk-toggle")))}}),setTimeout(function(){i.forEach(function(t){t.getToggles()})},0)})},init:function(){var t=this;this.aria=-1!==this.options.cls.indexOf("uk-hidden"),this.getToggles(),this.on("click",function(i){t.element.is('a[href="#"]')&&i.preventDefault(),t.toggle()}),i.push(this)},toggle:function(){if(this.totoggle.length){if(this.options.animation&&t.support.animation){var i=this,o=this.options.animation.split(",");1==o.length&&(o[1]=o[0]),o[0]=o[0].trim(),o[1]=o[1].trim(),this.totoggle.css("animation-duration",this.options.duration+"ms"),this.totoggle.each(function(){var s=t.$(this);s.hasClass(i.options.cls)?(s.toggleClass(i.options.cls),t.Utils.animate(s,o[0]).then(function(){s.css("animation-duration",""),t.Utils.checkDisplay(s)})):t.Utils.animate(this,o[1]+" uk-animation-reverse").then(function(){s.toggleClass(i.options.cls).css("animation-duration",""),t.Utils.checkDisplay(s)})})}else this.totoggle.toggleClass(this.options.cls),t.Utils.checkDisplay(this.totoggle);this.updateAria()}},getToggles:function(){this.totoggle=this.options.target?t.$(this.options.target):[],this.updateAria()},updateAria:function(){this.aria&&this.totoggle.length&&this.totoggle.each(function(){t.$(this).attr("aria-hidden",t.$(this).hasClass("uk-hidden"))})}})}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";var i=[];t.component("toggle",{defaults:{target:!1,cls:"uk-hidden",animation:!1,duration:200},boot:function(){t.ready(function(o){t.$("[data-uk-toggle]",o).each(function(){var i=t.$(this);if(!i.data("toggle")){t.toggle(i,t.Utils.options(i.attr("data-uk-toggle")))}}),setTimeout(function(){i.forEach(function(t){t.getToggles()})},0)})},init:function(){var t=this;this.aria=-1!==this.options.cls.indexOf("uk-hidden"),this.on("click",function(i){t.element.is('a[href="#"]')&&i.preventDefault(),t.toggle()}),i.push(this)},toggle:function(){if(this.getToggles(),this.totoggle.length){if(this.options.animation&&t.support.animation){var i=this,o=this.options.animation.split(",");1==o.length&&(o[1]=o[0]),o[0]=o[0].trim(),o[1]=o[1].trim(),this.totoggle.css("animation-duration",this.options.duration+"ms"),this.totoggle.each(function(){var s=t.$(this);s.hasClass(i.options.cls)?(s.toggleClass(i.options.cls),t.Utils.animate(s,o[0]).then(function(){s.css("animation-duration",""),t.Utils.checkDisplay(s)})):t.Utils.animate(this,o[1]+" uk-animation-reverse").then(function(){s.toggleClass(i.options.cls).css("animation-duration",""),t.Utils.checkDisplay(s)})})}else this.totoggle.toggleClass(this.options.cls),t.Utils.checkDisplay(this.totoggle);this.updateAria()}},getToggles:function(){this.totoggle=this.options.target?t.$(this.options.target):[],this.updateAria()},updateAria:function(){this.aria&&this.totoggle.length&&this.totoggle.not("[aria-hidden]").each(function(){t.$(this).attr("aria-hidden",t.$(this).hasClass("uk-hidden"))})}})}(UIkit2);
|
@ -1,4 +1,4 @@
|
||||
/*! 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 */
|
||||
// Based on Zeptos touch.js
|
||||
// https://raw.github.com/madrobby/zepto/master/src/touch.js
|
||||
// Zepto.js may be freely distributed under the MIT license.
|
||||
@ -11,6 +11,12 @@
|
||||
|
||||
|
||||
var touch = {}, touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, longTapDelay = 750, gesture;
|
||||
var hasTouchEvents = 'ontouchstart' in window,
|
||||
hasPointerEvents = window.PointerEvent,
|
||||
hasTouch = hasTouchEvents
|
||||
|| window.DocumentTouch && document instanceof DocumentTouch
|
||||
|| navigator.msPointerEnabled && navigator.msMaxTouchPoints > 0 // IE 10
|
||||
|| navigator.pointerEnabled && navigator.maxTouchPoints > 0; // IE >=11
|
||||
|
||||
function swipeDirection(x1, x2, y1, y2) {
|
||||
return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down');
|
||||
@ -83,7 +89,7 @@
|
||||
longTapTimeout = setTimeout(longTap, longTapDelay);
|
||||
|
||||
// adds the current touch contact for IE gesture recognition
|
||||
if (gesture && ( e.type == 'MSPointerDown' || e.type == 'pointerdown' || e.type == 'touchstart' ) ) {
|
||||
if (e.originalEvent && e.originalEvent.pointerId && gesture && ( e.type == 'MSPointerDown' || e.type == 'pointerdown' || e.type == 'touchstart' ) ) {
|
||||
gesture.addPointer(e.originalEvent.pointerId);
|
||||
}
|
||||
|
||||
@ -162,7 +168,14 @@
|
||||
// when the browser window loses focus,
|
||||
// for example when a modal dialog is shown,
|
||||
// cancel all ongoing events
|
||||
.on('touchcancel MSPointerCancel', cancelAll);
|
||||
.on('touchcancel MSPointerCancel pointercancel', function(e){
|
||||
|
||||
// Ignore pointercancel if the event supports touch events, to prevent pointercancel in swipe gesture
|
||||
if ((e.type == 'touchcancel' && hasTouchEvents && hasTouch) || (!hasTouchEvents && e.type == 'pointercancel' && hasPointerEvents)) {
|
||||
cancelAll();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
// scrolling the window indicates intention of the user
|
||||
// to scroll, not tap or swipe, so cancel all ongoing events
|
||||
|
4
media/uikit/js/core/touch.min.js
vendored
4
media/uikit/js/core/touch.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(e){function t(e,t,n,o){return Math.abs(e-t)>=Math.abs(n-o)?e-t>0?"Left":"Right":n-o>0?"Up":"Down"}function n(){p=null,g.last&&(void 0!==g.el&&g.el.trigger("longTap"),g={})}function o(){p&&clearTimeout(p),p=null}function i(){a&&clearTimeout(a),l&&clearTimeout(l),u&&clearTimeout(u),p&&clearTimeout(p),a=l=u=p=null,g={}}function r(e){return e.pointerType==e.MSPOINTER_TYPE_TOUCH&&e.isPrimary}if(!e.fn.swipeLeft){var a,l,u,p,c,g={},s=750;e(function(){var v,y,w,f=0,d=0;"MSGesture"in window&&(c=new MSGesture,c.target=document.body),e(document).on("MSGestureEnd gestureend",function(e){var t=e.originalEvent.velocityX>1?"Right":e.originalEvent.velocityX<-1?"Left":e.originalEvent.velocityY>1?"Down":e.originalEvent.velocityY<-1?"Up":null;t&&void 0!==g.el&&(g.el.trigger("swipe"),g.el.trigger("swipe"+t))}).on("touchstart MSPointerDown pointerdown",function(t){("MSPointerDown"!=t.type||r(t.originalEvent))&&(w="MSPointerDown"==t.type||"pointerdown"==t.type?t:t.originalEvent.touches[0],v=Date.now(),y=v-(g.last||v),g.el=e("tagName"in w.target?w.target:w.target.parentNode),a&&clearTimeout(a),g.x1=w.pageX,g.y1=w.pageY,y>0&&250>=y&&(g.isDoubleTap=!0),g.last=v,p=setTimeout(n,s),!c||"MSPointerDown"!=t.type&&"pointerdown"!=t.type&&"touchstart"!=t.type||c.addPointer(t.originalEvent.pointerId))}).on("touchmove MSPointerMove pointermove",function(e){("MSPointerMove"!=e.type||r(e.originalEvent))&&(w="MSPointerMove"==e.type||"pointermove"==e.type?e:e.originalEvent.touches[0],o(),g.x2=w.pageX,g.y2=w.pageY,f+=Math.abs(g.x1-g.x2),d+=Math.abs(g.y1-g.y2))}).on("touchend MSPointerUp pointerup",function(n){("MSPointerUp"!=n.type||r(n.originalEvent))&&(o(),g.x2&&Math.abs(g.x1-g.x2)>30||g.y2&&Math.abs(g.y1-g.y2)>30?u=setTimeout(function(){void 0!==g.el&&(g.el.trigger("swipe"),g.el.trigger("swipe"+t(g.x1,g.x2,g.y1,g.y2))),g={}},0):"last"in g&&(isNaN(f)||30>f&&30>d?l=setTimeout(function(){var t=e.Event("tap");t.cancelTouch=i,void 0!==g.el&&g.el.trigger(t),g.isDoubleTap?(void 0!==g.el&&g.el.trigger("doubleTap"),g={}):a=setTimeout(function(){a=null,void 0!==g.el&&g.el.trigger("singleTap"),g={}},250)},0):g={},f=d=0))}).on("touchcancel MSPointerCancel",i),e(window).on("scroll",i)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(t){e.fn[t]=function(n){return e(this).on(t,n)}})}}(jQuery);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(e){function t(e,t,n,o){return Math.abs(e-t)>=Math.abs(n-o)?e-t>0?"Left":"Right":n-o>0?"Up":"Down"}function n(){c=null,g.last&&(void 0!==g.el&&g.el.trigger("longTap"),g={})}function o(){c&&clearTimeout(c),c=null}function i(){a&&clearTimeout(a),l&&clearTimeout(l),u&&clearTimeout(u),c&&clearTimeout(c),a=l=u=c=null,g={}}function r(e){return e.pointerType==e.MSPOINTER_TYPE_TOUCH&&e.isPrimary}if(!e.fn.swipeLeft){var a,l,u,c,p,g={},s=750,v="ontouchstart"in window,w=window.PointerEvent,d=v||window.DocumentTouch&&document instanceof DocumentTouch||navigator.msPointerEnabled&&navigator.msMaxTouchPoints>0||navigator.pointerEnabled&&navigator.maxTouchPoints>0;e(function(){var y,T,f,h=0,M=0;"MSGesture"in window&&(p=new MSGesture,p.target=document.body),e(document).on("MSGestureEnd gestureend",function(e){var t=e.originalEvent.velocityX>1?"Right":e.originalEvent.velocityX<-1?"Left":e.originalEvent.velocityY>1?"Down":e.originalEvent.velocityY<-1?"Up":null;t&&void 0!==g.el&&(g.el.trigger("swipe"),g.el.trigger("swipe"+t))}).on("touchstart MSPointerDown pointerdown",function(t){("MSPointerDown"!=t.type||r(t.originalEvent))&&(f="MSPointerDown"==t.type||"pointerdown"==t.type?t:t.originalEvent.touches[0],y=Date.now(),T=y-(g.last||y),g.el=e("tagName"in f.target?f.target:f.target.parentNode),a&&clearTimeout(a),g.x1=f.pageX,g.y1=f.pageY,T>0&&250>=T&&(g.isDoubleTap=!0),g.last=y,c=setTimeout(n,s),t.originalEvent&&t.originalEvent.pointerId&&p&&("MSPointerDown"==t.type||"pointerdown"==t.type||"touchstart"==t.type)&&p.addPointer(t.originalEvent.pointerId))}).on("touchmove MSPointerMove pointermove",function(e){("MSPointerMove"!=e.type||r(e.originalEvent))&&(f="MSPointerMove"==e.type||"pointermove"==e.type?e:e.originalEvent.touches[0],o(),g.x2=f.pageX,g.y2=f.pageY,h+=Math.abs(g.x1-g.x2),M+=Math.abs(g.y1-g.y2))}).on("touchend MSPointerUp pointerup",function(n){("MSPointerUp"!=n.type||r(n.originalEvent))&&(o(),g.x2&&Math.abs(g.x1-g.x2)>30||g.y2&&Math.abs(g.y1-g.y2)>30?u=setTimeout(function(){void 0!==g.el&&(g.el.trigger("swipe"),g.el.trigger("swipe"+t(g.x1,g.x2,g.y1,g.y2))),g={}},0):"last"in g&&(isNaN(h)||30>h&&30>M?l=setTimeout(function(){var t=e.Event("tap");t.cancelTouch=i,void 0!==g.el&&g.el.trigger(t),g.isDoubleTap?(void 0!==g.el&&g.el.trigger("doubleTap"),g={}):a=setTimeout(function(){a=null,void 0!==g.el&&g.el.trigger("singleTap"),g={}},250)},0):g={},h=M=0))}).on("touchcancel MSPointerCancel pointercancel",function(e){("touchcancel"==e.type&&v&&d||!v&&"pointercancel"==e.type&&w)&&i()}),e(window).on("scroll",i)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(t){e.fn[t]=function(n){return e(this).on(t,n)}})}}(jQuery);
|
@ -1,4 +1,4 @@
|
||||
/*! 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(UI) {
|
||||
|
||||
"use strict";
|
||||
@ -9,7 +9,8 @@
|
||||
|
||||
defaults: {
|
||||
cls: 'uk-margin-small-top',
|
||||
rowfirst: false
|
||||
rowfirst: false,
|
||||
observe: false
|
||||
},
|
||||
|
||||
boot: function() {
|
||||
@ -17,12 +18,12 @@
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("[data-uk-margin]", context).each(function() {
|
||||
UI.$('[data-uk-margin]', context).each(function() {
|
||||
|
||||
var ele = UI.$(this);
|
||||
|
||||
if (!ele.data("stackMargin")) {
|
||||
UI.stackMargin(ele, UI.Utils.options(ele.attr("data-uk-margin")));
|
||||
if (!ele.data('stackMargin')) {
|
||||
UI.stackMargin(ele, UI.Utils.options(ele.attr('data-uk-margin')));
|
||||
}
|
||||
});
|
||||
});
|
||||
@ -40,20 +41,23 @@
|
||||
|
||||
UI.$(function() {
|
||||
fn();
|
||||
UI.$win.on("load", fn);
|
||||
UI.$win.on('load', fn);
|
||||
});
|
||||
|
||||
return UI.Utils.debounce(fn, 20);
|
||||
})());
|
||||
|
||||
UI.$html.on("changed.uk.dom", function(e) {
|
||||
$this.process();
|
||||
});
|
||||
|
||||
this.on("display.uk.check", function(e) {
|
||||
if (this.element.is(":visible")) this.process();
|
||||
this.on('display.uk.check', function(e) {
|
||||
if (this.element.is(':visible')) this.process();
|
||||
}.bind(this));
|
||||
|
||||
if (this.options.observe) {
|
||||
|
||||
UI.domObserve(this.element, function(e) {
|
||||
if ($this.element.is(':visible')) $this.process();
|
||||
});
|
||||
}
|
||||
|
||||
stacks.push(this);
|
||||
},
|
||||
|
||||
@ -63,18 +67,25 @@
|
||||
|
||||
UI.Utils.stackMargin(columns, this.options);
|
||||
|
||||
if (!this.options.rowfirst) {
|
||||
if (!this.options.rowfirst || !columns.length) {
|
||||
return this;
|
||||
}
|
||||
|
||||
// Mark first column elements
|
||||
var pos_cache = columns.removeClass(this.options.rowfirst).filter(':visible').first().position();
|
||||
var group = {}, minleft = false;
|
||||
|
||||
if (pos_cache) {
|
||||
columns.each(function() {
|
||||
UI.$(this)[UI.$(this).position().left == pos_cache.left ? 'addClass':'removeClass']($this.options.rowfirst);
|
||||
});
|
||||
}
|
||||
columns.removeClass(this.options.rowfirst).each(function(offset, $ele){
|
||||
|
||||
$ele = UI.$(this);
|
||||
|
||||
if (this.style.display != 'none') {
|
||||
offset = $ele.offset().left;
|
||||
((group[offset] = group[offset] || []) && group[offset]).push(this);
|
||||
minleft = minleft === false ? offset : Math.min(minleft, offset);
|
||||
}
|
||||
});
|
||||
|
||||
UI.$(group[minleft]).addClass(this.options.rowfirst);
|
||||
|
||||
return this;
|
||||
}
|
||||
@ -95,7 +106,7 @@
|
||||
ratio = (width / iwidth),
|
||||
height = Math.floor(ratio * ele.data('height'));
|
||||
|
||||
ele.css({'height': (width < iwidth) ? height : ele.data('height')});
|
||||
ele.css({height: (width < iwidth) ? height : ele.data('height')});
|
||||
};
|
||||
|
||||
UI.component('responsiveElement', {
|
||||
@ -107,11 +118,11 @@
|
||||
// init code
|
||||
UI.ready(function(context) {
|
||||
|
||||
UI.$("iframe.uk-responsive-width, [data-uk-responsive]", context).each(function() {
|
||||
UI.$('iframe.uk-responsive-width, [data-uk-responsive]', context).each(function() {
|
||||
|
||||
var ele = UI.$(this), obj;
|
||||
|
||||
if (!ele.data("responsiveElement")) {
|
||||
if (!ele.data('responsiveElement')) {
|
||||
obj = UI.responsiveElement(ele, {});
|
||||
}
|
||||
});
|
||||
@ -125,10 +136,8 @@
|
||||
if (ele.attr('width') && ele.attr('height')) {
|
||||
|
||||
ele.data({
|
||||
|
||||
'width' : ele.attr('width'),
|
||||
'height': ele.attr('height')
|
||||
|
||||
width : ele.attr('width'),
|
||||
height: ele.attr('height')
|
||||
}).on('display.uk.check', function(){
|
||||
check(ele);
|
||||
});
|
||||
@ -151,40 +160,50 @@
|
||||
})();
|
||||
|
||||
|
||||
|
||||
// helper
|
||||
|
||||
UI.Utils.stackMargin = function(elements, options) {
|
||||
|
||||
options = UI.$.extend({
|
||||
'cls': 'uk-margin-small-top'
|
||||
cls: 'uk-margin-small-top'
|
||||
}, options);
|
||||
|
||||
options.cls = options.cls;
|
||||
|
||||
elements = UI.$(elements).removeClass(options.cls);
|
||||
|
||||
var skip = false,
|
||||
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
|
||||
var min = false;
|
||||
|
||||
if (offset === false || elements.length == 1) return;
|
||||
elements.each(function(offset, height, pos, $ele){
|
||||
|
||||
elements.each(function() {
|
||||
$ele = UI.$(this);
|
||||
|
||||
var column = UI.$(this);
|
||||
if ($ele.css('display') != 'none') {
|
||||
|
||||
if (column.is(":visible")) {
|
||||
offset = $ele.offset();
|
||||
height = $ele.outerHeight();
|
||||
pos = offset.top + height;
|
||||
|
||||
if (skip) {
|
||||
column.addClass(options.cls);
|
||||
} else {
|
||||
$ele.data({
|
||||
ukMarginPos: pos,
|
||||
ukMarginTop: offset.top
|
||||
});
|
||||
|
||||
if (column.position().top >= offset) {
|
||||
skip = column.addClass(options.cls);
|
||||
}
|
||||
if (min === false || (offset.top < min.top) ) {
|
||||
|
||||
min = {
|
||||
top : offset.top,
|
||||
left : offset.left,
|
||||
pos : pos
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
}).each(function($ele) {
|
||||
|
||||
$ele = UI.$(this);
|
||||
|
||||
if ($ele.css('display') != 'none' && $ele.data('ukMarginTop') > min.top && $ele.data('ukMarginPos') > min.pos) {
|
||||
$ele.addClass(options.cls);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@ -294,4 +313,23 @@
|
||||
|
||||
})({});
|
||||
|
||||
})(UIkit);
|
||||
UI.Utils.getCssVar = function(name) {
|
||||
|
||||
/* usage in css: .var-name:before { content:"xyz" } */
|
||||
|
||||
var val, doc = document.documentElement, element = doc.appendChild(document.createElement('div'));
|
||||
|
||||
element.classList.add('var-'+name);
|
||||
|
||||
try {
|
||||
val = JSON.parse(val = getComputedStyle(element, ':before').content.replace(/^["'](.*)["']$/, '$1'));
|
||||
} catch (e) {
|
||||
val = undefined;
|
||||
}
|
||||
|
||||
doc.removeChild(element);
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
})(UIkit2);
|
||||
|
4
media/uikit/js/core/utility.min.js
vendored
4
media/uikit/js/core/utility.min.js
vendored
@ -1,2 +1,2 @@
|
||||
/*! UIkit 2.25.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";var i=[];t.component("stackMargin",{defaults:{cls:"uk-margin-small-top",rowfirst:!1},boot:function(){t.ready(function(i){t.$("[data-uk-margin]",i).each(function(){var i=t.$(this);i.data("stackMargin")||t.stackMargin(i,t.Utils.options(i.attr("data-uk-margin")))})})},init:function(){var n=this;t.$win.on("resize orientationchange",function(){var i=function(){n.process()};return t.$(function(){i(),t.$win.on("load",i)}),t.Utils.debounce(i,20)}()),t.$html.on("changed.uk.dom",function(){n.process()}),this.on("display.uk.check",function(){this.element.is(":visible")&&this.process()}.bind(this)),i.push(this)},process:function(){var i=this,n=this.element.children();if(t.Utils.stackMargin(n,this.options),!this.options.rowfirst)return this;var s=n.removeClass(this.options.rowfirst).filter(":visible").first().position();return s&&n.each(function(){t.$(this)[t.$(this).position().left==s.left?"addClass":"removeClass"](i.options.rowfirst)}),this}}),function(){var i=[],n=function(t){if(t.is(":visible")){var i=t.parent().width(),n=t.data("width"),s=i/n,e=Math.floor(s*t.data("height"));t.css({height:n>i?e:t.data("height")})}};t.component("responsiveElement",{defaults:{},boot:function(){t.ready(function(i){t.$("iframe.uk-responsive-width, [data-uk-responsive]",i).each(function(){var i,n=t.$(this);n.data("responsiveElement")||(i=t.responsiveElement(n,{}))})})},init:function(){var t=this.element;t.attr("width")&&t.attr("height")&&(t.data({width:t.attr("width"),height:t.attr("height")}).on("display.uk.check",function(){n(t)}),n(t),i.push(t))}}),t.$win.on("resize load",t.Utils.debounce(function(){i.forEach(function(t){n(t)})},15))}(),t.Utils.stackMargin=function(i,n){n=t.$.extend({cls:"uk-margin-small-top"},n),n.cls=n.cls,i=t.$(i).removeClass(n.cls);var s=!1,e=i.filter(":visible:first"),a=e.length?e.position().top+e.outerHeight()-1:!1;a!==!1&&1!=i.length&&i.each(function(){var i=t.$(this);i.is(":visible")&&(s?i.addClass(n.cls):i.position().top>=a&&(s=i.addClass(n.cls)))})},t.Utils.matchHeights=function(i,n){i=t.$(i).css("min-height",""),n=t.$.extend({row:!0},n);var s=function(i){if(!(i.length<2)){var n=0;i.each(function(){n=Math.max(n,t.$(this).outerHeight())}).each(function(){var i=t.$(this),s=n-("border-box"==i.css("box-sizing")?0:i.outerHeight()-i.height());i.css("min-height",s+"px")})}};n.row?(i.first().width(),setTimeout(function(){var n=!1,e=[];i.each(function(){var i=t.$(this),a=i.offset().top;a!=n&&e.length&&(s(t.$(e)),e=[],a=i.offset().top),e.push(i),n=a}),e.length&&s(t.$(e))},0)):s(i)},function(i){t.Utils.inlineSvg=function(n,s){t.$(n||'img[src$=".svg"]',s||document).each(function(){var n=t.$(this),s=n.attr("src");if(!i[s]){var e=t.$.Deferred();t.$.get(s,{nc:Math.random()},function(i){e.resolve(t.$(i).find("svg"))}),i[s]=e.promise()}i[s].then(function(i){var s=t.$(i).clone();n.attr("id")&&s.attr("id",n.attr("id")),n.attr("class")&&s.attr("class",n.attr("class")),n.attr("style")&&s.attr("style",n.attr("style")),n.attr("width")&&(s.attr("width",n.attr("width")),n.attr("height")||s.removeAttr("height")),n.attr("height")&&(s.attr("height",n.attr("height")),n.attr("width")||s.removeAttr("width")),n.replaceWith(s)})})},t.ready(function(i){t.Utils.inlineSvg("[data-uk-svg]",i)})}({})}(UIkit);
|
||||
/*! UIkit 2.27.4 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
||||
!function(t){"use strict";var i=[];t.component("stackMargin",{defaults:{cls:"uk-margin-small-top",rowfirst:!1,observe:!1},boot:function(){t.ready(function(i){t.$("[data-uk-margin]",i).each(function(){var i=t.$(this);i.data("stackMargin")||t.stackMargin(i,t.Utils.options(i.attr("data-uk-margin")))})})},init:function(){var e=this;t.$win.on("resize orientationchange",function(){var i=function(){e.process()};return t.$(function(){i(),t.$win.on("load",i)}),t.Utils.debounce(i,20)}()),this.on("display.uk.check",function(){this.element.is(":visible")&&this.process()}.bind(this)),this.options.observe&&t.domObserve(this.element,function(){e.element.is(":visible")&&e.process()}),i.push(this)},process:function(){var i=this.element.children();if(t.Utils.stackMargin(i,this.options),!this.options.rowfirst||!i.length)return this;var e={},n=!1;return i.removeClass(this.options.rowfirst).each(function(i,s){s=t.$(this),"none"!=this.style.display&&(i=s.offset().left,((e[i]=e[i]||[])&&e[i]).push(this),n=n===!1?i:Math.min(n,i))}),t.$(e[n]).addClass(this.options.rowfirst),this}}),function(){var i=[],e=function(t){if(t.is(":visible")){var i=t.parent().width(),e=t.data("width"),n=i/e,s=Math.floor(n*t.data("height"));t.css({height:e>i?s:t.data("height")})}};t.component("responsiveElement",{defaults:{},boot:function(){t.ready(function(i){t.$("iframe.uk-responsive-width, [data-uk-responsive]",i).each(function(){var i,e=t.$(this);e.data("responsiveElement")||(i=t.responsiveElement(e,{}))})})},init:function(){var t=this.element;t.attr("width")&&t.attr("height")&&(t.data({width:t.attr("width"),height:t.attr("height")}).on("display.uk.check",function(){e(t)}),e(t),i.push(t))}}),t.$win.on("resize load",t.Utils.debounce(function(){i.forEach(function(t){e(t)})},15))}(),t.Utils.stackMargin=function(i,e){e=t.$.extend({cls:"uk-margin-small-top"},e),i=t.$(i).removeClass(e.cls);var n=!1;i.each(function(i,e,s,a){a=t.$(this),"none"!=a.css("display")&&(i=a.offset(),e=a.outerHeight(),s=i.top+e,a.data({ukMarginPos:s,ukMarginTop:i.top}),(n===!1||i.top<n.top)&&(n={top:i.top,left:i.left,pos:s}))}).each(function(i){i=t.$(this),"none"!=i.css("display")&&i.data("ukMarginTop")>n.top&&i.data("ukMarginPos")>n.pos&&i.addClass(e.cls)})},t.Utils.matchHeights=function(i,e){i=t.$(i).css("min-height",""),e=t.$.extend({row:!0},e);var n=function(i){if(!(i.length<2)){var e=0;i.each(function(){e=Math.max(e,t.$(this).outerHeight())}).each(function(){var i=t.$(this),n=e-("border-box"==i.css("box-sizing")?0:i.outerHeight()-i.height());i.css("min-height",n+"px")})}};e.row?(i.first().width(),setTimeout(function(){var e=!1,s=[];i.each(function(){var i=t.$(this),a=i.offset().top;a!=e&&s.length&&(n(t.$(s)),s=[],a=i.offset().top),s.push(i),e=a}),s.length&&n(t.$(s))},0)):n(i)},function(i){t.Utils.inlineSvg=function(e,n){t.$(e||'img[src$=".svg"]',n||document).each(function(){var e=t.$(this),n=e.attr("src");if(!i[n]){var s=t.$.Deferred();t.$.get(n,{nc:Math.random()},function(i){s.resolve(t.$(i).find("svg"))}),i[n]=s.promise()}i[n].then(function(i){var n=t.$(i).clone();e.attr("id")&&n.attr("id",e.attr("id")),e.attr("class")&&n.attr("class",e.attr("class")),e.attr("style")&&n.attr("style",e.attr("style")),e.attr("width")&&(n.attr("width",e.attr("width")),e.attr("height")||n.removeAttr("height")),e.attr("height")&&(n.attr("height",e.attr("height")),e.attr("width")||n.removeAttr("width")),e.replaceWith(n)})})},t.ready(function(i){t.Utils.inlineSvg("[data-uk-svg]",i)})}({}),t.Utils.getCssVar=function(t){var i,e=document.documentElement,n=e.appendChild(document.createElement("div"));n.classList.add("var-"+t);try{i=JSON.parse(i=getComputedStyle(n,":before").content.replace(/^["'](.*)["']$/,"$1"))}catch(s){i=void 0}return e.removeChild(n),i}}(UIkit2);
|
File diff suppressed because it is too large
Load Diff
6
media/uikit/js/uikit.min.js
vendored
6
media/uikit/js/uikit.min.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user