uikit-rails 0.0.2 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -3
- data/Gemfile +2 -1
- data/LICENSE.txt +21 -0
- data/README.md +65 -0
- data/Rakefile +0 -1
- data/assets/fonts/FontAwesome.otf +0 -0
- data/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/assets/fonts/fontawesome-webfont.woff +0 -0
- data/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/assets/javascripts/components/accordion.js +174 -0
- data/assets/javascripts/components/accordion.min.js +2 -0
- data/assets/javascripts/components/autocomplete.js +334 -0
- data/assets/javascripts/components/autocomplete.min.js +2 -0
- data/assets/javascripts/components/datepicker.js +3166 -0
- data/assets/javascripts/components/datepicker.min.js +3 -0
- data/assets/javascripts/components/form-password.js +67 -0
- data/assets/javascripts/components/form-password.min.js +2 -0
- data/assets/javascripts/components/form-select.js +70 -0
- data/assets/javascripts/components/form-select.min.js +2 -0
- data/assets/javascripts/components/grid.js +527 -0
- data/assets/javascripts/components/grid.min.js +2 -0
- data/assets/javascripts/components/htmleditor.js +623 -0
- data/assets/javascripts/components/htmleditor.min.js +2 -0
- data/assets/javascripts/components/lightbox.js +555 -0
- data/assets/javascripts/components/lightbox.min.js +2 -0
- data/assets/javascripts/components/nestable.js +638 -0
- data/assets/javascripts/components/nestable.min.js +2 -0
- data/assets/javascripts/components/notify.js +189 -0
- data/assets/javascripts/components/notify.min.js +2 -0
- data/assets/javascripts/components/pagination.js +147 -0
- data/assets/javascripts/components/pagination.min.js +2 -0
- data/assets/javascripts/components/parallax.js +435 -0
- data/assets/javascripts/components/parallax.min.js +2 -0
- data/assets/javascripts/components/search.js +92 -0
- data/assets/javascripts/components/search.min.js +2 -0
- data/assets/javascripts/components/slider.js +531 -0
- data/assets/javascripts/components/slider.min.js +2 -0
- data/assets/javascripts/components/slideset.js +506 -0
- data/assets/javascripts/components/slideset.min.js +2 -0
- data/assets/javascripts/components/slideshow-fx.js +375 -0
- data/assets/javascripts/components/slideshow-fx.min.js +2 -0
- data/assets/javascripts/components/slideshow.js +562 -0
- data/assets/javascripts/components/slideshow.min.js +2 -0
- data/assets/javascripts/components/sortable.js +688 -0
- data/assets/javascripts/components/sortable.min.js +2 -0
- data/assets/javascripts/components/sticky.js +359 -0
- data/assets/javascripts/components/sticky.min.js +2 -0
- data/assets/javascripts/components/timepicker.js +192 -0
- data/assets/javascripts/components/timepicker.min.js +2 -0
- data/assets/javascripts/components/tooltip.js +234 -0
- data/assets/javascripts/components/tooltip.min.js +2 -0
- data/assets/javascripts/components/upload.js +260 -0
- data/assets/javascripts/components/upload.min.js +2 -0
- data/assets/javascripts/core/alert.js +66 -0
- data/assets/javascripts/core/alert.min.js +2 -0
- data/assets/javascripts/core/button.js +157 -0
- data/assets/javascripts/core/button.min.js +2 -0
- data/assets/javascripts/core/core.js +730 -0
- data/assets/javascripts/core/core.min.js +2 -0
- data/assets/javascripts/core/cover.js +95 -0
- data/assets/javascripts/core/cover.min.js +2 -0
- data/assets/javascripts/core/dropdown.js +514 -0
- data/assets/javascripts/core/dropdown.min.js +2 -0
- data/assets/javascripts/core/grid.js +114 -0
- data/assets/javascripts/core/grid.min.js +2 -0
- data/assets/javascripts/core/modal.js +384 -0
- data/assets/javascripts/core/modal.min.js +2 -0
- data/assets/javascripts/core/nav.js +136 -0
- data/assets/javascripts/core/nav.min.js +2 -0
- data/assets/javascripts/core/offcanvas.js +180 -0
- data/assets/javascripts/core/offcanvas.min.js +2 -0
- data/assets/javascripts/core/scrollspy.js +208 -0
- data/assets/javascripts/core/scrollspy.min.js +2 -0
- data/assets/javascripts/core/smooth-scroll.js +62 -0
- data/assets/javascripts/core/smooth-scroll.min.js +2 -0
- data/assets/javascripts/core/switcher.js +309 -0
- data/assets/javascripts/core/switcher.min.js +2 -0
- data/assets/javascripts/core/tab.js +167 -0
- data/assets/javascripts/core/tab.min.js +2 -0
- data/assets/javascripts/core/toggle.js +120 -0
- data/assets/javascripts/core/toggle.min.js +2 -0
- data/assets/javascripts/core/touch.js +175 -0
- data/assets/javascripts/core/touch.min.js +2 -0
- data/assets/javascripts/core/utility.js +289 -0
- data/assets/javascripts/core/utility.min.js +2 -0
- data/assets/javascripts/uikit-components.js +23 -0
- data/assets/javascripts/uikit.js +3706 -0
- data/assets/javascripts/uikit.min.js +3 -0
- data/assets/stylesheets/components/accordion.scss +94 -0
- data/assets/stylesheets/components/autocomplete.scss +102 -0
- data/assets/stylesheets/components/datepicker.scss +197 -0
- data/assets/stylesheets/components/dotnav.scss +212 -0
- data/assets/stylesheets/components/form-advanced.scss +128 -0
- data/assets/stylesheets/components/form-file.scss +63 -0
- data/assets/stylesheets/components/form-password.scss +74 -0
- data/assets/stylesheets/components/form-select.scss +66 -0
- data/assets/stylesheets/components/htmleditor.scss +269 -0
- data/assets/stylesheets/components/nestable.scss +229 -0
- data/assets/stylesheets/components/notify.scss +190 -0
- data/assets/stylesheets/components/placeholder.scss +66 -0
- data/assets/stylesheets/components/progress.scss +173 -0
- data/assets/stylesheets/components/search.scss +309 -0
- data/assets/stylesheets/components/slidenav.scss +183 -0
- data/assets/stylesheets/components/slider.scss +131 -0
- data/assets/stylesheets/components/slideshow.scss +208 -0
- data/assets/stylesheets/components/sortable.scss +122 -0
- data/assets/stylesheets/components/sticky.scss +64 -0
- data/assets/stylesheets/components/tooltip.scss +177 -0
- data/assets/stylesheets/components/upload.scss +34 -0
- data/assets/stylesheets/core/alert.scss +141 -0
- data/assets/stylesheets/core/animation.scss +599 -0
- data/assets/stylesheets/core/article.scss +139 -0
- data/assets/stylesheets/core/badge.scss +110 -0
- data/assets/stylesheets/core/base-noconflict.scss +397 -0
- data/assets/stylesheets/core/base.scss +541 -0
- data/assets/stylesheets/core/block.scss +153 -0
- data/assets/stylesheets/core/breadcrumb.scss +86 -0
- data/assets/stylesheets/core/button.scss +406 -0
- data/assets/stylesheets/core/close.scss +132 -0
- data/assets/stylesheets/core/column.scss +209 -0
- data/assets/stylesheets/core/comment.scss +172 -0
- data/assets/stylesheets/core/contrast.scss +493 -0
- data/assets/stylesheets/core/cover.scss +70 -0
- data/assets/stylesheets/core/description-list.scss +71 -0
- data/assets/stylesheets/core/dropdown.scss +280 -0
- data/assets/stylesheets/core/flex.scss +320 -0
- data/assets/stylesheets/core/form.scss +627 -0
- data/assets/stylesheets/core/grid.scss +688 -0
- data/assets/stylesheets/core/icon.scss +897 -0
- data/assets/stylesheets/core/list.scss +102 -0
- data/assets/stylesheets/core/modal.scss +341 -0
- data/assets/stylesheets/core/nav.scss +468 -0
- data/assets/stylesheets/core/navbar.scss +325 -0
- data/assets/stylesheets/core/offcanvas.scss +168 -0
- data/assets/stylesheets/core/overlay.scss +534 -0
- data/assets/stylesheets/core/pagination.scss +197 -0
- data/assets/stylesheets/core/panel.scss +332 -0
- data/assets/stylesheets/core/print.scss +59 -0
- data/assets/stylesheets/core/subnav.scss +213 -0
- data/assets/stylesheets/core/switcher.scss +38 -0
- data/assets/stylesheets/core/tab.scss +368 -0
- data/assets/stylesheets/core/table.scss +147 -0
- data/assets/stylesheets/core/text.scss +128 -0
- data/assets/stylesheets/core/thumbnail.scss +122 -0
- data/assets/stylesheets/core/thumbnav.scss +122 -0
- data/assets/stylesheets/core/utility.scss +606 -0
- data/assets/stylesheets/core/variables.scss +23 -0
- data/assets/stylesheets/uikit-components.scss +22 -0
- data/assets/stylesheets/uikit-mixins.scss +327 -0
- data/assets/stylesheets/uikit-variables.scss +817 -0
- data/assets/stylesheets/uikit.scss +56 -0
- data/lib/uikit-rails.rb +2 -2
- data/lib/uikit-rails/engine.rb +11 -1
- data/lib/uikit-rails/version.rb +1 -3
- data/uikit-rails.gemspec +15 -16
- metadata +169 -44
- data/README.rb +0 -1
- data/vendor/assets/javascripts/ui.card.js +0 -115
- data/vendor/assets/javascripts/ui.color-picker.js +0 -351
- data/vendor/assets/javascripts/ui.confirmation.js +0 -133
- data/vendor/assets/javascripts/ui.dialog.js +0 -252
- data/vendor/assets/javascripts/ui.emitter.js +0 -99
- data/vendor/assets/javascripts/ui.js +0 -1641
- data/vendor/assets/javascripts/ui.menu.js +0 -238
- data/vendor/assets/javascripts/ui.notification.js +0 -240
- data/vendor/assets/javascripts/ui.overlay.js +0 -79
- data/vendor/assets/javascripts/ui.split-button.js +0 -108
- data/vendor/assets/stylesheets/ui.card.css +0 -55
- data/vendor/assets/stylesheets/ui.color-picker.css +0 -6
- data/vendor/assets/stylesheets/ui.confirmation.css +0 -7
- data/vendor/assets/stylesheets/ui.css +0 -337
- data/vendor/assets/stylesheets/ui.dialog.css +0 -92
- data/vendor/assets/stylesheets/ui.menu.css +0 -32
- data/vendor/assets/stylesheets/ui.notification.css +0 -107
- data/vendor/assets/stylesheets/ui.overlay.css +0 -16
- data/vendor/assets/stylesheets/ui.split-button.css +0 -27
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
!function(t){if("function"==typeof define&&define.amd&&define("uikit",function(){var n=window.UIkit||t(window,window.jQuery,window.document);return n.load=function(t,e,o,i){var r,a=t.split(","),s=[],u=(i.config&&i.config.uikit&&i.config.uikit.base?i.config.uikit.base:"").replace(/\/+$/g,"");if(!u)throw new Error("Please define base path to UIkit in the requirejs config.");for(r=0;r<a.length;r+=1){var c=a[r].replace(/\./g,"/");s.push(u+"/components/"+c)}e(s,function(){o(n)})},n}),!window.jQuery)throw new Error("UIkit requires jQuery");window&&window.jQuery&&t(window,window.jQuery,window.document)}(function(t,n,e){"use strict";var o={},i=t.UIkit?Object.create(t.UIkit):void 0;if(o.version="2.24.2",o.noConflict=function(){return i&&(t.UIkit=i,n.UIkit=i,n.fn.uk=i.fn),o},o.prefix=function(t){return t},o.$=n,o.$doc=o.$(document),o.$win=o.$(window),o.$html=o.$("html"),o.support={},o.support.transition=function(){var t=function(){var t,n=e.body||e.documentElement,o={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(t in o)if(void 0!==n.style[t])return o[t]}();return t&&{end:t}}(),o.support.animation=function(){var t=function(){var t,n=e.body||e.documentElement,o={WebkitAnimation:"webkitAnimationEnd",MozAnimation:"animationend",OAnimation:"oAnimationEnd oanimationend",animation:"animationend"};for(t in o)if(void 0!==n.style[t])return o[t]}();return t&&{end:t}}(),function(){Date.now=Date.now||function(){return(new Date).getTime()};for(var t=["webkit","moz"],n=0;n<t.length&&!window.requestAnimationFrame;++n){var e=t[n];window.requestAnimationFrame=window[e+"RequestAnimationFrame"],window.cancelAnimationFrame=window[e+"CancelAnimationFrame"]||window[e+"CancelRequestAnimationFrame"]}if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){var o=0;window.requestAnimationFrame=function(t){var n=Date.now(),e=Math.max(o+16,n);return setTimeout(function(){t(o=e)},e-n)},window.cancelAnimationFrame=clearTimeout}}(),o.support.touch="ontouchstart"in document||t.DocumentTouch&&document instanceof t.DocumentTouch||t.navigator.msPointerEnabled&&t.navigator.msMaxTouchPoints>0||t.navigator.pointerEnabled&&t.navigator.maxTouchPoints>0||!1,o.support.mutationobserver=t.MutationObserver||t.WebKitMutationObserver||null,o.Utils={},o.Utils.isFullscreen=function(){return document.webkitFullscreenElement||document.mozFullScreenElement||document.msFullscreenElement||document.fullscreenElement||!1},o.Utils.str2json=function(t,n){try{return n?JSON.parse(t.replace(/([\$\w]+)\s*:/g,function(t,n){return'"'+n+'":'}).replace(/'([^']+)'/g,function(t,n){return'"'+n+'"'})):new Function("","var json = "+t+"; return JSON.parse(JSON.stringify(json));")()}catch(e){return!1}},o.Utils.debounce=function(t,n,e){var o;return function(){var i=this,r=arguments,a=function(){o=null,e||t.apply(i,r)},s=e&&!o;clearTimeout(o),o=setTimeout(a,n),s&&t.apply(i,r)}},o.Utils.removeCssRules=function(t){var n,e,o,i,r,a,s,u,c,d;t&&setTimeout(function(){try{for(d=document.styleSheets,i=0,s=d.length;s>i;i++){for(o=d[i],e=[],o.cssRules=o.cssRules,n=r=0,u=o.cssRules.length;u>r;n=++r)o.cssRules[n].type===CSSRule.STYLE_RULE&&t.test(o.cssRules[n].selectorText)&&e.unshift(n);for(a=0,c=e.length;c>a;a++)o.deleteRule(e[a])}}catch(l){}},0)},o.Utils.isInView=function(t,e){var i=n(t);if(!i.is(":visible"))return!1;var r=o.$win.scrollLeft(),a=o.$win.scrollTop(),s=i.offset(),u=s.left,c=s.top;return e=n.extend({topoffset:0,leftoffset:0},e),c+i.height()>=a&&c-e.topoffset<=a+o.$win.height()&&u+i.width()>=r&&u-e.leftoffset<=r+o.$win.width()?!0:!1},o.Utils.checkDisplay=function(t,e){var i=o.$("[data-uk-margin], [data-uk-grid-match], [data-uk-grid-margin], [data-uk-check-display]",t||document);return t&&!i.length&&(i=n(t)),i.trigger("display.uk.check"),e&&("string"!=typeof e&&(e='[class*="uk-animation-"]'),i.find(e).each(function(){var t=o.$(this),n=t.attr("class"),e=n.match(/uk\-animation\-(.+)/);t.removeClass(e[0]).width(),t.addClass(e[0])})),i},o.Utils.options=function(t){if(n.isPlainObject(t))return t;var e=t?t.indexOf("{"):-1,i={};if(-1!=e)try{i=o.Utils.str2json(t.substr(e))}catch(r){}return i},o.Utils.animate=function(t,e){var i=n.Deferred();return t=o.$(t),e=e,t.css("display","none").addClass(e).one(o.support.animation.end,function(){t.removeClass(e),i.resolve()}).width(),t.css("display",""),i.promise()},o.Utils.uid=function(t){return(t||"id")+(new Date).getTime()+"RAND"+Math.ceil(1e5*Math.random())},o.Utils.template=function(t,n){for(var e,o,i,r,a=t.replace(/\n/g,"\\n").replace(/\{\{\{\s*(.+?)\s*\}\}\}/g,"{{!$1}}").split(/(\{\{\s*(.+?)\s*\}\})/g),s=0,u=[],c=0;s<a.length;){if(e=a[s],e.match(/\{\{\s*(.+?)\s*\}\}/))switch(s+=1,e=a[s],o=e[0],i=e.substring(e.match(/^(\^|\#|\!|\~|\:)/)?1:0),o){case"~":u.push("for(var $i=0;$i<"+i+".length;$i++) { var $item = "+i+"[$i];"),c++;break;case":":u.push("for(var $key in "+i+") { var $val = "+i+"[$key];"),c++;break;case"#":u.push("if("+i+") {"),c++;break;case"^":u.push("if(!"+i+") {"),c++;break;case"/":u.push("}"),c--;break;case"!":u.push("__ret.push("+i+");");break;default:u.push("__ret.push(escape("+i+"));")}else u.push("__ret.push('"+e.replace(/\'/g,"\\'")+"');");s+=1}return r=new Function("$data",["var __ret = [];","try {","with($data){",c?'__ret = ["Not all blocks are closed correctly."]':u.join(""),"};","}catch(e){__ret = [e.message];}",'return __ret.join("").replace(/\\n\\n/g, "\\n");',"function escape(html) { return String(html).replace(/&/g, '&').replace(/\"/g, '"').replace(/</g, '<').replace(/>/g, '>');}"].join("\n")),n?r(n):r},o.Utils.events={},o.Utils.events.click=o.support.touch?"tap":"click",t.UIkit=o,o.fn=function(t,e){var i=arguments,r=t.match(/^([a-z\-]+)(?:\.([a-z]+))?/i),a=r[1],s=r[2];return o[a]?this.each(function(){var t=n(this),r=t.data(a);r||t.data(a,r=o[a](this,s?void 0:e)),s&&r[s].apply(r,Array.prototype.slice.call(i,1))}):(n.error("UIkit component ["+a+"] does not exist."),this)},n.UIkit=o,n.fn.uk=o.fn,o.langdirection="rtl"==o.$html.attr("dir")?"right":"left",o.components={},o.component=function(t,e){var i=function(e,r){var a=this;return this.UIkit=o,this.element=e?o.$(e):null,this.options=n.extend(!0,{},this.defaults,r),this.plugins={},this.element&&this.element.data(t,this),this.init(),(this.options.plugins.length?this.options.plugins:Object.keys(i.plugins)).forEach(function(t){i.plugins[t].init&&(i.plugins[t].init(a),a.plugins[t]=!0)}),this.trigger("init.uk.component",[t,this]),this};return i.plugins={},n.extend(!0,i.prototype,{defaults:{plugins:[]},boot:function(){},init:function(){},on:function(t,n,e){return o.$(this.element||this).on(t,n,e)},one:function(t,n,e){return o.$(this.element||this).one(t,n,e)},off:function(t){return o.$(this.element||this).off(t)},trigger:function(t,n){return o.$(this.element||this).trigger(t,n)},find:function(t){return o.$(this.element?this.element:[]).find(t)},proxy:function(t,n){var e=this;n.split(" ").forEach(function(n){e[n]||(e[n]=function(){return t[n].apply(t,arguments)})})},mixin:function(t,n){var e=this;n.split(" ").forEach(function(n){e[n]||(e[n]=t[n].bind(e))})},option:function(){return 1==arguments.length?this.options[arguments[0]]||void 0:(2==arguments.length&&(this.options[arguments[0]]=arguments[1]),void 0)}},e),this.components[t]=i,this[t]=function(){var e,i;if(arguments.length)switch(arguments.length){case 1:"string"==typeof arguments[0]||arguments[0].nodeType||arguments[0]instanceof jQuery?e=n(arguments[0]):i=arguments[0];break;case 2:e=n(arguments[0]),i=arguments[1]}return e&&e.data(t)?e.data(t):new o.components[t](e,i)},o.domready&&o.component.boot(t),i},o.plugin=function(t,n,e){this.components[t].plugins[n]=e},o.component.boot=function(t){o.components[t].prototype&&o.components[t].prototype.boot&&!o.components[t].booted&&(o.components[t].prototype.boot.apply(o,[]),o.components[t].booted=!0)},o.component.bootComponents=function(){for(var t in o.components)o.component.boot(t)},o.domObservers=[],o.domready=!1,o.ready=function(t){o.domObservers.push(t),o.domready&&t(document)},o.on=function(t,n,e){return t&&t.indexOf("ready.uk.dom")>-1&&o.domready&&n.apply(o.$doc),o.$doc.on(t,n,e)},o.one=function(t,n,e){return t&&t.indexOf("ready.uk.dom")>-1&&o.domready?(n.apply(o.$doc),o.$doc):o.$doc.one(t,n,e)},o.trigger=function(t,n){return o.$doc.trigger(t,n)},o.domObserve=function(t,n){o.support.mutationobserver&&(n=n||function(){},o.$(t).each(function(){var t=this,e=o.$(t);if(!e.data("observer"))try{var i=new o.support.mutationobserver(o.Utils.debounce(function(){n.apply(t,[]),e.trigger("changed.uk.dom")},50));i.observe(t,{childList:!0,subtree:!0}),e.data("observer",i)}catch(r){}}))},o.init=function(t){t=t||document,o.domObservers.forEach(function(n){n(t)})},o.on("domready.uk.dom",function(){o.init(),o.domready&&o.Utils.checkDisplay()}),n(function(){o.$body=o.$("body"),o.ready(function(){o.domObserve("[data-uk-observe]")}),o.on("changed.uk.dom",function(t){o.init(t.target),o.Utils.checkDisplay(t.target)}),o.trigger("beforeready.uk.dom"),o.component.bootComponents(),requestAnimationFrame(function(){var t,n={x:window.pageXOffset,y:window.pageYOffset},e=function(){(n.x!=window.pageXOffset||n.y!=window.pageYOffset)&&(t={x:0,y:0},window.pageXOffset!=n.x&&(t.x=window.pageXOffset>n.x?1:-1),window.pageYOffset!=n.y&&(t.y=window.pageYOffset>n.y?1:-1),n={dir:t,x:window.pageXOffset,y:window.pageYOffset},o.$doc.trigger("scrolling.uk.document",[n])),requestAnimationFrame(e)};return o.support.touch&&o.$html.on("touchmove touchend MSPointerMove MSPointerUp pointermove pointerup",e),(n.x||n.y)&&e(),e}()),o.trigger("domready.uk.dom"),o.support.touch&&navigator.userAgent.match(/(iPad|iPhone|iPod)/g)&&o.$win.on("load orientationchange resize",o.Utils.debounce(function(){var t=function(){return n(".uk-height-viewport").css("height",window.innerHeight),t};return t()}(),100)),o.trigger("afterready.uk.dom"),o.domready=!0}),o.$html.addClass(o.support.touch?"uk-touch":"uk-notouch"),o.support.touch){var r,a=!1,s="uk-hover",u=".uk-overlay, .uk-overlay-hover, .uk-overlay-toggle, .uk-animation-hover, .uk-has-hover";o.$html.on("mouseenter touchstart MSPointerDown pointerdown",u,function(){a&&n("."+s).removeClass(s),a=n(this).addClass(s)}).on("mouseleave touchend MSPointerUp pointerup",function(t){r=n(t.target).parents(u),a&&a.not(r).removeClass(s)})}return o});
|
@@ -0,0 +1,95 @@
|
|
1
|
+
/*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
(function(UI){
|
3
|
+
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
UI.component('cover', {
|
7
|
+
|
8
|
+
defaults: {
|
9
|
+
automute : true
|
10
|
+
},
|
11
|
+
|
12
|
+
boot: function() {
|
13
|
+
|
14
|
+
// auto init
|
15
|
+
UI.ready(function(context) {
|
16
|
+
|
17
|
+
UI.$("[data-uk-cover]", context).each(function(){
|
18
|
+
|
19
|
+
var ele = UI.$(this);
|
20
|
+
|
21
|
+
if(!ele.data("cover")) {
|
22
|
+
var plugin = UI.cover(ele, UI.Utils.options(ele.attr("data-uk-cover")));
|
23
|
+
}
|
24
|
+
});
|
25
|
+
});
|
26
|
+
},
|
27
|
+
|
28
|
+
init: function() {
|
29
|
+
|
30
|
+
this.parent = this.element.parent();
|
31
|
+
|
32
|
+
UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(){
|
33
|
+
this.check();
|
34
|
+
}.bind(this), 100));
|
35
|
+
|
36
|
+
this.on("display.uk.check", function(e) {
|
37
|
+
if(this.element.is(":visible")) this.check();
|
38
|
+
}.bind(this));
|
39
|
+
|
40
|
+
this.check();
|
41
|
+
|
42
|
+
if (this.element.is('iframe') && this.options.automute) {
|
43
|
+
|
44
|
+
var src = this.element.attr('src');
|
45
|
+
|
46
|
+
this.element.attr('src', '').on('load', function(){
|
47
|
+
|
48
|
+
this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}', '*');
|
49
|
+
|
50
|
+
}).attr('src', [src, (src.indexOf('?') > -1 ? '&':'?'), 'enablejsapi=1&api=1'].join(''));
|
51
|
+
}
|
52
|
+
},
|
53
|
+
|
54
|
+
check: function() {
|
55
|
+
|
56
|
+
this.element.css({
|
57
|
+
'width' : '',
|
58
|
+
'height' : ''
|
59
|
+
});
|
60
|
+
|
61
|
+
this.dimension = {w: this.element.width(), h: this.element.height()};
|
62
|
+
|
63
|
+
if (this.element.attr('width') && !isNaN(this.element.attr('width'))) {
|
64
|
+
this.dimension.w = this.element.attr('width');
|
65
|
+
}
|
66
|
+
|
67
|
+
if (this.element.attr('height') && !isNaN(this.element.attr('height'))) {
|
68
|
+
this.dimension.h = this.element.attr('height');
|
69
|
+
}
|
70
|
+
|
71
|
+
this.ratio = this.dimension.w / this.dimension.h;
|
72
|
+
|
73
|
+
var w = this.parent.width(), h = this.parent.height(), width, height;
|
74
|
+
|
75
|
+
// if element height < parent height (gap underneath)
|
76
|
+
if ((w / this.ratio) < h) {
|
77
|
+
|
78
|
+
width = Math.ceil(h * this.ratio);
|
79
|
+
height = h;
|
80
|
+
|
81
|
+
// element width < parent width (gap to right)
|
82
|
+
} else {
|
83
|
+
|
84
|
+
width = w;
|
85
|
+
height = Math.ceil(w / this.ratio);
|
86
|
+
}
|
87
|
+
|
88
|
+
this.element.css({
|
89
|
+
'width' : width,
|
90
|
+
'height' : height
|
91
|
+
});
|
92
|
+
}
|
93
|
+
});
|
94
|
+
|
95
|
+
})(UIkit);
|
@@ -0,0 +1,2 @@
|
|
1
|
+
/*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
!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);
|
@@ -0,0 +1,514 @@
|
|
1
|
+
/*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
(function(UI) {
|
3
|
+
|
4
|
+
"use strict";
|
5
|
+
|
6
|
+
var active = false, hoverIdle, flips = {
|
7
|
+
'x': {
|
8
|
+
"bottom-left" : 'bottom-right',
|
9
|
+
"bottom-right" : 'bottom-left',
|
10
|
+
"bottom-center" : 'bottom-right',
|
11
|
+
"top-left" : 'top-right',
|
12
|
+
"top-right" : 'top-left',
|
13
|
+
"top-center" : 'top-right',
|
14
|
+
"left-top" : 'right',
|
15
|
+
"left-bottom" : 'right-bottom',
|
16
|
+
"left-center" : 'right-center',
|
17
|
+
"right-top" : 'left',
|
18
|
+
"right-bottom" : 'left-bottom',
|
19
|
+
"right-center" : 'left-center'
|
20
|
+
},
|
21
|
+
'y': {
|
22
|
+
"bottom-left" : 'top-left',
|
23
|
+
"bottom-right" : 'top-right',
|
24
|
+
"bottom-center" : 'top-center',
|
25
|
+
"top-left" : 'bottom-left',
|
26
|
+
"top-right" : 'bottom-right',
|
27
|
+
"top-center" : 'bottom-center',
|
28
|
+
"left-top" : 'top-left',
|
29
|
+
"left-bottom" : 'left-bottom',
|
30
|
+
"left-center" : 'top-left',
|
31
|
+
"right-top" : 'top-left',
|
32
|
+
"right-bottom" : 'bottom-left',
|
33
|
+
"right-center" : 'top-left'
|
34
|
+
},
|
35
|
+
'xy': {
|
36
|
+
|
37
|
+
}
|
38
|
+
};
|
39
|
+
|
40
|
+
UI.component('dropdown', {
|
41
|
+
|
42
|
+
defaults: {
|
43
|
+
'mode' : 'hover',
|
44
|
+
'pos' : 'bottom-left',
|
45
|
+
'offset' : 0,
|
46
|
+
'remaintime' : 800,
|
47
|
+
'justify' : false,
|
48
|
+
'boundary' : UI.$win,
|
49
|
+
'delay' : 0,
|
50
|
+
'dropdownSelector': '.uk-dropdown,.uk-dropdown-blank',
|
51
|
+
'hoverDelayIdle' : 250,
|
52
|
+
'preventflip' : false
|
53
|
+
},
|
54
|
+
|
55
|
+
remainIdle: false,
|
56
|
+
|
57
|
+
boot: function() {
|
58
|
+
|
59
|
+
var triggerevent = UI.support.touch ? "click" : "mouseenter";
|
60
|
+
|
61
|
+
// init code
|
62
|
+
UI.$html.on(triggerevent+".dropdown.uikit", "[data-uk-dropdown]", function(e) {
|
63
|
+
|
64
|
+
var ele = UI.$(this);
|
65
|
+
|
66
|
+
if (!ele.data("dropdown")) {
|
67
|
+
|
68
|
+
var dropdown = UI.dropdown(ele, UI.Utils.options(ele.attr("data-uk-dropdown")));
|
69
|
+
|
70
|
+
if (triggerevent=="click" || (triggerevent=="mouseenter" && dropdown.options.mode=="hover")) {
|
71
|
+
dropdown.element.trigger(triggerevent);
|
72
|
+
}
|
73
|
+
|
74
|
+
if (dropdown.element.find(dropdown.options.dropdownSelector).length) {
|
75
|
+
e.preventDefault();
|
76
|
+
}
|
77
|
+
}
|
78
|
+
});
|
79
|
+
},
|
80
|
+
|
81
|
+
init: function() {
|
82
|
+
|
83
|
+
var $this = this;
|
84
|
+
|
85
|
+
this.dropdown = this.find(this.options.dropdownSelector);
|
86
|
+
this.offsetParent = this.dropdown.parents().filter(function() {
|
87
|
+
return UI.$.inArray(UI.$(this).css('position'), ['relative', 'fixed', 'absolute']) !== -1;
|
88
|
+
}).slice(0,1);
|
89
|
+
|
90
|
+
this.centered = this.dropdown.hasClass('uk-dropdown-center');
|
91
|
+
this.justified = this.options.justify ? UI.$(this.options.justify) : false;
|
92
|
+
|
93
|
+
this.boundary = UI.$(this.options.boundary);
|
94
|
+
|
95
|
+
if (!this.boundary.length) {
|
96
|
+
this.boundary = UI.$win;
|
97
|
+
}
|
98
|
+
|
99
|
+
// legacy DEPRECATED!
|
100
|
+
if (this.dropdown.hasClass('uk-dropdown-up')) {
|
101
|
+
this.options.pos = 'top-left';
|
102
|
+
}
|
103
|
+
if (this.dropdown.hasClass('uk-dropdown-flip')) {
|
104
|
+
this.options.pos = this.options.pos.replace('left','right');
|
105
|
+
}
|
106
|
+
if (this.dropdown.hasClass('uk-dropdown-center')) {
|
107
|
+
this.options.pos = this.options.pos.replace(/(left|right)/,'center');
|
108
|
+
}
|
109
|
+
//-- end legacy
|
110
|
+
|
111
|
+
// Init ARIA
|
112
|
+
this.element.attr('aria-haspopup', 'true');
|
113
|
+
this.element.attr('aria-expanded', this.element.hasClass("uk-open"));
|
114
|
+
|
115
|
+
if (this.options.mode == "click" || UI.support.touch) {
|
116
|
+
|
117
|
+
this.on("click.uikit.dropdown", function(e) {
|
118
|
+
|
119
|
+
var $target = UI.$(e.target);
|
120
|
+
|
121
|
+
if (!$target.parents($this.options.dropdownSelector).length) {
|
122
|
+
|
123
|
+
if ($target.is("a[href='#']") || $target.parent().is("a[href='#']") || ($this.dropdown.length && !$this.dropdown.is(":visible")) ){
|
124
|
+
e.preventDefault();
|
125
|
+
}
|
126
|
+
|
127
|
+
$target.blur();
|
128
|
+
}
|
129
|
+
|
130
|
+
if (!$this.element.hasClass('uk-open')) {
|
131
|
+
|
132
|
+
$this.show();
|
133
|
+
|
134
|
+
} else {
|
135
|
+
|
136
|
+
if (!$this.dropdown.find(e.target).length || $target.is(".uk-dropdown-close") || $target.parents(".uk-dropdown-close").length) {
|
137
|
+
$this.hide();
|
138
|
+
}
|
139
|
+
}
|
140
|
+
});
|
141
|
+
|
142
|
+
} else {
|
143
|
+
|
144
|
+
this.on("mouseenter", function(e) {
|
145
|
+
|
146
|
+
$this.trigger('pointerenter.uk.dropdown', [$this]);
|
147
|
+
|
148
|
+
if ($this.remainIdle) {
|
149
|
+
clearTimeout($this.remainIdle);
|
150
|
+
}
|
151
|
+
|
152
|
+
if (hoverIdle) {
|
153
|
+
clearTimeout(hoverIdle);
|
154
|
+
}
|
155
|
+
|
156
|
+
if (active && active == $this) {
|
157
|
+
return;
|
158
|
+
}
|
159
|
+
|
160
|
+
// pseudo manuAim
|
161
|
+
if (active && active != $this) {
|
162
|
+
|
163
|
+
hoverIdle = setTimeout(function() {
|
164
|
+
hoverIdle = setTimeout($this.show.bind($this), $this.options.delay);
|
165
|
+
}, $this.options.hoverDelayIdle);
|
166
|
+
|
167
|
+
} else {
|
168
|
+
|
169
|
+
hoverIdle = setTimeout($this.show.bind($this), $this.options.delay);
|
170
|
+
}
|
171
|
+
|
172
|
+
}).on("mouseleave", function() {
|
173
|
+
|
174
|
+
if (hoverIdle) {
|
175
|
+
clearTimeout(hoverIdle);
|
176
|
+
}
|
177
|
+
|
178
|
+
$this.remainIdle = setTimeout(function() {
|
179
|
+
if (active && active == $this) $this.hide();
|
180
|
+
}, $this.options.remaintime);
|
181
|
+
|
182
|
+
$this.trigger('pointerleave.uk.dropdown', [$this]);
|
183
|
+
|
184
|
+
}).on("click", function(e){
|
185
|
+
|
186
|
+
var $target = UI.$(e.target);
|
187
|
+
|
188
|
+
if ($this.remainIdle) {
|
189
|
+
clearTimeout($this.remainIdle);
|
190
|
+
}
|
191
|
+
|
192
|
+
if (active && active == $this) {
|
193
|
+
if (!$this.dropdown.find(e.target).length || $target.is(".uk-dropdown-close") || $target.parents(".uk-dropdown-close").length) {
|
194
|
+
$this.hide();
|
195
|
+
}
|
196
|
+
return;
|
197
|
+
}
|
198
|
+
|
199
|
+
if ($target.is("a[href='#']") || $target.parent().is("a[href='#']")){
|
200
|
+
e.preventDefault();
|
201
|
+
}
|
202
|
+
|
203
|
+
$this.show();
|
204
|
+
});
|
205
|
+
}
|
206
|
+
},
|
207
|
+
|
208
|
+
show: function(){
|
209
|
+
|
210
|
+
UI.$html.off("click.outer.dropdown");
|
211
|
+
|
212
|
+
if (active && active != this) {
|
213
|
+
active.hide(true);
|
214
|
+
}
|
215
|
+
|
216
|
+
if (hoverIdle) {
|
217
|
+
clearTimeout(hoverIdle);
|
218
|
+
}
|
219
|
+
|
220
|
+
this.trigger('beforeshow.uk.dropdown', [this]);
|
221
|
+
|
222
|
+
this.checkDimensions();
|
223
|
+
this.element.addClass('uk-open');
|
224
|
+
|
225
|
+
// Update ARIA
|
226
|
+
this.element.attr('aria-expanded', 'true');
|
227
|
+
|
228
|
+
this.trigger('show.uk.dropdown', [this]);
|
229
|
+
|
230
|
+
UI.Utils.checkDisplay(this.dropdown, true);
|
231
|
+
active = this;
|
232
|
+
|
233
|
+
this.registerOuterClick();
|
234
|
+
},
|
235
|
+
|
236
|
+
hide: function(force) {
|
237
|
+
|
238
|
+
this.trigger('beforehide.uk.dropdown', [this, force]);
|
239
|
+
|
240
|
+
this.element.removeClass('uk-open');
|
241
|
+
|
242
|
+
if (this.remainIdle) {
|
243
|
+
clearTimeout(this.remainIdle);
|
244
|
+
}
|
245
|
+
|
246
|
+
this.remainIdle = false;
|
247
|
+
|
248
|
+
// Update ARIA
|
249
|
+
this.element.attr('aria-expanded', 'false');
|
250
|
+
|
251
|
+
this.trigger('hide.uk.dropdown', [this, force]);
|
252
|
+
|
253
|
+
if (active == this) active = false;
|
254
|
+
},
|
255
|
+
|
256
|
+
registerOuterClick: function(){
|
257
|
+
|
258
|
+
var $this = this;
|
259
|
+
|
260
|
+
UI.$html.off("click.outer.dropdown");
|
261
|
+
|
262
|
+
setTimeout(function() {
|
263
|
+
|
264
|
+
UI.$html.on("click.outer.dropdown", function(e) {
|
265
|
+
|
266
|
+
if (hoverIdle) {
|
267
|
+
clearTimeout(hoverIdle);
|
268
|
+
}
|
269
|
+
|
270
|
+
var $target = UI.$(e.target);
|
271
|
+
|
272
|
+
if (active == $this && !$this.element.find(e.target).length) {
|
273
|
+
$this.hide(true);
|
274
|
+
UI.$html.off("click.outer.dropdown");
|
275
|
+
}
|
276
|
+
});
|
277
|
+
}, 10);
|
278
|
+
},
|
279
|
+
|
280
|
+
checkDimensions: function() {
|
281
|
+
|
282
|
+
if (!this.dropdown.length) return;
|
283
|
+
|
284
|
+
// reset
|
285
|
+
this.dropdown.removeClass('uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack').css({
|
286
|
+
'top-left':'',
|
287
|
+
'left':'',
|
288
|
+
'margin-left' :'',
|
289
|
+
'margin-right':''
|
290
|
+
});
|
291
|
+
|
292
|
+
if (this.justified && this.justified.length) {
|
293
|
+
this.dropdown.css("min-width", "");
|
294
|
+
}
|
295
|
+
|
296
|
+
var $this = this,
|
297
|
+
pos = UI.$.extend({}, this.offsetParent.offset(), {width: this.offsetParent[0].offsetWidth, height: this.offsetParent[0].offsetHeight}),
|
298
|
+
posoffset = this.options.offset,
|
299
|
+
dropdown = this.dropdown,
|
300
|
+
offset = dropdown.show().offset() || {left: 0, top: 0},
|
301
|
+
width = dropdown.outerWidth(),
|
302
|
+
height = dropdown.outerHeight(),
|
303
|
+
boundarywidth = this.boundary.width(),
|
304
|
+
boundaryoffset = this.boundary[0] !== window && this.boundary.offset() ? this.boundary.offset(): {top:0, left:0},
|
305
|
+
dpos = this.options.pos;
|
306
|
+
|
307
|
+
var variants = {
|
308
|
+
"bottom-left" : {top: 0 + pos.height + posoffset, left: 0},
|
309
|
+
"bottom-right" : {top: 0 + pos.height + posoffset, left: 0 + pos.width - width},
|
310
|
+
"bottom-center" : {top: 0 + pos.height + posoffset, left: 0 + pos.width / 2 - width / 2},
|
311
|
+
"top-left" : {top: 0 - height - posoffset, left: 0},
|
312
|
+
"top-right" : {top: 0 - height - posoffset, left: 0 + pos.width - width},
|
313
|
+
"top-center" : {top: 0 - height - posoffset, left: 0 + pos.width / 2 - width / 2},
|
314
|
+
"left-top" : {top: 0, left: 0 - width - posoffset},
|
315
|
+
"left-bottom" : {top: 0 + pos.height - height, left: 0 - width - posoffset},
|
316
|
+
"left-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 - width - posoffset},
|
317
|
+
"right-top" : {top: 0, left: 0 + pos.width + posoffset},
|
318
|
+
"right-bottom" : {top: 0 + pos.height - height, left: 0 + pos.width + posoffset},
|
319
|
+
"right-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 + pos.width + posoffset}
|
320
|
+
},
|
321
|
+
css = {},
|
322
|
+
pp;
|
323
|
+
|
324
|
+
pp = dpos.split('-');
|
325
|
+
css = variants[dpos] ? variants[dpos] : variants['bottom-left'];
|
326
|
+
|
327
|
+
// justify dropdown
|
328
|
+
if (this.justified && this.justified.length) {
|
329
|
+
justify(dropdown.css({left:0}), this.justified, boundarywidth);
|
330
|
+
} else {
|
331
|
+
|
332
|
+
if (this.options.preventflip !== true) {
|
333
|
+
|
334
|
+
var fdpos;
|
335
|
+
|
336
|
+
switch(this.checkBoundary(pos.left + css.left, pos.top + css.top, width, height, boundarywidth)) {
|
337
|
+
case "x":
|
338
|
+
if(this.options.preventflip !=='x') fdpos = flips['x'][dpos] || 'right-top';
|
339
|
+
break;
|
340
|
+
case "y":
|
341
|
+
if(this.options.preventflip !=='y') fdpos = flips['y'][dpos] || 'top-left';
|
342
|
+
break;
|
343
|
+
case "xy":
|
344
|
+
if(!this.options.preventflip) fdpos = flips['xy'][dpos] || 'right-bottom';
|
345
|
+
break;
|
346
|
+
}
|
347
|
+
|
348
|
+
if (fdpos) {
|
349
|
+
|
350
|
+
pp = fdpos.split('-');
|
351
|
+
css = variants[fdpos] ? variants[fdpos] : variants['bottom-left'];
|
352
|
+
|
353
|
+
// check flipped
|
354
|
+
if (this.checkBoundary(pos.left + css.left, pos.top + css.top, width, height, boundarywidth)) {
|
355
|
+
pp = dpos.split('-');
|
356
|
+
css = variants[dpos] ? variants[dpos] : variants['bottom-left'];
|
357
|
+
}
|
358
|
+
}
|
359
|
+
}
|
360
|
+
}
|
361
|
+
|
362
|
+
if (width > boundarywidth) {
|
363
|
+
dropdown.addClass("uk-dropdown-stack");
|
364
|
+
this.trigger('stack.uk.dropdown', [this]);
|
365
|
+
}
|
366
|
+
|
367
|
+
dropdown.css(css).css("display", "").addClass('uk-dropdown-'+pp[0]);
|
368
|
+
},
|
369
|
+
|
370
|
+
checkBoundary: function(left, top, width, height, boundarywidth) {
|
371
|
+
|
372
|
+
var axis = "";
|
373
|
+
|
374
|
+
if (left < 0 || ((left - UI.$win.scrollLeft())+width) > boundarywidth) {
|
375
|
+
axis += "x";
|
376
|
+
}
|
377
|
+
|
378
|
+
if ((top - UI.$win.scrollTop()) < 0 || ((top - UI.$win.scrollTop())+height) > window.innerHeight) {
|
379
|
+
axis += "y";
|
380
|
+
}
|
381
|
+
|
382
|
+
return axis;
|
383
|
+
}
|
384
|
+
});
|
385
|
+
|
386
|
+
|
387
|
+
UI.component('dropdownOverlay', {
|
388
|
+
|
389
|
+
defaults: {
|
390
|
+
'justify' : false,
|
391
|
+
'cls' : '',
|
392
|
+
'duration': 200
|
393
|
+
},
|
394
|
+
|
395
|
+
boot: function() {
|
396
|
+
|
397
|
+
// init code
|
398
|
+
UI.ready(function(context) {
|
399
|
+
|
400
|
+
UI.$("[data-uk-dropdown-overlay]", context).each(function() {
|
401
|
+
var ele = UI.$(this);
|
402
|
+
|
403
|
+
if (!ele.data("dropdownOverlay")) {
|
404
|
+
UI.dropdownOverlay(ele, UI.Utils.options(ele.attr("data-uk-dropdown-overlay")));
|
405
|
+
}
|
406
|
+
});
|
407
|
+
});
|
408
|
+
},
|
409
|
+
|
410
|
+
init: function() {
|
411
|
+
|
412
|
+
var $this = this;
|
413
|
+
|
414
|
+
this.justified = this.options.justify ? UI.$(this.options.justify) : false;
|
415
|
+
this.overlay = this.element.find('uk-dropdown-overlay');
|
416
|
+
|
417
|
+
if (!this.overlay.length) {
|
418
|
+
this.overlay = UI.$('<div class="uk-dropdown-overlay"></div>').appendTo(this.element);
|
419
|
+
}
|
420
|
+
|
421
|
+
this.overlay.addClass(this.options.cls);
|
422
|
+
|
423
|
+
this.on({
|
424
|
+
|
425
|
+
'beforeshow.uk.dropdown': function(e, dropdown) {
|
426
|
+
$this.dropdown = dropdown;
|
427
|
+
|
428
|
+
if ($this.justified && $this.justified.length) {
|
429
|
+
justify($this.overlay.css({'display':'block', 'margin-left':'','margin-right':''}), $this.justified, $this.justified.outerWidth());
|
430
|
+
}
|
431
|
+
},
|
432
|
+
|
433
|
+
'show.uk.dropdown': function(e, dropdown) {
|
434
|
+
|
435
|
+
var h = $this.dropdown.dropdown.outerHeight(true);
|
436
|
+
|
437
|
+
$this.dropdown.element.removeClass('uk-open');
|
438
|
+
|
439
|
+
$this.overlay.stop().css('display', 'block').animate({height: h}, $this.options.duration, function() {
|
440
|
+
|
441
|
+
$this.dropdown.dropdown.css('visibility', '');
|
442
|
+
$this.dropdown.element.addClass('uk-open');
|
443
|
+
|
444
|
+
UI.Utils.checkDisplay($this.dropdown.dropdown, true);
|
445
|
+
});
|
446
|
+
|
447
|
+
$this.pointerleave = false;
|
448
|
+
},
|
449
|
+
|
450
|
+
'hide.uk.dropdown': function() {
|
451
|
+
$this.overlay.stop().animate({height: 0}, $this.options.duration);
|
452
|
+
},
|
453
|
+
|
454
|
+
'pointerenter.uk.dropdown': function(e, dropdown) {
|
455
|
+
clearTimeout($this.remainIdle);
|
456
|
+
},
|
457
|
+
|
458
|
+
'pointerleave.uk.dropdown': function(e, dropdown) {
|
459
|
+
$this.pointerleave = true;
|
460
|
+
}
|
461
|
+
});
|
462
|
+
|
463
|
+
|
464
|
+
this.overlay.on({
|
465
|
+
|
466
|
+
'mouseenter': function() {
|
467
|
+
if ($this.remainIdle) {
|
468
|
+
clearTimeout($this.dropdown.remainIdle);
|
469
|
+
clearTimeout($this.remainIdle);
|
470
|
+
}
|
471
|
+
},
|
472
|
+
|
473
|
+
'mouseleave': function(){
|
474
|
+
|
475
|
+
if ($this.pointerleave && active) {
|
476
|
+
|
477
|
+
$this.remainIdle = setTimeout(function() {
|
478
|
+
if(active) active.hide();
|
479
|
+
}, active.options.remaintime);
|
480
|
+
}
|
481
|
+
}
|
482
|
+
})
|
483
|
+
}
|
484
|
+
|
485
|
+
});
|
486
|
+
|
487
|
+
|
488
|
+
function justify(ele, justifyTo, boundarywidth, offset) {
|
489
|
+
|
490
|
+
ele = UI.$(ele);
|
491
|
+
justifyTo = UI.$(justifyTo);
|
492
|
+
boundarywidth = boundarywidth || window.innerWidth;
|
493
|
+
offset = offset || ele.offset();
|
494
|
+
|
495
|
+
if (justifyTo.length) {
|
496
|
+
|
497
|
+
var jwidth = justifyTo.outerWidth();
|
498
|
+
|
499
|
+
ele.css("min-width", jwidth);
|
500
|
+
|
501
|
+
if (UI.langdirection == 'right') {
|
502
|
+
|
503
|
+
var right1 = boundarywidth - (justifyTo.offset().left + jwidth),
|
504
|
+
right2 = boundarywidth - (ele.offset().left + ele.outerWidth());
|
505
|
+
|
506
|
+
ele.css("margin-right", right1 - right2);
|
507
|
+
|
508
|
+
} else {
|
509
|
+
ele.css("margin-left", justifyTo.offset().left - offset.left);
|
510
|
+
}
|
511
|
+
}
|
512
|
+
}
|
513
|
+
|
514
|
+
})(UIkit);
|