uikit-rails 0.0.2 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +9 -3
  3. data/Gemfile +2 -1
  4. data/LICENSE.txt +21 -0
  5. data/README.md +65 -0
  6. data/Rakefile +0 -1
  7. data/assets/fonts/FontAwesome.otf +0 -0
  8. data/assets/fonts/fontawesome-webfont.ttf +0 -0
  9. data/assets/fonts/fontawesome-webfont.woff +0 -0
  10. data/assets/fonts/fontawesome-webfont.woff2 +0 -0
  11. data/assets/javascripts/components/accordion.js +174 -0
  12. data/assets/javascripts/components/accordion.min.js +2 -0
  13. data/assets/javascripts/components/autocomplete.js +334 -0
  14. data/assets/javascripts/components/autocomplete.min.js +2 -0
  15. data/assets/javascripts/components/datepicker.js +3166 -0
  16. data/assets/javascripts/components/datepicker.min.js +3 -0
  17. data/assets/javascripts/components/form-password.js +67 -0
  18. data/assets/javascripts/components/form-password.min.js +2 -0
  19. data/assets/javascripts/components/form-select.js +70 -0
  20. data/assets/javascripts/components/form-select.min.js +2 -0
  21. data/assets/javascripts/components/grid.js +527 -0
  22. data/assets/javascripts/components/grid.min.js +2 -0
  23. data/assets/javascripts/components/htmleditor.js +623 -0
  24. data/assets/javascripts/components/htmleditor.min.js +2 -0
  25. data/assets/javascripts/components/lightbox.js +555 -0
  26. data/assets/javascripts/components/lightbox.min.js +2 -0
  27. data/assets/javascripts/components/nestable.js +638 -0
  28. data/assets/javascripts/components/nestable.min.js +2 -0
  29. data/assets/javascripts/components/notify.js +189 -0
  30. data/assets/javascripts/components/notify.min.js +2 -0
  31. data/assets/javascripts/components/pagination.js +147 -0
  32. data/assets/javascripts/components/pagination.min.js +2 -0
  33. data/assets/javascripts/components/parallax.js +435 -0
  34. data/assets/javascripts/components/parallax.min.js +2 -0
  35. data/assets/javascripts/components/search.js +92 -0
  36. data/assets/javascripts/components/search.min.js +2 -0
  37. data/assets/javascripts/components/slider.js +531 -0
  38. data/assets/javascripts/components/slider.min.js +2 -0
  39. data/assets/javascripts/components/slideset.js +506 -0
  40. data/assets/javascripts/components/slideset.min.js +2 -0
  41. data/assets/javascripts/components/slideshow-fx.js +375 -0
  42. data/assets/javascripts/components/slideshow-fx.min.js +2 -0
  43. data/assets/javascripts/components/slideshow.js +562 -0
  44. data/assets/javascripts/components/slideshow.min.js +2 -0
  45. data/assets/javascripts/components/sortable.js +688 -0
  46. data/assets/javascripts/components/sortable.min.js +2 -0
  47. data/assets/javascripts/components/sticky.js +359 -0
  48. data/assets/javascripts/components/sticky.min.js +2 -0
  49. data/assets/javascripts/components/timepicker.js +192 -0
  50. data/assets/javascripts/components/timepicker.min.js +2 -0
  51. data/assets/javascripts/components/tooltip.js +234 -0
  52. data/assets/javascripts/components/tooltip.min.js +2 -0
  53. data/assets/javascripts/components/upload.js +260 -0
  54. data/assets/javascripts/components/upload.min.js +2 -0
  55. data/assets/javascripts/core/alert.js +66 -0
  56. data/assets/javascripts/core/alert.min.js +2 -0
  57. data/assets/javascripts/core/button.js +157 -0
  58. data/assets/javascripts/core/button.min.js +2 -0
  59. data/assets/javascripts/core/core.js +730 -0
  60. data/assets/javascripts/core/core.min.js +2 -0
  61. data/assets/javascripts/core/cover.js +95 -0
  62. data/assets/javascripts/core/cover.min.js +2 -0
  63. data/assets/javascripts/core/dropdown.js +514 -0
  64. data/assets/javascripts/core/dropdown.min.js +2 -0
  65. data/assets/javascripts/core/grid.js +114 -0
  66. data/assets/javascripts/core/grid.min.js +2 -0
  67. data/assets/javascripts/core/modal.js +384 -0
  68. data/assets/javascripts/core/modal.min.js +2 -0
  69. data/assets/javascripts/core/nav.js +136 -0
  70. data/assets/javascripts/core/nav.min.js +2 -0
  71. data/assets/javascripts/core/offcanvas.js +180 -0
  72. data/assets/javascripts/core/offcanvas.min.js +2 -0
  73. data/assets/javascripts/core/scrollspy.js +208 -0
  74. data/assets/javascripts/core/scrollspy.min.js +2 -0
  75. data/assets/javascripts/core/smooth-scroll.js +62 -0
  76. data/assets/javascripts/core/smooth-scroll.min.js +2 -0
  77. data/assets/javascripts/core/switcher.js +309 -0
  78. data/assets/javascripts/core/switcher.min.js +2 -0
  79. data/assets/javascripts/core/tab.js +167 -0
  80. data/assets/javascripts/core/tab.min.js +2 -0
  81. data/assets/javascripts/core/toggle.js +120 -0
  82. data/assets/javascripts/core/toggle.min.js +2 -0
  83. data/assets/javascripts/core/touch.js +175 -0
  84. data/assets/javascripts/core/touch.min.js +2 -0
  85. data/assets/javascripts/core/utility.js +289 -0
  86. data/assets/javascripts/core/utility.min.js +2 -0
  87. data/assets/javascripts/uikit-components.js +23 -0
  88. data/assets/javascripts/uikit.js +3706 -0
  89. data/assets/javascripts/uikit.min.js +3 -0
  90. data/assets/stylesheets/components/accordion.scss +94 -0
  91. data/assets/stylesheets/components/autocomplete.scss +102 -0
  92. data/assets/stylesheets/components/datepicker.scss +197 -0
  93. data/assets/stylesheets/components/dotnav.scss +212 -0
  94. data/assets/stylesheets/components/form-advanced.scss +128 -0
  95. data/assets/stylesheets/components/form-file.scss +63 -0
  96. data/assets/stylesheets/components/form-password.scss +74 -0
  97. data/assets/stylesheets/components/form-select.scss +66 -0
  98. data/assets/stylesheets/components/htmleditor.scss +269 -0
  99. data/assets/stylesheets/components/nestable.scss +229 -0
  100. data/assets/stylesheets/components/notify.scss +190 -0
  101. data/assets/stylesheets/components/placeholder.scss +66 -0
  102. data/assets/stylesheets/components/progress.scss +173 -0
  103. data/assets/stylesheets/components/search.scss +309 -0
  104. data/assets/stylesheets/components/slidenav.scss +183 -0
  105. data/assets/stylesheets/components/slider.scss +131 -0
  106. data/assets/stylesheets/components/slideshow.scss +208 -0
  107. data/assets/stylesheets/components/sortable.scss +122 -0
  108. data/assets/stylesheets/components/sticky.scss +64 -0
  109. data/assets/stylesheets/components/tooltip.scss +177 -0
  110. data/assets/stylesheets/components/upload.scss +34 -0
  111. data/assets/stylesheets/core/alert.scss +141 -0
  112. data/assets/stylesheets/core/animation.scss +599 -0
  113. data/assets/stylesheets/core/article.scss +139 -0
  114. data/assets/stylesheets/core/badge.scss +110 -0
  115. data/assets/stylesheets/core/base-noconflict.scss +397 -0
  116. data/assets/stylesheets/core/base.scss +541 -0
  117. data/assets/stylesheets/core/block.scss +153 -0
  118. data/assets/stylesheets/core/breadcrumb.scss +86 -0
  119. data/assets/stylesheets/core/button.scss +406 -0
  120. data/assets/stylesheets/core/close.scss +132 -0
  121. data/assets/stylesheets/core/column.scss +209 -0
  122. data/assets/stylesheets/core/comment.scss +172 -0
  123. data/assets/stylesheets/core/contrast.scss +493 -0
  124. data/assets/stylesheets/core/cover.scss +70 -0
  125. data/assets/stylesheets/core/description-list.scss +71 -0
  126. data/assets/stylesheets/core/dropdown.scss +280 -0
  127. data/assets/stylesheets/core/flex.scss +320 -0
  128. data/assets/stylesheets/core/form.scss +627 -0
  129. data/assets/stylesheets/core/grid.scss +688 -0
  130. data/assets/stylesheets/core/icon.scss +897 -0
  131. data/assets/stylesheets/core/list.scss +102 -0
  132. data/assets/stylesheets/core/modal.scss +341 -0
  133. data/assets/stylesheets/core/nav.scss +468 -0
  134. data/assets/stylesheets/core/navbar.scss +325 -0
  135. data/assets/stylesheets/core/offcanvas.scss +168 -0
  136. data/assets/stylesheets/core/overlay.scss +534 -0
  137. data/assets/stylesheets/core/pagination.scss +197 -0
  138. data/assets/stylesheets/core/panel.scss +332 -0
  139. data/assets/stylesheets/core/print.scss +59 -0
  140. data/assets/stylesheets/core/subnav.scss +213 -0
  141. data/assets/stylesheets/core/switcher.scss +38 -0
  142. data/assets/stylesheets/core/tab.scss +368 -0
  143. data/assets/stylesheets/core/table.scss +147 -0
  144. data/assets/stylesheets/core/text.scss +128 -0
  145. data/assets/stylesheets/core/thumbnail.scss +122 -0
  146. data/assets/stylesheets/core/thumbnav.scss +122 -0
  147. data/assets/stylesheets/core/utility.scss +606 -0
  148. data/assets/stylesheets/core/variables.scss +23 -0
  149. data/assets/stylesheets/uikit-components.scss +22 -0
  150. data/assets/stylesheets/uikit-mixins.scss +327 -0
  151. data/assets/stylesheets/uikit-variables.scss +817 -0
  152. data/assets/stylesheets/uikit.scss +56 -0
  153. data/lib/uikit-rails.rb +2 -2
  154. data/lib/uikit-rails/engine.rb +11 -1
  155. data/lib/uikit-rails/version.rb +1 -3
  156. data/uikit-rails.gemspec +15 -16
  157. metadata +169 -44
  158. data/README.rb +0 -1
  159. data/vendor/assets/javascripts/ui.card.js +0 -115
  160. data/vendor/assets/javascripts/ui.color-picker.js +0 -351
  161. data/vendor/assets/javascripts/ui.confirmation.js +0 -133
  162. data/vendor/assets/javascripts/ui.dialog.js +0 -252
  163. data/vendor/assets/javascripts/ui.emitter.js +0 -99
  164. data/vendor/assets/javascripts/ui.js +0 -1641
  165. data/vendor/assets/javascripts/ui.menu.js +0 -238
  166. data/vendor/assets/javascripts/ui.notification.js +0 -240
  167. data/vendor/assets/javascripts/ui.overlay.js +0 -79
  168. data/vendor/assets/javascripts/ui.split-button.js +0 -108
  169. data/vendor/assets/stylesheets/ui.card.css +0 -55
  170. data/vendor/assets/stylesheets/ui.color-picker.css +0 -6
  171. data/vendor/assets/stylesheets/ui.confirmation.css +0 -7
  172. data/vendor/assets/stylesheets/ui.css +0 -337
  173. data/vendor/assets/stylesheets/ui.dialog.css +0 -92
  174. data/vendor/assets/stylesheets/ui.menu.css +0 -32
  175. data/vendor/assets/stylesheets/ui.notification.css +0 -107
  176. data/vendor/assets/stylesheets/ui.overlay.css +0 -16
  177. 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){"use strict";var i=[];t.component("stackMargin",{defaults:{cls:"uk-margin-small-top"},boot:function(){t.ready(function(i){t.$("[data-uk-margin]",i).each(function(){var i,n=t.$(this);n.data("stackMargin")||(i=t.stackMargin(n,t.Utils.options(n.attr("data-uk-margin"))))})})},init:function(){var n=this;this.columns=[],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(){return this.columns=this.element.children(),t.Utils.stackMargin(this.columns,this.options),this},revert:function(){return this.columns.removeClass(this.options.cls),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("responsiveIframe")||(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);
@@ -0,0 +1,23 @@
1
+ // Components
2
+ //= require './components/accordion'
3
+ //= require './components/autocomplete'
4
+ //= require './components/datepicker'
5
+ //= require './components/form-password'
6
+ //= require './components/form-select'
7
+ //= require './components/grid'
8
+ //= require './components/htmleditor'
9
+ //= require './components/lightbox'
10
+ //= require './components/notify'
11
+ //= require './components/nestable'
12
+ //= require './components/pagination'
13
+ //= require './components/parallax'
14
+ //= require './components/search'
15
+ //= require './components/slider'
16
+ //= require './components/slideset'
17
+ //= require './components/slideshow'
18
+ //= require './components/slideshow-fx'
19
+ //= require './components/sortable'
20
+ //= require './components/sticky'
21
+ //= require './components/timepicker'
22
+ //= require './components/tooltip'
23
+ //= require './components/upload'
@@ -0,0 +1,3706 @@
1
+ /*! UIkit 2.24.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
+ (function(core) {
3
+
4
+ if (typeof define == "function" && define.amd) { // AMD
5
+
6
+ define("uikit", function(){
7
+
8
+ var uikit = window.UIkit || core(window, window.jQuery, window.document);
9
+
10
+ uikit.load = function(res, req, onload, config) {
11
+
12
+ var resources = res.split(','), load = [], i, base = (config.config && config.config.uikit && config.config.uikit.base ? config.config.uikit.base : "").replace(/\/+$/g, "");
13
+
14
+ if (!base) {
15
+ throw new Error( "Please define base path to UIkit in the requirejs config." );
16
+ }
17
+
18
+ for (i = 0; i < resources.length; i += 1) {
19
+ var resource = resources[i].replace(/\./g, '/');
20
+ load.push(base+'/components/'+resource);
21
+ }
22
+
23
+ req(load, function() {
24
+ onload(uikit);
25
+ });
26
+ };
27
+
28
+ return uikit;
29
+ });
30
+ }
31
+
32
+ if (!window.jQuery) {
33
+ throw new Error( "UIkit requires jQuery" );
34
+ }
35
+
36
+ if (window && window.jQuery) {
37
+ core(window, window.jQuery, window.document);
38
+ }
39
+
40
+
41
+ })(function(global, $, doc) {
42
+
43
+ "use strict";
44
+
45
+ var UI = {}, _UI = global.UIkit ? Object.create(global.UIkit) : undefined;
46
+
47
+ UI.version = '2.24.2';
48
+
49
+ UI.noConflict = function() {
50
+ // restore UIkit version
51
+ if (_UI) {
52
+ global.UIkit = _UI;
53
+ $.UIkit = _UI;
54
+ $.fn.uk = _UI.fn;
55
+ }
56
+
57
+ return UI;
58
+ };
59
+
60
+ UI.prefix = function(str) {
61
+ return str;
62
+ };
63
+
64
+ // cache jQuery
65
+ UI.$ = $;
66
+
67
+ UI.$doc = UI.$(document);
68
+ UI.$win = UI.$(window);
69
+ UI.$html = UI.$('html');
70
+
71
+ UI.support = {};
72
+ UI.support.transition = (function() {
73
+
74
+ var transitionEnd = (function() {
75
+
76
+ var element = doc.body || doc.documentElement,
77
+ transEndEventNames = {
78
+ WebkitTransition : 'webkitTransitionEnd',
79
+ MozTransition : 'transitionend',
80
+ OTransition : 'oTransitionEnd otransitionend',
81
+ transition : 'transitionend'
82
+ }, name;
83
+
84
+ for (name in transEndEventNames) {
85
+ if (element.style[name] !== undefined) return transEndEventNames[name];
86
+ }
87
+ }());
88
+
89
+ return transitionEnd && { end: transitionEnd };
90
+ })();
91
+
92
+ UI.support.animation = (function() {
93
+
94
+ var animationEnd = (function() {
95
+
96
+ var element = doc.body || doc.documentElement,
97
+ animEndEventNames = {
98
+ WebkitAnimation : 'webkitAnimationEnd',
99
+ MozAnimation : 'animationend',
100
+ OAnimation : 'oAnimationEnd oanimationend',
101
+ animation : 'animationend'
102
+ }, name;
103
+
104
+ for (name in animEndEventNames) {
105
+ if (element.style[name] !== undefined) return animEndEventNames[name];
106
+ }
107
+ }());
108
+
109
+ return animationEnd && { end: animationEnd };
110
+ })();
111
+
112
+ // requestAnimationFrame polyfill
113
+ //https://github.com/darius/requestAnimationFrame
114
+ (function() {
115
+
116
+ Date.now = Date.now || function() { return new Date().getTime(); };
117
+
118
+ var vendors = ['webkit', 'moz'];
119
+ for (var i = 0; i < vendors.length && !window.requestAnimationFrame; ++i) {
120
+ var vp = vendors[i];
121
+ window.requestAnimationFrame = window[vp+'RequestAnimationFrame'];
122
+ window.cancelAnimationFrame = (window[vp+'CancelAnimationFrame']
123
+ || window[vp+'CancelRequestAnimationFrame']);
124
+ }
125
+ if (/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent) // iOS6 is buggy
126
+ || !window.requestAnimationFrame || !window.cancelAnimationFrame) {
127
+ var lastTime = 0;
128
+ window.requestAnimationFrame = function(callback) {
129
+ var now = Date.now();
130
+ var nextTime = Math.max(lastTime + 16, now);
131
+ return setTimeout(function() { callback(lastTime = nextTime); },
132
+ nextTime - now);
133
+ };
134
+ window.cancelAnimationFrame = clearTimeout;
135
+ }
136
+ }());
137
+
138
+ UI.support.touch = (
139
+ ('ontouchstart' in document) ||
140
+ (global.DocumentTouch && document instanceof global.DocumentTouch) ||
141
+ (global.navigator.msPointerEnabled && global.navigator.msMaxTouchPoints > 0) || //IE 10
142
+ (global.navigator.pointerEnabled && global.navigator.maxTouchPoints > 0) || //IE >=11
143
+ false
144
+ );
145
+
146
+ UI.support.mutationobserver = (global.MutationObserver || global.WebKitMutationObserver || null);
147
+
148
+ UI.Utils = {};
149
+
150
+ UI.Utils.isFullscreen = function() {
151
+ return document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement || document.fullscreenElement || false;
152
+ };
153
+
154
+ UI.Utils.str2json = function(str, notevil) {
155
+ try {
156
+ if (notevil) {
157
+ return JSON.parse(str
158
+ // wrap keys without quote with valid double quote
159
+ .replace(/([\$\w]+)\s*:/g, function(_, $1){return '"'+$1+'":';})
160
+ // replacing single quote wrapped ones to double quote
161
+ .replace(/'([^']+)'/g, function(_, $1){return '"'+$1+'"';})
162
+ );
163
+ } else {
164
+ return (new Function("", "var json = " + str + "; return JSON.parse(JSON.stringify(json));"))();
165
+ }
166
+ } catch(e) { return false; }
167
+ };
168
+
169
+ UI.Utils.debounce = function(func, wait, immediate) {
170
+ var timeout;
171
+ return function() {
172
+ var context = this, args = arguments;
173
+ var later = function() {
174
+ timeout = null;
175
+ if (!immediate) func.apply(context, args);
176
+ };
177
+ var callNow = immediate && !timeout;
178
+ clearTimeout(timeout);
179
+ timeout = setTimeout(later, wait);
180
+ if (callNow) func.apply(context, args);
181
+ };
182
+ };
183
+
184
+ UI.Utils.removeCssRules = function(selectorRegEx) {
185
+ var idx, idxs, stylesheet, _i, _j, _k, _len, _len1, _len2, _ref;
186
+
187
+ if(!selectorRegEx) return;
188
+
189
+ setTimeout(function(){
190
+ try {
191
+ _ref = document.styleSheets;
192
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
193
+ stylesheet = _ref[_i];
194
+ idxs = [];
195
+ stylesheet.cssRules = stylesheet.cssRules;
196
+ for (idx = _j = 0, _len1 = stylesheet.cssRules.length; _j < _len1; idx = ++_j) {
197
+ if (stylesheet.cssRules[idx].type === CSSRule.STYLE_RULE && selectorRegEx.test(stylesheet.cssRules[idx].selectorText)) {
198
+ idxs.unshift(idx);
199
+ }
200
+ }
201
+ for (_k = 0, _len2 = idxs.length; _k < _len2; _k++) {
202
+ stylesheet.deleteRule(idxs[_k]);
203
+ }
204
+ }
205
+ } catch (_error) {}
206
+ }, 0);
207
+ };
208
+
209
+ UI.Utils.isInView = function(element, options) {
210
+
211
+ var $element = $(element);
212
+
213
+ if (!$element.is(':visible')) {
214
+ return false;
215
+ }
216
+
217
+ var window_left = UI.$win.scrollLeft(), window_top = UI.$win.scrollTop(), offset = $element.offset(), left = offset.left, top = offset.top;
218
+
219
+ options = $.extend({topoffset:0, leftoffset:0}, options);
220
+
221
+ if (top + $element.height() >= window_top && top - options.topoffset <= window_top + UI.$win.height() &&
222
+ left + $element.width() >= window_left && left - options.leftoffset <= window_left + UI.$win.width()) {
223
+ return true;
224
+ } else {
225
+ return false;
226
+ }
227
+ };
228
+
229
+ UI.Utils.checkDisplay = function(context, initanimation) {
230
+
231
+ var elements = UI.$('[data-uk-margin], [data-uk-grid-match], [data-uk-grid-margin], [data-uk-check-display]', context || document), animated;
232
+
233
+ if (context && !elements.length) {
234
+ elements = $(context);
235
+ }
236
+
237
+ elements.trigger('display.uk.check');
238
+
239
+ // fix firefox / IE animations
240
+ if (initanimation) {
241
+
242
+ if (typeof(initanimation)!='string') {
243
+ initanimation = '[class*="uk-animation-"]';
244
+ }
245
+
246
+ elements.find(initanimation).each(function(){
247
+
248
+ var ele = UI.$(this),
249
+ cls = ele.attr('class'),
250
+ anim = cls.match(/uk\-animation\-(.+)/);
251
+
252
+ ele.removeClass(anim[0]).width();
253
+
254
+ ele.addClass(anim[0]);
255
+ });
256
+ }
257
+
258
+ return elements;
259
+ };
260
+
261
+ UI.Utils.options = function(string) {
262
+
263
+ if ($.isPlainObject(string)) return string;
264
+
265
+ var start = (string ? string.indexOf("{") : -1), options = {};
266
+
267
+ if (start != -1) {
268
+ try {
269
+ options = UI.Utils.str2json(string.substr(start));
270
+ } catch (e) {}
271
+ }
272
+
273
+ return options;
274
+ };
275
+
276
+ UI.Utils.animate = function(element, cls) {
277
+
278
+ var d = $.Deferred();
279
+
280
+ element = UI.$(element);
281
+ cls = cls;
282
+
283
+ element.css('display', 'none').addClass(cls).one(UI.support.animation.end, function() {
284
+ element.removeClass(cls);
285
+ d.resolve();
286
+ }).width();
287
+
288
+ element.css('display', '');
289
+
290
+ return d.promise();
291
+ };
292
+
293
+ UI.Utils.uid = function(prefix) {
294
+ return (prefix || 'id') + (new Date().getTime())+"RAND"+(Math.ceil(Math.random() * 100000));
295
+ };
296
+
297
+ UI.Utils.template = function(str, data) {
298
+
299
+ var tokens = str.replace(/\n/g, '\\n').replace(/\{\{\{\s*(.+?)\s*\}\}\}/g, "{{!$1}}").split(/(\{\{\s*(.+?)\s*\}\})/g),
300
+ i=0, toc, cmd, prop, val, fn, output = [], openblocks = 0;
301
+
302
+ while(i < tokens.length) {
303
+
304
+ toc = tokens[i];
305
+
306
+ if(toc.match(/\{\{\s*(.+?)\s*\}\}/)) {
307
+ i = i + 1;
308
+ toc = tokens[i];
309
+ cmd = toc[0];
310
+ prop = toc.substring(toc.match(/^(\^|\#|\!|\~|\:)/) ? 1:0);
311
+
312
+ switch(cmd) {
313
+ case '~':
314
+ output.push("for(var $i=0;$i<"+prop+".length;$i++) { var $item = "+prop+"[$i];");
315
+ openblocks++;
316
+ break;
317
+ case ':':
318
+ output.push("for(var $key in "+prop+") { var $val = "+prop+"[$key];");
319
+ openblocks++;
320
+ break;
321
+ case '#':
322
+ output.push("if("+prop+") {");
323
+ openblocks++;
324
+ break;
325
+ case '^':
326
+ output.push("if(!"+prop+") {");
327
+ openblocks++;
328
+ break;
329
+ case '/':
330
+ output.push("}");
331
+ openblocks--;
332
+ break;
333
+ case '!':
334
+ output.push("__ret.push("+prop+");");
335
+ break;
336
+ default:
337
+ output.push("__ret.push(escape("+prop+"));");
338
+ break;
339
+ }
340
+ } else {
341
+ output.push("__ret.push('"+toc.replace(/\'/g, "\\'")+"');");
342
+ }
343
+ i = i + 1;
344
+ }
345
+
346
+ fn = new Function('$data', [
347
+ 'var __ret = [];',
348
+ 'try {',
349
+ 'with($data){', (!openblocks ? output.join('') : '__ret = ["Not all blocks are closed correctly."]'), '};',
350
+ '}catch(e){__ret = [e.message];}',
351
+ 'return __ret.join("").replace(/\\n\\n/g, "\\n");',
352
+ "function escape(html) { return String(html).replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;').replace(/>/g, '&gt;');}"
353
+ ].join("\n"));
354
+
355
+ return data ? fn(data) : fn;
356
+ };
357
+
358
+ UI.Utils.events = {};
359
+ UI.Utils.events.click = UI.support.touch ? 'tap' : 'click';
360
+
361
+ global.UIkit = UI;
362
+
363
+ // deprecated
364
+
365
+ UI.fn = function(command, options) {
366
+
367
+ var args = arguments, cmd = command.match(/^([a-z\-]+)(?:\.([a-z]+))?/i), component = cmd[1], method = cmd[2];
368
+
369
+ if (!UI[component]) {
370
+ $.error("UIkit component [" + component + "] does not exist.");
371
+ return this;
372
+ }
373
+
374
+ return this.each(function() {
375
+ var $this = $(this), data = $this.data(component);
376
+ if (!data) $this.data(component, (data = UI[component](this, method ? undefined : options)));
377
+ if (method) data[method].apply(data, Array.prototype.slice.call(args, 1));
378
+ });
379
+ };
380
+
381
+ $.UIkit = UI;
382
+ $.fn.uk = UI.fn;
383
+
384
+ UI.langdirection = UI.$html.attr("dir") == "rtl" ? "right" : "left";
385
+
386
+ UI.components = {};
387
+
388
+ UI.component = function(name, def) {
389
+
390
+ var fn = function(element, options) {
391
+
392
+ var $this = this;
393
+
394
+ this.UIkit = UI;
395
+ this.element = element ? UI.$(element) : null;
396
+ this.options = $.extend(true, {}, this.defaults, options);
397
+ this.plugins = {};
398
+
399
+ if (this.element) {
400
+ this.element.data(name, this);
401
+ }
402
+
403
+ this.init();
404
+
405
+ (this.options.plugins.length ? this.options.plugins : Object.keys(fn.plugins)).forEach(function(plugin) {
406
+
407
+ if (fn.plugins[plugin].init) {
408
+ fn.plugins[plugin].init($this);
409
+ $this.plugins[plugin] = true;
410
+ }
411
+
412
+ });
413
+
414
+ this.trigger('init.uk.component', [name, this]);
415
+
416
+ return this;
417
+ };
418
+
419
+ fn.plugins = {};
420
+
421
+ $.extend(true, fn.prototype, {
422
+
423
+ defaults : {plugins: []},
424
+
425
+ boot: function(){},
426
+ init: function(){},
427
+
428
+ on: function(a1,a2,a3){
429
+ return UI.$(this.element || this).on(a1,a2,a3);
430
+ },
431
+
432
+ one: function(a1,a2,a3){
433
+ return UI.$(this.element || this).one(a1,a2,a3);
434
+ },
435
+
436
+ off: function(evt){
437
+ return UI.$(this.element || this).off(evt);
438
+ },
439
+
440
+ trigger: function(evt, params) {
441
+ return UI.$(this.element || this).trigger(evt, params);
442
+ },
443
+
444
+ find: function(selector) {
445
+ return UI.$(this.element ? this.element: []).find(selector);
446
+ },
447
+
448
+ proxy: function(obj, methods) {
449
+
450
+ var $this = this;
451
+
452
+ methods.split(' ').forEach(function(method) {
453
+ if (!$this[method]) $this[method] = function() { return obj[method].apply(obj, arguments); };
454
+ });
455
+ },
456
+
457
+ mixin: function(obj, methods) {
458
+
459
+ var $this = this;
460
+
461
+ methods.split(' ').forEach(function(method) {
462
+ if (!$this[method]) $this[method] = obj[method].bind($this);
463
+ });
464
+ },
465
+
466
+ option: function() {
467
+
468
+ if (arguments.length == 1) {
469
+ return this.options[arguments[0]] || undefined;
470
+ } else if (arguments.length == 2) {
471
+ this.options[arguments[0]] = arguments[1];
472
+ }
473
+ }
474
+
475
+ }, def);
476
+
477
+ this.components[name] = fn;
478
+
479
+ this[name] = function() {
480
+
481
+ var element, options;
482
+
483
+ if (arguments.length) {
484
+
485
+ switch(arguments.length) {
486
+ case 1:
487
+
488
+ if (typeof arguments[0] === "string" || arguments[0].nodeType || arguments[0] instanceof jQuery) {
489
+ element = $(arguments[0]);
490
+ } else {
491
+ options = arguments[0];
492
+ }
493
+
494
+ break;
495
+ case 2:
496
+
497
+ element = $(arguments[0]);
498
+ options = arguments[1];
499
+ break;
500
+ }
501
+ }
502
+
503
+ if (element && element.data(name)) {
504
+ return element.data(name);
505
+ }
506
+
507
+ return (new UI.components[name](element, options));
508
+ };
509
+
510
+ if (UI.domready) {
511
+ UI.component.boot(name);
512
+ }
513
+
514
+ return fn;
515
+ };
516
+
517
+ UI.plugin = function(component, name, def) {
518
+ this.components[component].plugins[name] = def;
519
+ };
520
+
521
+ UI.component.boot = function(name) {
522
+
523
+ if (UI.components[name].prototype && UI.components[name].prototype.boot && !UI.components[name].booted) {
524
+ UI.components[name].prototype.boot.apply(UI, []);
525
+ UI.components[name].booted = true;
526
+ }
527
+ };
528
+
529
+ UI.component.bootComponents = function() {
530
+
531
+ for (var component in UI.components) {
532
+ UI.component.boot(component);
533
+ }
534
+ };
535
+
536
+
537
+ // DOM mutation save ready helper function
538
+
539
+ UI.domObservers = [];
540
+ UI.domready = false;
541
+
542
+ UI.ready = function(fn) {
543
+
544
+ UI.domObservers.push(fn);
545
+
546
+ if (UI.domready) {
547
+ fn(document);
548
+ }
549
+ };
550
+
551
+ UI.on = function(a1,a2,a3){
552
+
553
+ if (a1 && a1.indexOf('ready.uk.dom') > -1 && UI.domready) {
554
+ a2.apply(UI.$doc);
555
+ }
556
+
557
+ return UI.$doc.on(a1,a2,a3);
558
+ };
559
+
560
+ UI.one = function(a1,a2,a3){
561
+
562
+ if (a1 && a1.indexOf('ready.uk.dom') > -1 && UI.domready) {
563
+ a2.apply(UI.$doc);
564
+ return UI.$doc;
565
+ }
566
+
567
+ return UI.$doc.one(a1,a2,a3);
568
+ };
569
+
570
+ UI.trigger = function(evt, params) {
571
+ return UI.$doc.trigger(evt, params);
572
+ };
573
+
574
+ UI.domObserve = function(selector, fn) {
575
+
576
+ if(!UI.support.mutationobserver) return;
577
+
578
+ fn = fn || function() {};
579
+
580
+ UI.$(selector).each(function() {
581
+
582
+ var element = this,
583
+ $element = UI.$(element);
584
+
585
+ if ($element.data('observer')) {
586
+ return;
587
+ }
588
+
589
+ try {
590
+
591
+ var observer = new UI.support.mutationobserver(UI.Utils.debounce(function(mutations) {
592
+ fn.apply(element, []);
593
+ $element.trigger('changed.uk.dom');
594
+ }, 50));
595
+
596
+ // pass in the target node, as well as the observer options
597
+ observer.observe(element, { childList: true, subtree: true });
598
+
599
+ $element.data('observer', observer);
600
+
601
+ } catch(e) {}
602
+ });
603
+ };
604
+
605
+ UI.init = function(root) {
606
+
607
+ root = root || document;
608
+
609
+ UI.domObservers.forEach(function(fn){
610
+ fn(root);
611
+ });
612
+ };
613
+
614
+ UI.on('domready.uk.dom', function(){
615
+
616
+ UI.init();
617
+
618
+ if (UI.domready) UI.Utils.checkDisplay();
619
+ });
620
+
621
+ $(function(){
622
+
623
+ UI.$body = UI.$('body');
624
+
625
+ UI.ready(function(context){
626
+ UI.domObserve('[data-uk-observe]');
627
+ });
628
+
629
+ UI.on('changed.uk.dom', function(e) {
630
+ UI.init(e.target);
631
+ UI.Utils.checkDisplay(e.target);
632
+ });
633
+
634
+ UI.trigger('beforeready.uk.dom');
635
+
636
+ UI.component.bootComponents();
637
+
638
+ // custom scroll observer
639
+ requestAnimationFrame((function(){
640
+
641
+ var memory = {x: window.pageXOffset, y:window.pageYOffset}, dir;
642
+
643
+ var fn = function(){
644
+
645
+ if (memory.x != window.pageXOffset || memory.y != window.pageYOffset) {
646
+
647
+ dir = {x: 0 , y: 0};
648
+
649
+ if (window.pageXOffset != memory.x) dir.x = window.pageXOffset > memory.x ? 1:-1;
650
+ if (window.pageYOffset != memory.y) dir.y = window.pageYOffset > memory.y ? 1:-1;
651
+
652
+ memory = {
653
+ "dir": dir, "x": window.pageXOffset, "y": window.pageYOffset
654
+ };
655
+
656
+ UI.$doc.trigger('scrolling.uk.document', [memory]);
657
+ }
658
+
659
+ requestAnimationFrame(fn);
660
+ };
661
+
662
+ if (UI.support.touch) {
663
+ UI.$html.on('touchmove touchend MSPointerMove MSPointerUp pointermove pointerup', fn);
664
+ }
665
+
666
+ if (memory.x || memory.y) fn();
667
+
668
+ return fn;
669
+
670
+ })());
671
+
672
+ // run component init functions on dom
673
+ UI.trigger('domready.uk.dom');
674
+
675
+ if (UI.support.touch) {
676
+
677
+ // remove css hover rules for touch devices
678
+ // UI.Utils.removeCssRules(/\.uk-(?!navbar).*:hover/);
679
+
680
+ // viewport unit fix for uk-height-viewport - should be fixed in iOS 8
681
+ if (navigator.userAgent.match(/(iPad|iPhone|iPod)/g)) {
682
+
683
+ UI.$win.on('load orientationchange resize', UI.Utils.debounce((function(){
684
+
685
+ var fn = function() {
686
+ $('.uk-height-viewport').css('height', window.innerHeight);
687
+ return fn;
688
+ };
689
+
690
+ return fn();
691
+
692
+ })(), 100));
693
+ }
694
+ }
695
+
696
+ UI.trigger('afterready.uk.dom');
697
+
698
+ // mark that domready is left behind
699
+ UI.domready = true;
700
+ });
701
+
702
+ // add touch identifier class
703
+ UI.$html.addClass(UI.support.touch ? "uk-touch" : "uk-notouch");
704
+
705
+ // add uk-hover class on tap to support overlays on touch devices
706
+ if (UI.support.touch) {
707
+
708
+ var hoverset = false,
709
+ exclude,
710
+ hovercls = 'uk-hover',
711
+ selector = '.uk-overlay, .uk-overlay-hover, .uk-overlay-toggle, .uk-animation-hover, .uk-has-hover';
712
+
713
+ UI.$html.on('mouseenter touchstart MSPointerDown pointerdown', selector, function() {
714
+
715
+ if (hoverset) $('.'+hovercls).removeClass(hovercls);
716
+
717
+ hoverset = $(this).addClass(hovercls);
718
+
719
+ }).on('mouseleave touchend MSPointerUp pointerup', function(e) {
720
+
721
+ exclude = $(e.target).parents(selector);
722
+
723
+ if (hoverset) {
724
+ hoverset.not(exclude).removeClass(hovercls);
725
+ }
726
+ });
727
+ }
728
+
729
+ return UI;
730
+ });
731
+
732
+ // Based on Zeptos touch.js
733
+ // https://raw.github.com/madrobby/zepto/master/src/touch.js
734
+ // Zepto.js may be freely distributed under the MIT license.
735
+
736
+ ;(function($){
737
+
738
+ if ($.fn.swipeLeft) {
739
+ return;
740
+ }
741
+
742
+
743
+ var touch = {}, touchTimeout, tapTimeout, swipeTimeout, longTapTimeout, longTapDelay = 750, gesture;
744
+
745
+ function swipeDirection(x1, x2, y1, y2) {
746
+ return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? (x1 - x2 > 0 ? 'Left' : 'Right') : (y1 - y2 > 0 ? 'Up' : 'Down');
747
+ }
748
+
749
+ function longTap() {
750
+ longTapTimeout = null;
751
+ if (touch.last) {
752
+ if ( touch.el !== undefined ) touch.el.trigger('longTap');
753
+ touch = {};
754
+ }
755
+ }
756
+
757
+ function cancelLongTap() {
758
+ if (longTapTimeout) clearTimeout(longTapTimeout);
759
+ longTapTimeout = null;
760
+ }
761
+
762
+ function cancelAll() {
763
+ if (touchTimeout) clearTimeout(touchTimeout);
764
+ if (tapTimeout) clearTimeout(tapTimeout);
765
+ if (swipeTimeout) clearTimeout(swipeTimeout);
766
+ if (longTapTimeout) clearTimeout(longTapTimeout);
767
+ touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null;
768
+ touch = {};
769
+ }
770
+
771
+ function isPrimaryTouch(event){
772
+ return event.pointerType == event.MSPOINTER_TYPE_TOUCH && event.isPrimary;
773
+ }
774
+
775
+ $(function(){
776
+ var now, delta, deltaX = 0, deltaY = 0, firstTouch;
777
+
778
+ if ('MSGesture' in window) {
779
+ gesture = new MSGesture();
780
+ gesture.target = document.body;
781
+ }
782
+
783
+ $(document)
784
+ .on('MSGestureEnd gestureend', function(e){
785
+
786
+ var swipeDirectionFromVelocity = e.originalEvent.velocityX > 1 ? 'Right' : e.originalEvent.velocityX < -1 ? 'Left' : e.originalEvent.velocityY > 1 ? 'Down' : e.originalEvent.velocityY < -1 ? 'Up' : null;
787
+
788
+ if (swipeDirectionFromVelocity && touch.el !== undefined) {
789
+ touch.el.trigger('swipe');
790
+ touch.el.trigger('swipe'+ swipeDirectionFromVelocity);
791
+ }
792
+ })
793
+ // MSPointerDown: for IE10
794
+ // pointerdown: for IE11
795
+ .on('touchstart MSPointerDown pointerdown', function(e){
796
+
797
+ if(e.type == 'MSPointerDown' && !isPrimaryTouch(e.originalEvent)) return;
798
+
799
+ firstTouch = (e.type == 'MSPointerDown' || e.type == 'pointerdown') ? e : e.originalEvent.touches[0];
800
+
801
+ now = Date.now();
802
+ delta = now - (touch.last || now);
803
+ touch.el = $('tagName' in firstTouch.target ? firstTouch.target : firstTouch.target.parentNode);
804
+
805
+ if(touchTimeout) clearTimeout(touchTimeout);
806
+
807
+ touch.x1 = firstTouch.pageX;
808
+ touch.y1 = firstTouch.pageY;
809
+
810
+ if (delta > 0 && delta <= 250) touch.isDoubleTap = true;
811
+
812
+ touch.last = now;
813
+ longTapTimeout = setTimeout(longTap, longTapDelay);
814
+
815
+ // adds the current touch contact for IE gesture recognition
816
+ if (gesture && ( e.type == 'MSPointerDown' || e.type == 'pointerdown' || e.type == 'touchstart' ) ) {
817
+ gesture.addPointer(e.originalEvent.pointerId);
818
+ }
819
+
820
+ })
821
+ // MSPointerMove: for IE10
822
+ // pointermove: for IE11
823
+ .on('touchmove MSPointerMove pointermove', function(e){
824
+
825
+ if (e.type == 'MSPointerMove' && !isPrimaryTouch(e.originalEvent)) return;
826
+
827
+ firstTouch = (e.type == 'MSPointerMove' || e.type == 'pointermove') ? e : e.originalEvent.touches[0];
828
+
829
+ cancelLongTap();
830
+ touch.x2 = firstTouch.pageX;
831
+ touch.y2 = firstTouch.pageY;
832
+
833
+ deltaX += Math.abs(touch.x1 - touch.x2);
834
+ deltaY += Math.abs(touch.y1 - touch.y2);
835
+ })
836
+ // MSPointerUp: for IE10
837
+ // pointerup: for IE11
838
+ .on('touchend MSPointerUp pointerup', function(e){
839
+
840
+ if (e.type == 'MSPointerUp' && !isPrimaryTouch(e.originalEvent)) return;
841
+
842
+ cancelLongTap();
843
+
844
+ // swipe
845
+ if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)){
846
+
847
+ swipeTimeout = setTimeout(function() {
848
+ if ( touch.el !== undefined ) {
849
+ touch.el.trigger('swipe');
850
+ touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)));
851
+ }
852
+ touch = {};
853
+ }, 0);
854
+
855
+ // normal tap
856
+ } else if ('last' in touch) {
857
+
858
+ // don't fire tap when delta position changed by more than 30 pixels,
859
+ // for instance when moving to a point and back to origin
860
+ if (isNaN(deltaX) || (deltaX < 30 && deltaY < 30)) {
861
+ // delay by one tick so we can cancel the 'tap' event if 'scroll' fires
862
+ // ('tap' fires before 'scroll')
863
+ tapTimeout = setTimeout(function() {
864
+
865
+ // trigger universal 'tap' with the option to cancelTouch()
866
+ // (cancelTouch cancels processing of single vs double taps for faster 'tap' response)
867
+ var event = $.Event('tap');
868
+ event.cancelTouch = cancelAll;
869
+ if ( touch.el !== undefined ) touch.el.trigger(event);
870
+
871
+ // trigger double tap immediately
872
+ if (touch.isDoubleTap) {
873
+ if ( touch.el !== undefined ) touch.el.trigger('doubleTap');
874
+ touch = {};
875
+ }
876
+
877
+ // trigger single tap after 250ms of inactivity
878
+ else {
879
+ touchTimeout = setTimeout(function(){
880
+ touchTimeout = null;
881
+ if ( touch.el !== undefined ) touch.el.trigger('singleTap');
882
+ touch = {};
883
+ }, 250);
884
+ }
885
+ }, 0);
886
+ } else {
887
+ touch = {};
888
+ }
889
+ deltaX = deltaY = 0;
890
+ }
891
+ })
892
+ // when the browser window loses focus,
893
+ // for example when a modal dialog is shown,
894
+ // cancel all ongoing events
895
+ .on('touchcancel MSPointerCancel', cancelAll);
896
+
897
+ // scrolling the window indicates intention of the user
898
+ // to scroll, not tap or swipe, so cancel all ongoing events
899
+ $(window).on('scroll', cancelAll);
900
+ });
901
+
902
+ ['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function(eventName){
903
+ $.fn[eventName] = function(callback){ return $(this).on(eventName, callback); };
904
+ });
905
+ })(jQuery);
906
+
907
+ (function(UI) {
908
+
909
+ "use strict";
910
+
911
+ var stacks = [];
912
+
913
+ UI.component('stackMargin', {
914
+
915
+ defaults: {
916
+ 'cls': 'uk-margin-small-top'
917
+ },
918
+
919
+ boot: function() {
920
+
921
+ // init code
922
+ UI.ready(function(context) {
923
+
924
+ UI.$("[data-uk-margin]", context).each(function() {
925
+
926
+ var ele = UI.$(this), obj;
927
+
928
+ if (!ele.data("stackMargin")) {
929
+ obj = UI.stackMargin(ele, UI.Utils.options(ele.attr("data-uk-margin")));
930
+ }
931
+ });
932
+ });
933
+ },
934
+
935
+ init: function() {
936
+
937
+ var $this = this;
938
+
939
+ this.columns = [];
940
+
941
+ UI.$win.on('resize orientationchange', (function() {
942
+
943
+ var fn = function() {
944
+ $this.process();
945
+ };
946
+
947
+ UI.$(function() {
948
+ fn();
949
+ UI.$win.on("load", fn);
950
+ });
951
+
952
+ return UI.Utils.debounce(fn, 20);
953
+ })());
954
+
955
+ UI.$html.on("changed.uk.dom", function(e) {
956
+ $this.process();
957
+ });
958
+
959
+ this.on("display.uk.check", function(e) {
960
+ if (this.element.is(":visible")) this.process();
961
+ }.bind(this));
962
+
963
+ stacks.push(this);
964
+ },
965
+
966
+ process: function() {
967
+
968
+ this.columns = this.element.children();
969
+
970
+ UI.Utils.stackMargin(this.columns, this.options);
971
+
972
+ return this;
973
+ },
974
+
975
+ revert: function() {
976
+ this.columns.removeClass(this.options.cls);
977
+ return this;
978
+ }
979
+ });
980
+
981
+
982
+ // responsive element e.g. iframes
983
+
984
+ (function(){
985
+
986
+ var elements = [], check = function(ele) {
987
+
988
+ if (!ele.is(':visible')) return;
989
+
990
+ var width = ele.parent().width(),
991
+ iwidth = ele.data('width'),
992
+ ratio = (width / iwidth),
993
+ height = Math.floor(ratio * ele.data('height'));
994
+
995
+ ele.css({'height': (width < iwidth) ? height : ele.data('height')});
996
+ };
997
+
998
+ UI.component('responsiveElement', {
999
+
1000
+ defaults: {},
1001
+
1002
+ boot: function() {
1003
+
1004
+ // init code
1005
+ UI.ready(function(context) {
1006
+
1007
+ UI.$("iframe.uk-responsive-width, [data-uk-responsive]", context).each(function() {
1008
+
1009
+ var ele = UI.$(this), obj;
1010
+
1011
+ if (!ele.data("responsiveIframe")) {
1012
+ obj = UI.responsiveElement(ele, {});
1013
+ }
1014
+ });
1015
+ });
1016
+ },
1017
+
1018
+ init: function() {
1019
+
1020
+ var ele = this.element;
1021
+
1022
+ if (ele.attr('width') && ele.attr('height')) {
1023
+
1024
+ ele.data({
1025
+
1026
+ 'width' : ele.attr('width'),
1027
+ 'height': ele.attr('height')
1028
+
1029
+ }).on('display.uk.check', function(){
1030
+ check(ele);
1031
+ });
1032
+
1033
+ check(ele);
1034
+
1035
+ elements.push(ele);
1036
+ }
1037
+ }
1038
+ });
1039
+
1040
+ UI.$win.on('resize load', UI.Utils.debounce(function(){
1041
+
1042
+ elements.forEach(function(ele){
1043
+ check(ele);
1044
+ });
1045
+
1046
+ }, 15));
1047
+
1048
+ })();
1049
+
1050
+
1051
+
1052
+ // helper
1053
+
1054
+ UI.Utils.stackMargin = function(elements, options) {
1055
+
1056
+ options = UI.$.extend({
1057
+ 'cls': 'uk-margin-small-top'
1058
+ }, options);
1059
+
1060
+ options.cls = options.cls;
1061
+
1062
+ elements = UI.$(elements).removeClass(options.cls);
1063
+
1064
+ var skip = false,
1065
+ firstvisible = elements.filter(":visible:first"),
1066
+ offset = firstvisible.length ? (firstvisible.position().top + firstvisible.outerHeight()) - 1 : false; // (-1): weird firefox bug when parent container is display:flex
1067
+
1068
+ if (offset === false || elements.length == 1) return;
1069
+
1070
+ elements.each(function() {
1071
+
1072
+ var column = UI.$(this);
1073
+
1074
+ if (column.is(":visible")) {
1075
+
1076
+ if (skip) {
1077
+ column.addClass(options.cls);
1078
+ } else {
1079
+
1080
+ if (column.position().top >= offset) {
1081
+ skip = column.addClass(options.cls);
1082
+ }
1083
+ }
1084
+ }
1085
+ });
1086
+ };
1087
+
1088
+ UI.Utils.matchHeights = function(elements, options) {
1089
+
1090
+ elements = UI.$(elements).css('min-height', '');
1091
+ options = UI.$.extend({ row : true }, options);
1092
+
1093
+ var matchHeights = function(group){
1094
+
1095
+ if (group.length < 2) return;
1096
+
1097
+ var max = 0;
1098
+
1099
+ group.each(function() {
1100
+ max = Math.max(max, UI.$(this).outerHeight());
1101
+ }).each(function() {
1102
+
1103
+ var element = UI.$(this),
1104
+ height = max - (element.css('box-sizing') == 'border-box' ? 0 : (element.outerHeight() - element.height()));
1105
+
1106
+ element.css('min-height', height + 'px');
1107
+ });
1108
+ };
1109
+
1110
+ if (options.row) {
1111
+
1112
+ elements.first().width(); // force redraw
1113
+
1114
+ setTimeout(function(){
1115
+
1116
+ var lastoffset = false, group = [];
1117
+
1118
+ elements.each(function() {
1119
+
1120
+ var ele = UI.$(this), offset = ele.offset().top;
1121
+
1122
+ if (offset != lastoffset && group.length) {
1123
+
1124
+ matchHeights(UI.$(group));
1125
+ group = [];
1126
+ offset = ele.offset().top;
1127
+ }
1128
+
1129
+ group.push(ele);
1130
+ lastoffset = offset;
1131
+ });
1132
+
1133
+ if (group.length) {
1134
+ matchHeights(UI.$(group));
1135
+ }
1136
+
1137
+ }, 0);
1138
+
1139
+ } else {
1140
+ matchHeights(elements);
1141
+ }
1142
+ };
1143
+
1144
+ (function(cacheSvgs){
1145
+
1146
+ UI.Utils.inlineSvg = function(selector, root) {
1147
+
1148
+ var images = UI.$(selector || 'img[src$=".svg"]', root || document).each(function(){
1149
+
1150
+ var img = UI.$(this),
1151
+ src = img.attr('src');
1152
+
1153
+ if (!cacheSvgs[src]) {
1154
+
1155
+ var d = UI.$.Deferred();
1156
+
1157
+ UI.$.get(src, {nc: Math.random()}, function(data){
1158
+ d.resolve(UI.$(data).find('svg'));
1159
+ });
1160
+
1161
+ cacheSvgs[src] = d.promise();
1162
+ }
1163
+
1164
+ cacheSvgs[src].then(function(svg) {
1165
+
1166
+ var $svg = UI.$(svg).clone();
1167
+
1168
+ if (img.attr('id')) $svg.attr('id', img.attr('id'));
1169
+ if (img.attr('class')) $svg.attr('class', img.attr('class'));
1170
+ if (img.attr('style')) $svg.attr('style', img.attr('style'));
1171
+
1172
+ if (img.attr('width')) {
1173
+ $svg.attr('width', img.attr('width'));
1174
+ if (!img.attr('height')) $svg.removeAttr('height');
1175
+ }
1176
+
1177
+ if (img.attr('height')){
1178
+ $svg.attr('height', img.attr('height'));
1179
+ if (!img.attr('width')) $svg.removeAttr('width');
1180
+ }
1181
+
1182
+ img.replaceWith($svg);
1183
+ });
1184
+ });
1185
+ };
1186
+
1187
+ // init code
1188
+ UI.ready(function(context) {
1189
+ UI.Utils.inlineSvg('[data-uk-svg]', context);
1190
+ });
1191
+
1192
+ })({});
1193
+
1194
+ })(UIkit);
1195
+
1196
+ (function(UI) {
1197
+
1198
+ "use strict";
1199
+
1200
+ UI.component('smoothScroll', {
1201
+
1202
+ boot: function() {
1203
+
1204
+ // init code
1205
+ UI.$html.on("click.smooth-scroll.uikit", "[data-uk-smooth-scroll]", function(e) {
1206
+ var ele = UI.$(this);
1207
+
1208
+ if (!ele.data("smoothScroll")) {
1209
+ var obj = UI.smoothScroll(ele, UI.Utils.options(ele.attr("data-uk-smooth-scroll")));
1210
+ ele.trigger("click");
1211
+ }
1212
+
1213
+ return false;
1214
+ });
1215
+ },
1216
+
1217
+ init: function() {
1218
+
1219
+ var $this = this;
1220
+
1221
+ this.on("click", function(e) {
1222
+ e.preventDefault();
1223
+ scrollToElement(UI.$(this.hash).length ? UI.$(this.hash) : UI.$("body"), $this.options);
1224
+ });
1225
+ }
1226
+ });
1227
+
1228
+ function scrollToElement(ele, options) {
1229
+
1230
+ options = UI.$.extend({
1231
+ duration: 1000,
1232
+ transition: 'easeOutExpo',
1233
+ offset: 0,
1234
+ complete: function(){}
1235
+ }, options);
1236
+
1237
+ // get / set parameters
1238
+ var target = ele.offset().top - options.offset,
1239
+ docheight = UI.$doc.height(),
1240
+ winheight = window.innerHeight;
1241
+
1242
+ if ((target + winheight) > docheight) {
1243
+ target = docheight - winheight;
1244
+ }
1245
+
1246
+ // animate to target, fire callback when done
1247
+ UI.$("html,body").stop().animate({scrollTop: target}, options.duration, options.transition).promise().done(options.complete);
1248
+ }
1249
+
1250
+ UI.Utils.scrollToElement = scrollToElement;
1251
+
1252
+ if (!UI.$.easing.easeOutExpo) {
1253
+ UI.$.easing.easeOutExpo = function(x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; };
1254
+ }
1255
+
1256
+ })(UIkit);
1257
+
1258
+ (function(UI) {
1259
+
1260
+ "use strict";
1261
+
1262
+ var $win = UI.$win,
1263
+ $doc = UI.$doc,
1264
+ scrollspies = [],
1265
+ checkScrollSpy = function() {
1266
+ for(var i=0; i < scrollspies.length; i++) {
1267
+ window.requestAnimationFrame.apply(window, [scrollspies[i].check]);
1268
+ }
1269
+ };
1270
+
1271
+ UI.component('scrollspy', {
1272
+
1273
+ defaults: {
1274
+ "target" : false,
1275
+ "cls" : "uk-scrollspy-inview",
1276
+ "initcls" : "uk-scrollspy-init-inview",
1277
+ "topoffset" : 0,
1278
+ "leftoffset" : 0,
1279
+ "repeat" : false,
1280
+ "delay" : 0
1281
+ },
1282
+
1283
+ boot: function() {
1284
+
1285
+ // listen to scroll and resize
1286
+ $doc.on("scrolling.uk.document", checkScrollSpy);
1287
+ $win.on("load resize orientationchange", UI.Utils.debounce(checkScrollSpy, 50));
1288
+
1289
+ // init code
1290
+ UI.ready(function(context) {
1291
+
1292
+ UI.$("[data-uk-scrollspy]", context).each(function() {
1293
+
1294
+ var element = UI.$(this);
1295
+
1296
+ if (!element.data("scrollspy")) {
1297
+ var obj = UI.scrollspy(element, UI.Utils.options(element.attr("data-uk-scrollspy")));
1298
+ }
1299
+ });
1300
+ });
1301
+ },
1302
+
1303
+ init: function() {
1304
+
1305
+ var $this = this, inviewstate, initinview, togglecls = this.options.cls.split(/,/), fn = function(){
1306
+
1307
+ var elements = $this.options.target ? $this.element.find($this.options.target) : $this.element,
1308
+ delayIdx = elements.length === 1 ? 1 : 0,
1309
+ toggleclsIdx = 0;
1310
+
1311
+ elements.each(function(idx){
1312
+
1313
+ var element = UI.$(this),
1314
+ inviewstate = element.data('inviewstate'),
1315
+ inview = UI.Utils.isInView(element, $this.options),
1316
+ toggle = element.data('ukScrollspyCls') || togglecls[toggleclsIdx].trim();
1317
+
1318
+ if (inview && !inviewstate && !element.data('scrollspy-idle')) {
1319
+
1320
+ if (!initinview) {
1321
+ element.addClass($this.options.initcls);
1322
+ $this.offset = element.offset();
1323
+ initinview = true;
1324
+
1325
+ element.trigger("init.uk.scrollspy");
1326
+ }
1327
+
1328
+ element.data('scrollspy-idle', setTimeout(function(){
1329
+
1330
+ element.addClass("uk-scrollspy-inview").toggleClass(toggle).width();
1331
+ element.trigger("inview.uk.scrollspy");
1332
+
1333
+ element.data('scrollspy-idle', false);
1334
+ element.data('inviewstate', true);
1335
+
1336
+ }, $this.options.delay * delayIdx));
1337
+
1338
+ delayIdx++;
1339
+ }
1340
+
1341
+ if (!inview && inviewstate && $this.options.repeat) {
1342
+
1343
+ if (element.data('scrollspy-idle')) {
1344
+ clearTimeout(element.data('scrollspy-idle'));
1345
+ }
1346
+
1347
+ element.removeClass("uk-scrollspy-inview").toggleClass(toggle);
1348
+ element.data('inviewstate', false);
1349
+
1350
+ element.trigger("outview.uk.scrollspy");
1351
+ }
1352
+
1353
+ toggleclsIdx = togglecls[toggleclsIdx + 1] ? (toggleclsIdx + 1) : 0;
1354
+
1355
+ });
1356
+ };
1357
+
1358
+ fn();
1359
+
1360
+ this.check = fn;
1361
+
1362
+ scrollspies.push(this);
1363
+ }
1364
+ });
1365
+
1366
+
1367
+ var scrollspynavs = [],
1368
+ checkScrollSpyNavs = function() {
1369
+ for(var i=0; i < scrollspynavs.length; i++) {
1370
+ window.requestAnimationFrame.apply(window, [scrollspynavs[i].check]);
1371
+ }
1372
+ };
1373
+
1374
+ UI.component('scrollspynav', {
1375
+
1376
+ defaults: {
1377
+ "cls" : 'uk-active',
1378
+ "closest" : false,
1379
+ "topoffset" : 0,
1380
+ "leftoffset" : 0,
1381
+ "smoothscroll" : false
1382
+ },
1383
+
1384
+ boot: function() {
1385
+
1386
+ // listen to scroll and resize
1387
+ $doc.on("scrolling.uk.document", checkScrollSpyNavs);
1388
+ $win.on("resize orientationchange", UI.Utils.debounce(checkScrollSpyNavs, 50));
1389
+
1390
+ // init code
1391
+ UI.ready(function(context) {
1392
+
1393
+ UI.$("[data-uk-scrollspy-nav]", context).each(function() {
1394
+
1395
+ var element = UI.$(this);
1396
+
1397
+ if (!element.data("scrollspynav")) {
1398
+ var obj = UI.scrollspynav(element, UI.Utils.options(element.attr("data-uk-scrollspy-nav")));
1399
+ }
1400
+ });
1401
+ });
1402
+ },
1403
+
1404
+ init: function() {
1405
+
1406
+ var ids = [],
1407
+ links = this.find("a[href^='#']").each(function(){ if(this.getAttribute("href").trim()!=='#') ids.push(this.getAttribute("href")); }),
1408
+ targets = UI.$(ids.join(",")),
1409
+
1410
+ clsActive = this.options.cls,
1411
+ clsClosest = this.options.closest || this.options.closest;
1412
+
1413
+ var $this = this, inviews, fn = function(){
1414
+
1415
+ inviews = [];
1416
+
1417
+ for (var i=0 ; i < targets.length ; i++) {
1418
+ if (UI.Utils.isInView(targets.eq(i), $this.options)) {
1419
+ inviews.push(targets.eq(i));
1420
+ }
1421
+ }
1422
+
1423
+ if (inviews.length) {
1424
+
1425
+ var navitems,
1426
+ scrollTop = $win.scrollTop(),
1427
+ target = (function(){
1428
+ for(var i=0; i< inviews.length;i++){
1429
+ if(inviews[i].offset().top >= scrollTop){
1430
+ return inviews[i];
1431
+ }
1432
+ }
1433
+ })();
1434
+
1435
+ if (!target) return;
1436
+
1437
+ if ($this.options.closest) {
1438
+ links.blur().closest(clsClosest).removeClass(clsActive);
1439
+ navitems = links.filter("a[href='#"+target.attr("id")+"']").closest(clsClosest).addClass(clsActive);
1440
+ } else {
1441
+ navitems = links.removeClass(clsActive).filter("a[href='#"+target.attr("id")+"']").addClass(clsActive);
1442
+ }
1443
+
1444
+ $this.element.trigger("inview.uk.scrollspynav", [target, navitems]);
1445
+ }
1446
+ };
1447
+
1448
+ if (this.options.smoothscroll && UI.smoothScroll) {
1449
+ links.each(function(){
1450
+ UI.smoothScroll(this, $this.options.smoothscroll);
1451
+ });
1452
+ }
1453
+
1454
+ fn();
1455
+
1456
+ this.element.data("scrollspynav", this);
1457
+
1458
+ this.check = fn;
1459
+ scrollspynavs.push(this);
1460
+
1461
+ }
1462
+ });
1463
+
1464
+ })(UIkit);
1465
+
1466
+ (function(UI){
1467
+
1468
+ "use strict";
1469
+
1470
+ var toggles = [];
1471
+
1472
+ UI.component('toggle', {
1473
+
1474
+ defaults: {
1475
+ target : false,
1476
+ cls : 'uk-hidden',
1477
+ animation : false,
1478
+ duration : 200
1479
+ },
1480
+
1481
+ boot: function(){
1482
+
1483
+ // init code
1484
+ UI.ready(function(context) {
1485
+
1486
+ UI.$("[data-uk-toggle]", context).each(function() {
1487
+ var ele = UI.$(this);
1488
+
1489
+ if (!ele.data("toggle")) {
1490
+ var obj = UI.toggle(ele, UI.Utils.options(ele.attr("data-uk-toggle")));
1491
+ }
1492
+ });
1493
+
1494
+ setTimeout(function(){
1495
+
1496
+ toggles.forEach(function(toggle){
1497
+ toggle.getToggles();
1498
+ });
1499
+
1500
+ }, 0);
1501
+ });
1502
+ },
1503
+
1504
+ init: function() {
1505
+
1506
+ var $this = this;
1507
+
1508
+ this.aria = (this.options.cls.indexOf('uk-hidden') !== -1);
1509
+
1510
+ this.getToggles();
1511
+
1512
+ this.on("click", function(e) {
1513
+ if ($this.element.is('a[href="#"]')) e.preventDefault();
1514
+ $this.toggle();
1515
+ });
1516
+
1517
+ toggles.push(this);
1518
+ },
1519
+
1520
+ toggle: function() {
1521
+
1522
+ if(!this.totoggle.length) return;
1523
+
1524
+ if (this.options.animation && UI.support.animation) {
1525
+
1526
+ var $this = this, animations = this.options.animation.split(',');
1527
+
1528
+ if (animations.length == 1) {
1529
+ animations[1] = animations[0];
1530
+ }
1531
+
1532
+ animations[0] = animations[0].trim();
1533
+ animations[1] = animations[1].trim();
1534
+
1535
+ this.totoggle.css('animation-duration', this.options.duration+'ms');
1536
+
1537
+ this.totoggle.each(function(){
1538
+
1539
+ var ele = UI.$(this);
1540
+
1541
+ if (ele.hasClass($this.options.cls)) {
1542
+
1543
+ ele.toggleClass($this.options.cls);
1544
+
1545
+ UI.Utils.animate(ele, animations[0]).then(function(){
1546
+ ele.css('animation-duration', '');
1547
+ UI.Utils.checkDisplay(ele);
1548
+ });
1549
+
1550
+ } else {
1551
+
1552
+ UI.Utils.animate(this, animations[1]+' uk-animation-reverse').then(function(){
1553
+ ele.toggleClass($this.options.cls).css('animation-duration', '');
1554
+ UI.Utils.checkDisplay(ele);
1555
+ });
1556
+
1557
+ }
1558
+
1559
+ });
1560
+
1561
+ } else {
1562
+ this.totoggle.toggleClass(this.options.cls);
1563
+ UI.Utils.checkDisplay(this.totoggle);
1564
+ }
1565
+
1566
+ this.updateAria();
1567
+
1568
+ },
1569
+
1570
+ getToggles: function() {
1571
+ this.totoggle = this.options.target ? UI.$(this.options.target):[];
1572
+ this.updateAria();
1573
+ },
1574
+
1575
+ updateAria: function() {
1576
+ if (this.aria && this.totoggle.length) {
1577
+ this.totoggle.each(function(){
1578
+ UI.$(this).attr('aria-hidden', UI.$(this).hasClass('uk-hidden'));
1579
+ });
1580
+ }
1581
+ }
1582
+ });
1583
+
1584
+ })(UIkit);
1585
+
1586
+ (function(UI) {
1587
+
1588
+ "use strict";
1589
+
1590
+ UI.component('alert', {
1591
+
1592
+ defaults: {
1593
+ "fade": true,
1594
+ "duration": 200,
1595
+ "trigger": ".uk-alert-close"
1596
+ },
1597
+
1598
+ boot: function() {
1599
+
1600
+ // init code
1601
+ UI.$html.on("click.alert.uikit", "[data-uk-alert]", function(e) {
1602
+
1603
+ var ele = UI.$(this);
1604
+
1605
+ if (!ele.data("alert")) {
1606
+
1607
+ var alert = UI.alert(ele, UI.Utils.options(ele.attr("data-uk-alert")));
1608
+
1609
+ if (UI.$(e.target).is(alert.options.trigger)) {
1610
+ e.preventDefault();
1611
+ alert.close();
1612
+ }
1613
+ }
1614
+ });
1615
+ },
1616
+
1617
+ init: function() {
1618
+
1619
+ var $this = this;
1620
+
1621
+ this.on("click", this.options.trigger, function(e) {
1622
+ e.preventDefault();
1623
+ $this.close();
1624
+ });
1625
+ },
1626
+
1627
+ close: function() {
1628
+
1629
+ var element = this.trigger("close.uk.alert"),
1630
+ removeElement = function () {
1631
+ this.trigger("closed.uk.alert").remove();
1632
+ }.bind(this);
1633
+
1634
+ if (this.options.fade) {
1635
+ element.css("overflow", "hidden").css("max-height", element.height()).animate({
1636
+ "height" : 0,
1637
+ "opacity" : 0,
1638
+ "padding-top" : 0,
1639
+ "padding-bottom" : 0,
1640
+ "margin-top" : 0,
1641
+ "margin-bottom" : 0
1642
+ }, this.options.duration, removeElement);
1643
+ } else {
1644
+ removeElement();
1645
+ }
1646
+ }
1647
+
1648
+ });
1649
+
1650
+ })(UIkit);
1651
+
1652
+ (function(UI) {
1653
+
1654
+ "use strict";
1655
+
1656
+ UI.component('buttonRadio', {
1657
+
1658
+ defaults: {
1659
+ "activeClass": 'uk-active',
1660
+ "target": ".uk-button"
1661
+ },
1662
+
1663
+ boot: function() {
1664
+
1665
+ // init code
1666
+ UI.$html.on("click.buttonradio.uikit", "[data-uk-button-radio]", function(e) {
1667
+
1668
+ var ele = UI.$(this);
1669
+
1670
+ if (!ele.data("buttonRadio")) {
1671
+
1672
+ var obj = UI.buttonRadio(ele, UI.Utils.options(ele.attr("data-uk-button-radio"))),
1673
+ target = UI.$(e.target);
1674
+
1675
+ if (target.is(obj.options.target)) {
1676
+ target.trigger("click");
1677
+ }
1678
+ }
1679
+ });
1680
+ },
1681
+
1682
+ init: function() {
1683
+
1684
+ var $this = this;
1685
+
1686
+ // Init ARIA
1687
+ this.find($this.options.target).attr('aria-checked', 'false').filter('.' + $this.options.activeClass).attr('aria-checked', 'true');
1688
+
1689
+ this.on("click", this.options.target, function(e) {
1690
+
1691
+ var ele = UI.$(this);
1692
+
1693
+ if (ele.is('a[href="#"]')) e.preventDefault();
1694
+
1695
+ $this.find($this.options.target).not(ele).removeClass($this.options.activeClass).blur();
1696
+ ele.addClass($this.options.activeClass);
1697
+
1698
+ // Update ARIA
1699
+ $this.find($this.options.target).not(ele).attr('aria-checked', 'false');
1700
+ ele.attr('aria-checked', 'true');
1701
+
1702
+ $this.trigger("change.uk.button", [ele]);
1703
+ });
1704
+
1705
+ },
1706
+
1707
+ getSelected: function() {
1708
+ return this.find('.' + this.options.activeClass);
1709
+ }
1710
+ });
1711
+
1712
+ UI.component('buttonCheckbox', {
1713
+
1714
+ defaults: {
1715
+ "activeClass": 'uk-active',
1716
+ "target": ".uk-button"
1717
+ },
1718
+
1719
+ boot: function() {
1720
+
1721
+ UI.$html.on("click.buttoncheckbox.uikit", "[data-uk-button-checkbox]", function(e) {
1722
+ var ele = UI.$(this);
1723
+
1724
+ if (!ele.data("buttonCheckbox")) {
1725
+
1726
+ var obj = UI.buttonCheckbox(ele, UI.Utils.options(ele.attr("data-uk-button-checkbox"))),
1727
+ target = UI.$(e.target);
1728
+
1729
+ if (target.is(obj.options.target)) {
1730
+ target.trigger("click");
1731
+ }
1732
+ }
1733
+ });
1734
+ },
1735
+
1736
+ init: function() {
1737
+
1738
+ var $this = this;
1739
+
1740
+ // Init ARIA
1741
+ this.find($this.options.target).attr('aria-checked', 'false').filter('.' + $this.options.activeClass).attr('aria-checked', 'true');
1742
+
1743
+ this.on("click", this.options.target, function(e) {
1744
+ var ele = UI.$(this);
1745
+
1746
+ if (ele.is('a[href="#"]')) e.preventDefault();
1747
+
1748
+ ele.toggleClass($this.options.activeClass).blur();
1749
+
1750
+ // Update ARIA
1751
+ ele.attr('aria-checked', ele.hasClass($this.options.activeClass));
1752
+
1753
+ $this.trigger("change.uk.button", [ele]);
1754
+ });
1755
+
1756
+ },
1757
+
1758
+ getSelected: function() {
1759
+ return this.find('.' + this.options.activeClass);
1760
+ }
1761
+ });
1762
+
1763
+
1764
+ UI.component('button', {
1765
+
1766
+ defaults: {},
1767
+
1768
+ boot: function() {
1769
+
1770
+ UI.$html.on("click.button.uikit", "[data-uk-button]", function(e) {
1771
+ var ele = UI.$(this);
1772
+
1773
+ if (!ele.data("button")) {
1774
+
1775
+ var obj = UI.button(ele, UI.Utils.options(ele.attr("data-uk-button")));
1776
+ ele.trigger("click");
1777
+ }
1778
+ });
1779
+ },
1780
+
1781
+ init: function() {
1782
+
1783
+ var $this = this;
1784
+
1785
+ // Init ARIA
1786
+ this.element.attr('aria-pressed', this.element.hasClass("uk-active"));
1787
+
1788
+ this.on("click", function(e) {
1789
+
1790
+ if ($this.element.is('a[href="#"]')) e.preventDefault();
1791
+
1792
+ $this.toggle();
1793
+ $this.trigger("change.uk.button", [$this.element.blur().hasClass("uk-active")]);
1794
+ });
1795
+
1796
+ },
1797
+
1798
+ toggle: function() {
1799
+ this.element.toggleClass("uk-active");
1800
+
1801
+ // Update ARIA
1802
+ this.element.attr('aria-pressed', this.element.hasClass("uk-active"));
1803
+ }
1804
+ });
1805
+
1806
+ })(UIkit);
1807
+
1808
+
1809
+ (function(UI) {
1810
+
1811
+ "use strict";
1812
+
1813
+ var active = false, hoverIdle, flips = {
1814
+ 'x': {
1815
+ "bottom-left" : 'bottom-right',
1816
+ "bottom-right" : 'bottom-left',
1817
+ "bottom-center" : 'bottom-right',
1818
+ "top-left" : 'top-right',
1819
+ "top-right" : 'top-left',
1820
+ "top-center" : 'top-right',
1821
+ "left-top" : 'right',
1822
+ "left-bottom" : 'right-bottom',
1823
+ "left-center" : 'right-center',
1824
+ "right-top" : 'left',
1825
+ "right-bottom" : 'left-bottom',
1826
+ "right-center" : 'left-center'
1827
+ },
1828
+ 'y': {
1829
+ "bottom-left" : 'top-left',
1830
+ "bottom-right" : 'top-right',
1831
+ "bottom-center" : 'top-center',
1832
+ "top-left" : 'bottom-left',
1833
+ "top-right" : 'bottom-right',
1834
+ "top-center" : 'bottom-center',
1835
+ "left-top" : 'top-left',
1836
+ "left-bottom" : 'left-bottom',
1837
+ "left-center" : 'top-left',
1838
+ "right-top" : 'top-left',
1839
+ "right-bottom" : 'bottom-left',
1840
+ "right-center" : 'top-left'
1841
+ },
1842
+ 'xy': {
1843
+
1844
+ }
1845
+ };
1846
+
1847
+ UI.component('dropdown', {
1848
+
1849
+ defaults: {
1850
+ 'mode' : 'hover',
1851
+ 'pos' : 'bottom-left',
1852
+ 'offset' : 0,
1853
+ 'remaintime' : 800,
1854
+ 'justify' : false,
1855
+ 'boundary' : UI.$win,
1856
+ 'delay' : 0,
1857
+ 'dropdownSelector': '.uk-dropdown,.uk-dropdown-blank',
1858
+ 'hoverDelayIdle' : 250,
1859
+ 'preventflip' : false
1860
+ },
1861
+
1862
+ remainIdle: false,
1863
+
1864
+ boot: function() {
1865
+
1866
+ var triggerevent = UI.support.touch ? "click" : "mouseenter";
1867
+
1868
+ // init code
1869
+ UI.$html.on(triggerevent+".dropdown.uikit", "[data-uk-dropdown]", function(e) {
1870
+
1871
+ var ele = UI.$(this);
1872
+
1873
+ if (!ele.data("dropdown")) {
1874
+
1875
+ var dropdown = UI.dropdown(ele, UI.Utils.options(ele.attr("data-uk-dropdown")));
1876
+
1877
+ if (triggerevent=="click" || (triggerevent=="mouseenter" && dropdown.options.mode=="hover")) {
1878
+ dropdown.element.trigger(triggerevent);
1879
+ }
1880
+
1881
+ if (dropdown.element.find(dropdown.options.dropdownSelector).length) {
1882
+ e.preventDefault();
1883
+ }
1884
+ }
1885
+ });
1886
+ },
1887
+
1888
+ init: function() {
1889
+
1890
+ var $this = this;
1891
+
1892
+ this.dropdown = this.find(this.options.dropdownSelector);
1893
+ this.offsetParent = this.dropdown.parents().filter(function() {
1894
+ return UI.$.inArray(UI.$(this).css('position'), ['relative', 'fixed', 'absolute']) !== -1;
1895
+ }).slice(0,1);
1896
+
1897
+ this.centered = this.dropdown.hasClass('uk-dropdown-center');
1898
+ this.justified = this.options.justify ? UI.$(this.options.justify) : false;
1899
+
1900
+ this.boundary = UI.$(this.options.boundary);
1901
+
1902
+ if (!this.boundary.length) {
1903
+ this.boundary = UI.$win;
1904
+ }
1905
+
1906
+ // legacy DEPRECATED!
1907
+ if (this.dropdown.hasClass('uk-dropdown-up')) {
1908
+ this.options.pos = 'top-left';
1909
+ }
1910
+ if (this.dropdown.hasClass('uk-dropdown-flip')) {
1911
+ this.options.pos = this.options.pos.replace('left','right');
1912
+ }
1913
+ if (this.dropdown.hasClass('uk-dropdown-center')) {
1914
+ this.options.pos = this.options.pos.replace(/(left|right)/,'center');
1915
+ }
1916
+ //-- end legacy
1917
+
1918
+ // Init ARIA
1919
+ this.element.attr('aria-haspopup', 'true');
1920
+ this.element.attr('aria-expanded', this.element.hasClass("uk-open"));
1921
+
1922
+ if (this.options.mode == "click" || UI.support.touch) {
1923
+
1924
+ this.on("click.uikit.dropdown", function(e) {
1925
+
1926
+ var $target = UI.$(e.target);
1927
+
1928
+ if (!$target.parents($this.options.dropdownSelector).length) {
1929
+
1930
+ if ($target.is("a[href='#']") || $target.parent().is("a[href='#']") || ($this.dropdown.length && !$this.dropdown.is(":visible")) ){
1931
+ e.preventDefault();
1932
+ }
1933
+
1934
+ $target.blur();
1935
+ }
1936
+
1937
+ if (!$this.element.hasClass('uk-open')) {
1938
+
1939
+ $this.show();
1940
+
1941
+ } else {
1942
+
1943
+ if (!$this.dropdown.find(e.target).length || $target.is(".uk-dropdown-close") || $target.parents(".uk-dropdown-close").length) {
1944
+ $this.hide();
1945
+ }
1946
+ }
1947
+ });
1948
+
1949
+ } else {
1950
+
1951
+ this.on("mouseenter", function(e) {
1952
+
1953
+ $this.trigger('pointerenter.uk.dropdown', [$this]);
1954
+
1955
+ if ($this.remainIdle) {
1956
+ clearTimeout($this.remainIdle);
1957
+ }
1958
+
1959
+ if (hoverIdle) {
1960
+ clearTimeout(hoverIdle);
1961
+ }
1962
+
1963
+ if (active && active == $this) {
1964
+ return;
1965
+ }
1966
+
1967
+ // pseudo manuAim
1968
+ if (active && active != $this) {
1969
+
1970
+ hoverIdle = setTimeout(function() {
1971
+ hoverIdle = setTimeout($this.show.bind($this), $this.options.delay);
1972
+ }, $this.options.hoverDelayIdle);
1973
+
1974
+ } else {
1975
+
1976
+ hoverIdle = setTimeout($this.show.bind($this), $this.options.delay);
1977
+ }
1978
+
1979
+ }).on("mouseleave", function() {
1980
+
1981
+ if (hoverIdle) {
1982
+ clearTimeout(hoverIdle);
1983
+ }
1984
+
1985
+ $this.remainIdle = setTimeout(function() {
1986
+ if (active && active == $this) $this.hide();
1987
+ }, $this.options.remaintime);
1988
+
1989
+ $this.trigger('pointerleave.uk.dropdown', [$this]);
1990
+
1991
+ }).on("click", function(e){
1992
+
1993
+ var $target = UI.$(e.target);
1994
+
1995
+ if ($this.remainIdle) {
1996
+ clearTimeout($this.remainIdle);
1997
+ }
1998
+
1999
+ if (active && active == $this) {
2000
+ if (!$this.dropdown.find(e.target).length || $target.is(".uk-dropdown-close") || $target.parents(".uk-dropdown-close").length) {
2001
+ $this.hide();
2002
+ }
2003
+ return;
2004
+ }
2005
+
2006
+ if ($target.is("a[href='#']") || $target.parent().is("a[href='#']")){
2007
+ e.preventDefault();
2008
+ }
2009
+
2010
+ $this.show();
2011
+ });
2012
+ }
2013
+ },
2014
+
2015
+ show: function(){
2016
+
2017
+ UI.$html.off("click.outer.dropdown");
2018
+
2019
+ if (active && active != this) {
2020
+ active.hide(true);
2021
+ }
2022
+
2023
+ if (hoverIdle) {
2024
+ clearTimeout(hoverIdle);
2025
+ }
2026
+
2027
+ this.trigger('beforeshow.uk.dropdown', [this]);
2028
+
2029
+ this.checkDimensions();
2030
+ this.element.addClass('uk-open');
2031
+
2032
+ // Update ARIA
2033
+ this.element.attr('aria-expanded', 'true');
2034
+
2035
+ this.trigger('show.uk.dropdown', [this]);
2036
+
2037
+ UI.Utils.checkDisplay(this.dropdown, true);
2038
+ active = this;
2039
+
2040
+ this.registerOuterClick();
2041
+ },
2042
+
2043
+ hide: function(force) {
2044
+
2045
+ this.trigger('beforehide.uk.dropdown', [this, force]);
2046
+
2047
+ this.element.removeClass('uk-open');
2048
+
2049
+ if (this.remainIdle) {
2050
+ clearTimeout(this.remainIdle);
2051
+ }
2052
+
2053
+ this.remainIdle = false;
2054
+
2055
+ // Update ARIA
2056
+ this.element.attr('aria-expanded', 'false');
2057
+
2058
+ this.trigger('hide.uk.dropdown', [this, force]);
2059
+
2060
+ if (active == this) active = false;
2061
+ },
2062
+
2063
+ registerOuterClick: function(){
2064
+
2065
+ var $this = this;
2066
+
2067
+ UI.$html.off("click.outer.dropdown");
2068
+
2069
+ setTimeout(function() {
2070
+
2071
+ UI.$html.on("click.outer.dropdown", function(e) {
2072
+
2073
+ if (hoverIdle) {
2074
+ clearTimeout(hoverIdle);
2075
+ }
2076
+
2077
+ var $target = UI.$(e.target);
2078
+
2079
+ if (active == $this && !$this.element.find(e.target).length) {
2080
+ $this.hide(true);
2081
+ UI.$html.off("click.outer.dropdown");
2082
+ }
2083
+ });
2084
+ }, 10);
2085
+ },
2086
+
2087
+ checkDimensions: function() {
2088
+
2089
+ if (!this.dropdown.length) return;
2090
+
2091
+ // reset
2092
+ this.dropdown.removeClass('uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack').css({
2093
+ 'top-left':'',
2094
+ 'left':'',
2095
+ 'margin-left' :'',
2096
+ 'margin-right':''
2097
+ });
2098
+
2099
+ if (this.justified && this.justified.length) {
2100
+ this.dropdown.css("min-width", "");
2101
+ }
2102
+
2103
+ var $this = this,
2104
+ pos = UI.$.extend({}, this.offsetParent.offset(), {width: this.offsetParent[0].offsetWidth, height: this.offsetParent[0].offsetHeight}),
2105
+ posoffset = this.options.offset,
2106
+ dropdown = this.dropdown,
2107
+ offset = dropdown.show().offset() || {left: 0, top: 0},
2108
+ width = dropdown.outerWidth(),
2109
+ height = dropdown.outerHeight(),
2110
+ boundarywidth = this.boundary.width(),
2111
+ boundaryoffset = this.boundary[0] !== window && this.boundary.offset() ? this.boundary.offset(): {top:0, left:0},
2112
+ dpos = this.options.pos;
2113
+
2114
+ var variants = {
2115
+ "bottom-left" : {top: 0 + pos.height + posoffset, left: 0},
2116
+ "bottom-right" : {top: 0 + pos.height + posoffset, left: 0 + pos.width - width},
2117
+ "bottom-center" : {top: 0 + pos.height + posoffset, left: 0 + pos.width / 2 - width / 2},
2118
+ "top-left" : {top: 0 - height - posoffset, left: 0},
2119
+ "top-right" : {top: 0 - height - posoffset, left: 0 + pos.width - width},
2120
+ "top-center" : {top: 0 - height - posoffset, left: 0 + pos.width / 2 - width / 2},
2121
+ "left-top" : {top: 0, left: 0 - width - posoffset},
2122
+ "left-bottom" : {top: 0 + pos.height - height, left: 0 - width - posoffset},
2123
+ "left-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 - width - posoffset},
2124
+ "right-top" : {top: 0, left: 0 + pos.width + posoffset},
2125
+ "right-bottom" : {top: 0 + pos.height - height, left: 0 + pos.width + posoffset},
2126
+ "right-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 + pos.width + posoffset}
2127
+ },
2128
+ css = {},
2129
+ pp;
2130
+
2131
+ pp = dpos.split('-');
2132
+ css = variants[dpos] ? variants[dpos] : variants['bottom-left'];
2133
+
2134
+ // justify dropdown
2135
+ if (this.justified && this.justified.length) {
2136
+ justify(dropdown.css({left:0}), this.justified, boundarywidth);
2137
+ } else {
2138
+
2139
+ if (this.options.preventflip !== true) {
2140
+
2141
+ var fdpos;
2142
+
2143
+ switch(this.checkBoundary(pos.left + css.left, pos.top + css.top, width, height, boundarywidth)) {
2144
+ case "x":
2145
+ if(this.options.preventflip !=='x') fdpos = flips['x'][dpos] || 'right-top';
2146
+ break;
2147
+ case "y":
2148
+ if(this.options.preventflip !=='y') fdpos = flips['y'][dpos] || 'top-left';
2149
+ break;
2150
+ case "xy":
2151
+ if(!this.options.preventflip) fdpos = flips['xy'][dpos] || 'right-bottom';
2152
+ break;
2153
+ }
2154
+
2155
+ if (fdpos) {
2156
+
2157
+ pp = fdpos.split('-');
2158
+ css = variants[fdpos] ? variants[fdpos] : variants['bottom-left'];
2159
+
2160
+ // check flipped
2161
+ if (this.checkBoundary(pos.left + css.left, pos.top + css.top, width, height, boundarywidth)) {
2162
+ pp = dpos.split('-');
2163
+ css = variants[dpos] ? variants[dpos] : variants['bottom-left'];
2164
+ }
2165
+ }
2166
+ }
2167
+ }
2168
+
2169
+ if (width > boundarywidth) {
2170
+ dropdown.addClass("uk-dropdown-stack");
2171
+ this.trigger('stack.uk.dropdown', [this]);
2172
+ }
2173
+
2174
+ dropdown.css(css).css("display", "").addClass('uk-dropdown-'+pp[0]);
2175
+ },
2176
+
2177
+ checkBoundary: function(left, top, width, height, boundarywidth) {
2178
+
2179
+ var axis = "";
2180
+
2181
+ if (left < 0 || ((left - UI.$win.scrollLeft())+width) > boundarywidth) {
2182
+ axis += "x";
2183
+ }
2184
+
2185
+ if ((top - UI.$win.scrollTop()) < 0 || ((top - UI.$win.scrollTop())+height) > window.innerHeight) {
2186
+ axis += "y";
2187
+ }
2188
+
2189
+ return axis;
2190
+ }
2191
+ });
2192
+
2193
+
2194
+ UI.component('dropdownOverlay', {
2195
+
2196
+ defaults: {
2197
+ 'justify' : false,
2198
+ 'cls' : '',
2199
+ 'duration': 200
2200
+ },
2201
+
2202
+ boot: function() {
2203
+
2204
+ // init code
2205
+ UI.ready(function(context) {
2206
+
2207
+ UI.$("[data-uk-dropdown-overlay]", context).each(function() {
2208
+ var ele = UI.$(this);
2209
+
2210
+ if (!ele.data("dropdownOverlay")) {
2211
+ UI.dropdownOverlay(ele, UI.Utils.options(ele.attr("data-uk-dropdown-overlay")));
2212
+ }
2213
+ });
2214
+ });
2215
+ },
2216
+
2217
+ init: function() {
2218
+
2219
+ var $this = this;
2220
+
2221
+ this.justified = this.options.justify ? UI.$(this.options.justify) : false;
2222
+ this.overlay = this.element.find('uk-dropdown-overlay');
2223
+
2224
+ if (!this.overlay.length) {
2225
+ this.overlay = UI.$('<div class="uk-dropdown-overlay"></div>').appendTo(this.element);
2226
+ }
2227
+
2228
+ this.overlay.addClass(this.options.cls);
2229
+
2230
+ this.on({
2231
+
2232
+ 'beforeshow.uk.dropdown': function(e, dropdown) {
2233
+ $this.dropdown = dropdown;
2234
+
2235
+ if ($this.justified && $this.justified.length) {
2236
+ justify($this.overlay.css({'display':'block', 'margin-left':'','margin-right':''}), $this.justified, $this.justified.outerWidth());
2237
+ }
2238
+ },
2239
+
2240
+ 'show.uk.dropdown': function(e, dropdown) {
2241
+
2242
+ var h = $this.dropdown.dropdown.outerHeight(true);
2243
+
2244
+ $this.dropdown.element.removeClass('uk-open');
2245
+
2246
+ $this.overlay.stop().css('display', 'block').animate({height: h}, $this.options.duration, function() {
2247
+
2248
+ $this.dropdown.dropdown.css('visibility', '');
2249
+ $this.dropdown.element.addClass('uk-open');
2250
+
2251
+ UI.Utils.checkDisplay($this.dropdown.dropdown, true);
2252
+ });
2253
+
2254
+ $this.pointerleave = false;
2255
+ },
2256
+
2257
+ 'hide.uk.dropdown': function() {
2258
+ $this.overlay.stop().animate({height: 0}, $this.options.duration);
2259
+ },
2260
+
2261
+ 'pointerenter.uk.dropdown': function(e, dropdown) {
2262
+ clearTimeout($this.remainIdle);
2263
+ },
2264
+
2265
+ 'pointerleave.uk.dropdown': function(e, dropdown) {
2266
+ $this.pointerleave = true;
2267
+ }
2268
+ });
2269
+
2270
+
2271
+ this.overlay.on({
2272
+
2273
+ 'mouseenter': function() {
2274
+ if ($this.remainIdle) {
2275
+ clearTimeout($this.dropdown.remainIdle);
2276
+ clearTimeout($this.remainIdle);
2277
+ }
2278
+ },
2279
+
2280
+ 'mouseleave': function(){
2281
+
2282
+ if ($this.pointerleave && active) {
2283
+
2284
+ $this.remainIdle = setTimeout(function() {
2285
+ if(active) active.hide();
2286
+ }, active.options.remaintime);
2287
+ }
2288
+ }
2289
+ })
2290
+ }
2291
+
2292
+ });
2293
+
2294
+
2295
+ function justify(ele, justifyTo, boundarywidth, offset) {
2296
+
2297
+ ele = UI.$(ele);
2298
+ justifyTo = UI.$(justifyTo);
2299
+ boundarywidth = boundarywidth || window.innerWidth;
2300
+ offset = offset || ele.offset();
2301
+
2302
+ if (justifyTo.length) {
2303
+
2304
+ var jwidth = justifyTo.outerWidth();
2305
+
2306
+ ele.css("min-width", jwidth);
2307
+
2308
+ if (UI.langdirection == 'right') {
2309
+
2310
+ var right1 = boundarywidth - (justifyTo.offset().left + jwidth),
2311
+ right2 = boundarywidth - (ele.offset().left + ele.outerWidth());
2312
+
2313
+ ele.css("margin-right", right1 - right2);
2314
+
2315
+ } else {
2316
+ ele.css("margin-left", justifyTo.offset().left - offset.left);
2317
+ }
2318
+ }
2319
+ }
2320
+
2321
+ })(UIkit);
2322
+
2323
+ (function(UI) {
2324
+
2325
+ "use strict";
2326
+
2327
+ var grids = [];
2328
+
2329
+ UI.component('gridMatchHeight', {
2330
+
2331
+ defaults: {
2332
+ "target" : false,
2333
+ "row" : true,
2334
+ "ignorestacked" : false
2335
+ },
2336
+
2337
+ boot: function() {
2338
+
2339
+ // init code
2340
+ UI.ready(function(context) {
2341
+
2342
+ UI.$("[data-uk-grid-match]", context).each(function() {
2343
+ var grid = UI.$(this), obj;
2344
+
2345
+ if (!grid.data("gridMatchHeight")) {
2346
+ obj = UI.gridMatchHeight(grid, UI.Utils.options(grid.attr("data-uk-grid-match")));
2347
+ }
2348
+ });
2349
+ });
2350
+ },
2351
+
2352
+ init: function() {
2353
+
2354
+ var $this = this;
2355
+
2356
+ this.columns = this.element.children();
2357
+ this.elements = this.options.target ? this.find(this.options.target) : this.columns;
2358
+
2359
+ if (!this.columns.length) return;
2360
+
2361
+ UI.$win.on('load resize orientationchange', (function() {
2362
+
2363
+ var fn = function() {
2364
+ $this.match();
2365
+ };
2366
+
2367
+ UI.$(function() { fn(); });
2368
+
2369
+ return UI.Utils.debounce(fn, 50);
2370
+ })());
2371
+
2372
+ UI.$html.on("changed.uk.dom", function(e) {
2373
+ $this.columns = $this.element.children();
2374
+ $this.elements = $this.options.target ? $this.find($this.options.target) : $this.columns;
2375
+ $this.match();
2376
+ });
2377
+
2378
+ this.on("display.uk.check", function(e) {
2379
+ if(this.element.is(":visible")) this.match();
2380
+ }.bind(this));
2381
+
2382
+ grids.push(this);
2383
+ },
2384
+
2385
+ match: function() {
2386
+
2387
+ var firstvisible = this.columns.filter(":visible:first");
2388
+
2389
+ if (!firstvisible.length) return;
2390
+
2391
+ var stacked = Math.ceil(100 * parseFloat(firstvisible.css('width')) / parseFloat(firstvisible.parent().css('width'))) >= 100;
2392
+
2393
+ if (stacked && !this.options.ignorestacked) {
2394
+ this.revert();
2395
+ } else {
2396
+ UI.Utils.matchHeights(this.elements, this.options);
2397
+ }
2398
+
2399
+ return this;
2400
+ },
2401
+
2402
+ revert: function() {
2403
+ this.elements.css('min-height', '');
2404
+ return this;
2405
+ }
2406
+ });
2407
+
2408
+ UI.component('gridMargin', {
2409
+
2410
+ defaults: {
2411
+ "cls": "uk-grid-margin"
2412
+ },
2413
+
2414
+ boot: function() {
2415
+
2416
+ // init code
2417
+ UI.ready(function(context) {
2418
+
2419
+ UI.$("[data-uk-grid-margin]", context).each(function() {
2420
+ var grid = UI.$(this), obj;
2421
+
2422
+ if (!grid.data("gridMargin")) {
2423
+ obj = UI.gridMargin(grid, UI.Utils.options(grid.attr("data-uk-grid-margin")));
2424
+ }
2425
+ });
2426
+ });
2427
+ },
2428
+
2429
+ init: function() {
2430
+
2431
+ var stackMargin = UI.stackMargin(this.element, this.options);
2432
+ }
2433
+ });
2434
+
2435
+ })(UIkit);
2436
+
2437
+ (function(UI) {
2438
+
2439
+ "use strict";
2440
+
2441
+ var active = false, activeCount = 0, $html = UI.$html, body;
2442
+
2443
+ UI.component('modal', {
2444
+
2445
+ defaults: {
2446
+ keyboard: true,
2447
+ bgclose: true,
2448
+ minScrollHeight: 150,
2449
+ center: false,
2450
+ modal: true
2451
+ },
2452
+
2453
+ scrollable: false,
2454
+ transition: false,
2455
+ hasTransitioned: true,
2456
+
2457
+ init: function() {
2458
+
2459
+ if (!body) body = UI.$('body');
2460
+
2461
+ if (!this.element.length) return;
2462
+
2463
+ var $this = this;
2464
+
2465
+ this.paddingdir = "padding-" + (UI.langdirection == 'left' ? "right":"left");
2466
+ this.dialog = this.find(".uk-modal-dialog");
2467
+
2468
+ this.active = false;
2469
+
2470
+ // Update ARIA
2471
+ this.element.attr('aria-hidden', this.element.hasClass("uk-open"));
2472
+
2473
+ this.on("click", ".uk-modal-close", function(e) {
2474
+ e.preventDefault();
2475
+ $this.hide();
2476
+ }).on("click", function(e) {
2477
+
2478
+ var target = UI.$(e.target);
2479
+
2480
+ if (target[0] == $this.element[0] && $this.options.bgclose) {
2481
+ $this.hide();
2482
+ }
2483
+ });
2484
+ },
2485
+
2486
+ toggle: function() {
2487
+ return this[this.isActive() ? "hide" : "show"]();
2488
+ },
2489
+
2490
+ show: function() {
2491
+
2492
+ if (!this.element.length) return;
2493
+
2494
+ var $this = this;
2495
+
2496
+ if (this.isActive()) return;
2497
+
2498
+ if (this.options.modal && active) {
2499
+ active.hide(true);
2500
+ }
2501
+
2502
+ this.element.removeClass("uk-open").show();
2503
+ this.resize();
2504
+
2505
+ if (this.options.modal) {
2506
+ active = this;
2507
+ }
2508
+
2509
+ this.active = true;
2510
+
2511
+ activeCount++;
2512
+
2513
+ if (UI.support.transition) {
2514
+ this.hasTransitioned = false;
2515
+ this.element.one(UI.support.transition.end, function(){
2516
+ $this.hasTransitioned = true;
2517
+ }).addClass("uk-open");
2518
+ } else {
2519
+ this.element.addClass("uk-open");
2520
+ }
2521
+
2522
+ $html.addClass("uk-modal-page").height(); // force browser engine redraw
2523
+
2524
+ // Update ARIA
2525
+ this.element.attr('aria-hidden', 'false');
2526
+
2527
+ this.element.trigger("show.uk.modal");
2528
+
2529
+ UI.Utils.checkDisplay(this.dialog, true);
2530
+
2531
+ return this;
2532
+ },
2533
+
2534
+ hide: function(force) {
2535
+
2536
+ if (!force && UI.support.transition && this.hasTransitioned) {
2537
+
2538
+ var $this = this;
2539
+
2540
+ this.one(UI.support.transition.end, function() {
2541
+ $this._hide();
2542
+ }).removeClass("uk-open");
2543
+
2544
+ } else {
2545
+
2546
+ this._hide();
2547
+ }
2548
+
2549
+ return this;
2550
+ },
2551
+
2552
+ resize: function() {
2553
+
2554
+ var bodywidth = body.width();
2555
+
2556
+ this.scrollbarwidth = window.innerWidth - bodywidth;
2557
+
2558
+ body.css(this.paddingdir, this.scrollbarwidth);
2559
+
2560
+ this.element.css('overflow-y', this.scrollbarwidth ? 'scroll' : 'auto');
2561
+
2562
+ if (!this.updateScrollable() && this.options.center) {
2563
+
2564
+ var dh = this.dialog.outerHeight(),
2565
+ pad = parseInt(this.dialog.css('margin-top'), 10) + parseInt(this.dialog.css('margin-bottom'), 10);
2566
+
2567
+ if ((dh + pad) < window.innerHeight) {
2568
+ this.dialog.css({'top': (window.innerHeight/2 - dh/2) - pad });
2569
+ } else {
2570
+ this.dialog.css({'top': ''});
2571
+ }
2572
+ }
2573
+ },
2574
+
2575
+ updateScrollable: function() {
2576
+
2577
+ // has scrollable?
2578
+ var scrollable = this.dialog.find('.uk-overflow-container:visible:first');
2579
+
2580
+ if (scrollable.length) {
2581
+
2582
+ scrollable.css('height', 0);
2583
+
2584
+ var offset = Math.abs(parseInt(this.dialog.css('margin-top'), 10)),
2585
+ dh = this.dialog.outerHeight(),
2586
+ wh = window.innerHeight,
2587
+ h = wh - 2*(offset < 20 ? 20:offset) - dh;
2588
+
2589
+ scrollable.css({
2590
+ 'max-height': (h < this.options.minScrollHeight ? '':h),
2591
+ 'height':''
2592
+ });
2593
+
2594
+ return true;
2595
+ }
2596
+
2597
+ return false;
2598
+ },
2599
+
2600
+ _hide: function() {
2601
+
2602
+ this.active = false;
2603
+ if (activeCount > 0) activeCount--;
2604
+ else activeCount = 0;
2605
+
2606
+ this.element.hide().removeClass('uk-open');
2607
+
2608
+ // Update ARIA
2609
+ this.element.attr('aria-hidden', 'true');
2610
+
2611
+ if (!activeCount) {
2612
+ $html.removeClass('uk-modal-page');
2613
+ body.css(this.paddingdir, "");
2614
+ }
2615
+
2616
+ if(active===this) active = false;
2617
+
2618
+ this.trigger('hide.uk.modal');
2619
+ },
2620
+
2621
+ isActive: function() {
2622
+ return this.active;
2623
+ }
2624
+
2625
+ });
2626
+
2627
+ UI.component('modalTrigger', {
2628
+
2629
+ boot: function() {
2630
+
2631
+ // init code
2632
+ UI.$html.on("click.modal.uikit", "[data-uk-modal]", function(e) {
2633
+
2634
+ var ele = UI.$(this);
2635
+
2636
+ if (ele.is("a")) {
2637
+ e.preventDefault();
2638
+ }
2639
+
2640
+ if (!ele.data("modalTrigger")) {
2641
+ var modal = UI.modalTrigger(ele, UI.Utils.options(ele.attr("data-uk-modal")));
2642
+ modal.show();
2643
+ }
2644
+
2645
+ });
2646
+
2647
+ // close modal on esc button
2648
+ UI.$html.on('keydown.modal.uikit', function (e) {
2649
+
2650
+ if (active && e.keyCode === 27 && active.options.keyboard) { // ESC
2651
+ e.preventDefault();
2652
+ active.hide();
2653
+ }
2654
+ });
2655
+
2656
+ UI.$win.on("resize orientationchange", UI.Utils.debounce(function(){
2657
+ if (active) active.resize();
2658
+ }, 150));
2659
+ },
2660
+
2661
+ init: function() {
2662
+
2663
+ var $this = this;
2664
+
2665
+ this.options = UI.$.extend({
2666
+ "target": $this.element.is("a") ? $this.element.attr("href") : false
2667
+ }, this.options);
2668
+
2669
+ this.modal = UI.modal(this.options.target, this.options);
2670
+
2671
+ this.on("click", function(e) {
2672
+ e.preventDefault();
2673
+ $this.show();
2674
+ });
2675
+
2676
+ //methods
2677
+ this.proxy(this.modal, "show hide isActive");
2678
+ }
2679
+ });
2680
+
2681
+ UI.modal.dialog = function(content, options) {
2682
+
2683
+ var modal = UI.modal(UI.$(UI.modal.dialog.template).appendTo("body"), options);
2684
+
2685
+ modal.on("hide.uk.modal", function(){
2686
+ if (modal.persist) {
2687
+ modal.persist.appendTo(modal.persist.data("modalPersistParent"));
2688
+ modal.persist = false;
2689
+ }
2690
+ modal.element.remove();
2691
+ });
2692
+
2693
+ setContent(content, modal);
2694
+
2695
+ return modal;
2696
+ };
2697
+
2698
+ UI.modal.dialog.template = '<div class="uk-modal"><div class="uk-modal-dialog" style="min-height:0;"></div></div>';
2699
+
2700
+ UI.modal.alert = function(content, options) {
2701
+
2702
+ options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options);
2703
+
2704
+ var modal = UI.modal.dialog(([
2705
+ '<div class="uk-margin uk-modal-content">'+String(content)+'</div>',
2706
+ '<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-button-primary uk-modal-close">'+options.labels.Ok+'</button></div>'
2707
+ ]).join(""), options);
2708
+
2709
+ modal.on('show.uk.modal', function(){
2710
+ setTimeout(function(){
2711
+ modal.element.find('button:first').focus();
2712
+ }, 50);
2713
+ });
2714
+
2715
+ return modal.show();
2716
+ };
2717
+
2718
+ UI.modal.confirm = function(content, onconfirm, options) {
2719
+
2720
+ onconfirm = UI.$.isFunction(onconfirm) ? onconfirm : function(){};
2721
+ options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options);
2722
+
2723
+ var modal = UI.modal.dialog(([
2724
+ '<div class="uk-margin uk-modal-content">'+String(content)+'</div>',
2725
+ '<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-modal-close">'+options.labels.Cancel+'</button> <button class="uk-button uk-button-primary js-modal-confirm">'+options.labels.Ok+'</button></div>'
2726
+ ]).join(""), options);
2727
+
2728
+ modal.element.find(".js-modal-confirm").on("click", function(){
2729
+ onconfirm();
2730
+ modal.hide();
2731
+ });
2732
+
2733
+ modal.on('show.uk.modal', function(){
2734
+ setTimeout(function(){
2735
+ modal.element.find('.js-modal-confirm').focus();
2736
+ }, 50);
2737
+ });
2738
+
2739
+ return modal.show();
2740
+ };
2741
+
2742
+ UI.modal.prompt = function(text, value, onsubmit, options) {
2743
+
2744
+ onsubmit = UI.$.isFunction(onsubmit) ? onsubmit : function(value){};
2745
+ options = UI.$.extend(true, {bgclose:false, keyboard:false, modal:false, labels:UI.modal.labels}, options);
2746
+
2747
+ var modal = UI.modal.dialog(([
2748
+ text ? '<div class="uk-modal-content uk-form">'+String(text)+'</div>':'',
2749
+ '<div class="uk-margin-small-top uk-modal-content uk-form"><p><input type="text" class="uk-width-1-1"></p></div>',
2750
+ '<div class="uk-modal-footer uk-text-right"><button class="uk-button uk-modal-close">'+options.labels.Cancel+'</button> <button class="uk-button uk-button-primary js-modal-ok">'+options.labels.Ok+'</button></div>'
2751
+ ]).join(""), options),
2752
+
2753
+ input = modal.element.find("input[type='text']").val(value || '').on('keyup', function(e){
2754
+ if (e.keyCode == 13) {
2755
+ modal.element.find(".js-modal-ok").trigger('click');
2756
+ }
2757
+ });
2758
+
2759
+ modal.element.find(".js-modal-ok").on("click", function(){
2760
+ if (onsubmit(input.val())!==false){
2761
+ modal.hide();
2762
+ }
2763
+ });
2764
+
2765
+ modal.on('show.uk.modal', function(){
2766
+ setTimeout(function(){
2767
+ input.focus();
2768
+ }, 50);
2769
+ });
2770
+
2771
+ return modal.show();
2772
+ };
2773
+
2774
+ UI.modal.blockUI = function(content, options) {
2775
+
2776
+ var modal = UI.modal.dialog(([
2777
+ '<div class="uk-margin uk-modal-content">'+String(content || '<div class="uk-text-center">...</div>')+'</div>'
2778
+ ]).join(""), UI.$.extend({bgclose:false, keyboard:false, modal:false}, options));
2779
+
2780
+ modal.content = modal.element.find('.uk-modal-content:first');
2781
+
2782
+ return modal.show();
2783
+ };
2784
+
2785
+
2786
+ UI.modal.labels = {
2787
+ 'Ok': 'Ok',
2788
+ 'Cancel': 'Cancel'
2789
+ };
2790
+
2791
+
2792
+ // helper functions
2793
+ function setContent(content, modal){
2794
+
2795
+ if(!modal) return;
2796
+
2797
+ if (typeof content === 'object') {
2798
+
2799
+ // convert DOM object to a jQuery object
2800
+ content = content instanceof jQuery ? content : UI.$(content);
2801
+
2802
+ if(content.parent().length) {
2803
+ modal.persist = content;
2804
+ modal.persist.data("modalPersistParent", content.parent());
2805
+ }
2806
+ }else if (typeof content === 'string' || typeof content === 'number') {
2807
+ // just insert the data as innerHTML
2808
+ content = UI.$('<div></div>').html(content);
2809
+ }else {
2810
+ // unsupported data type!
2811
+ content = UI.$('<div></div>').html('UIkit.modal Error: Unsupported data type: ' + typeof content);
2812
+ }
2813
+
2814
+ content.appendTo(modal.element.find('.uk-modal-dialog'));
2815
+
2816
+ return modal;
2817
+ }
2818
+
2819
+ })(UIkit);
2820
+
2821
+ (function(UI) {
2822
+
2823
+ "use strict";
2824
+
2825
+ UI.component('nav', {
2826
+
2827
+ defaults: {
2828
+ "toggle": ">li.uk-parent > a[href='#']",
2829
+ "lists": ">li.uk-parent > ul",
2830
+ "multiple": false
2831
+ },
2832
+
2833
+ boot: function() {
2834
+
2835
+ // init code
2836
+ UI.ready(function(context) {
2837
+
2838
+ UI.$("[data-uk-nav]", context).each(function() {
2839
+ var nav = UI.$(this);
2840
+
2841
+ if (!nav.data("nav")) {
2842
+ var obj = UI.nav(nav, UI.Utils.options(nav.attr("data-uk-nav")));
2843
+ }
2844
+ });
2845
+ });
2846
+ },
2847
+
2848
+ init: function() {
2849
+
2850
+ var $this = this;
2851
+
2852
+ this.on("click.uikit.nav", this.options.toggle, function(e) {
2853
+ e.preventDefault();
2854
+ var ele = UI.$(this);
2855
+ $this.open(ele.parent()[0] == $this.element[0] ? ele : ele.parent("li"));
2856
+ });
2857
+
2858
+ this.find(this.options.lists).each(function() {
2859
+ var $ele = UI.$(this),
2860
+ parent = $ele.parent(),
2861
+ active = parent.hasClass("uk-active");
2862
+
2863
+ $ele.wrap('<div style="overflow:hidden;height:0;position:relative;"></div>');
2864
+ parent.data("list-container", $ele.parent()[active ? 'removeClass':'addClass']('uk-hidden'));
2865
+
2866
+ // Init ARIA
2867
+ parent.attr('aria-expanded', parent.hasClass("uk-open"));
2868
+
2869
+ if (active) $this.open(parent, true);
2870
+ });
2871
+
2872
+ },
2873
+
2874
+ open: function(li, noanimation) {
2875
+
2876
+ var $this = this, element = this.element, $li = UI.$(li), $container = $li.data('list-container');
2877
+
2878
+ if (!this.options.multiple) {
2879
+
2880
+ element.children('.uk-open').not(li).each(function() {
2881
+
2882
+ var ele = UI.$(this);
2883
+
2884
+ if (ele.data('list-container')) {
2885
+ ele.data('list-container').stop().animate({height: 0}, function() {
2886
+ UI.$(this).parent().removeClass('uk-open').end().addClass('uk-hidden');
2887
+ });
2888
+ }
2889
+ });
2890
+ }
2891
+
2892
+ $li.toggleClass('uk-open');
2893
+
2894
+ // Update ARIA
2895
+ $li.attr('aria-expanded', $li.hasClass('uk-open'));
2896
+
2897
+ if ($container) {
2898
+
2899
+ if ($li.hasClass('uk-open')) {
2900
+ $container.removeClass('uk-hidden');
2901
+ }
2902
+
2903
+ if (noanimation) {
2904
+
2905
+ $container.stop().height($li.hasClass('uk-open') ? 'auto' : 0);
2906
+
2907
+ if (!$li.hasClass('uk-open')) {
2908
+ $container.addClass('uk-hidden');
2909
+ }
2910
+
2911
+ this.trigger('display.uk.check');
2912
+
2913
+ } else {
2914
+
2915
+ $container.stop().animate({
2916
+ height: ($li.hasClass('uk-open') ? getHeight($container.find('ul:first')) : 0)
2917
+ }, function() {
2918
+
2919
+ if (!$li.hasClass('uk-open')) {
2920
+ $container.addClass('uk-hidden');
2921
+ } else {
2922
+ $container.css('height', '');
2923
+ }
2924
+
2925
+ $this.trigger('display.uk.check');
2926
+ });
2927
+ }
2928
+ }
2929
+ }
2930
+ });
2931
+
2932
+
2933
+ // helper
2934
+
2935
+ function getHeight(ele) {
2936
+ var $ele = UI.$(ele), height = "auto";
2937
+
2938
+ if ($ele.is(":visible")) {
2939
+ height = $ele.outerHeight();
2940
+ } else {
2941
+ var tmp = {
2942
+ position: $ele.css("position"),
2943
+ visibility: $ele.css("visibility"),
2944
+ display: $ele.css("display")
2945
+ };
2946
+
2947
+ height = $ele.css({position: 'absolute', visibility: 'hidden', display: 'block'}).outerHeight();
2948
+
2949
+ $ele.css(tmp); // reset element
2950
+ }
2951
+
2952
+ return height;
2953
+ }
2954
+
2955
+ })(UIkit);
2956
+
2957
+ (function(UI) {
2958
+
2959
+ "use strict";
2960
+
2961
+ var scrollpos = {x: window.scrollX, y: window.scrollY},
2962
+ $win = UI.$win,
2963
+ $doc = UI.$doc,
2964
+ $html = UI.$html,
2965
+ Offcanvas = {
2966
+
2967
+ show: function(element) {
2968
+
2969
+ element = UI.$(element);
2970
+
2971
+ if (!element.length) return;
2972
+
2973
+ var $body = UI.$('body'),
2974
+ bar = element.find(".uk-offcanvas-bar:first"),
2975
+ rtl = (UI.langdirection == "right"),
2976
+ flip = bar.hasClass("uk-offcanvas-bar-flip") ? -1:1,
2977
+ dir = flip * (rtl ? -1 : 1),
2978
+
2979
+ scrollbarwidth = window.innerWidth - $body.width();
2980
+
2981
+ scrollpos = {x: window.pageXOffset, y: window.pageYOffset};
2982
+
2983
+ element.addClass("uk-active");
2984
+
2985
+ $body.css({"width": window.innerWidth - scrollbarwidth, "height": window.innerHeight}).addClass("uk-offcanvas-page");
2986
+ $body.css((rtl ? "margin-right" : "margin-left"), (rtl ? -1 : 1) * (bar.outerWidth() * dir)).width(); // .width() - force redraw
2987
+
2988
+ $html.css('margin-top', scrollpos.y * -1);
2989
+
2990
+ bar.addClass("uk-offcanvas-bar-show");
2991
+
2992
+ this._initElement(element);
2993
+
2994
+ bar.trigger('show.uk.offcanvas', [element, bar]);
2995
+
2996
+ // Update ARIA
2997
+ element.attr('aria-hidden', 'false');
2998
+ },
2999
+
3000
+ hide: function(force) {
3001
+
3002
+ var $body = UI.$('body'),
3003
+ panel = UI.$(".uk-offcanvas.uk-active"),
3004
+ rtl = (UI.langdirection == "right"),
3005
+ bar = panel.find(".uk-offcanvas-bar:first"),
3006
+ finalize = function() {
3007
+ $body.removeClass("uk-offcanvas-page").css({"width": "", "height": "", "margin-left": "", "margin-right": ""});
3008
+ panel.removeClass("uk-active");
3009
+
3010
+ bar.removeClass("uk-offcanvas-bar-show");
3011
+ $html.css('margin-top', '');
3012
+ window.scrollTo(scrollpos.x, scrollpos.y);
3013
+ bar.trigger('hide.uk.offcanvas', [panel, bar]);
3014
+
3015
+ // Update ARIA
3016
+ panel.attr('aria-hidden', 'true');
3017
+ };
3018
+
3019
+ if (!panel.length) return;
3020
+
3021
+ if (UI.support.transition && !force) {
3022
+
3023
+ $body.one(UI.support.transition.end, function() {
3024
+ finalize();
3025
+ }).css((rtl ? "margin-right" : "margin-left"), "");
3026
+
3027
+ setTimeout(function(){
3028
+ bar.removeClass("uk-offcanvas-bar-show");
3029
+ }, 0);
3030
+
3031
+ } else {
3032
+ finalize();
3033
+ }
3034
+ },
3035
+
3036
+ _initElement: function(element) {
3037
+
3038
+ if (element.data("OffcanvasInit")) return;
3039
+
3040
+ element.on("click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas", function(e) {
3041
+
3042
+ var target = UI.$(e.target);
3043
+
3044
+ if (!e.type.match(/swipe/)) {
3045
+
3046
+ if (!target.hasClass("uk-offcanvas-close")) {
3047
+ if (target.hasClass("uk-offcanvas-bar")) return;
3048
+ if (target.parents(".uk-offcanvas-bar:first").length) return;
3049
+ }
3050
+ }
3051
+
3052
+ e.stopImmediatePropagation();
3053
+ Offcanvas.hide();
3054
+ });
3055
+
3056
+ element.on("click", "a[href^='#']", function(e){
3057
+
3058
+ var link = UI.$(this),
3059
+ href = link.attr("href");
3060
+
3061
+ if (href == "#") {
3062
+ return;
3063
+ }
3064
+
3065
+ UI.$doc.one('hide.uk.offcanvas', function() {
3066
+
3067
+ var target;
3068
+
3069
+ try {
3070
+ target = UI.$(href);
3071
+ } catch (e){
3072
+ target = "";
3073
+ }
3074
+
3075
+ if (!target.length) {
3076
+ target = UI.$('[name="'+href.replace('#','')+'"]');
3077
+ }
3078
+
3079
+ if (target.length && link.attr('data-uk-smooth-scroll') && UI.Utils.scrollToElement) {
3080
+ UI.Utils.scrollToElement(target, UI.Utils.options(link.attr('data-uk-smooth-scroll') || '{}'));
3081
+ } else {
3082
+ window.location.href = href;
3083
+ }
3084
+ });
3085
+
3086
+ Offcanvas.hide();
3087
+ });
3088
+
3089
+ element.data("OffcanvasInit", true);
3090
+ }
3091
+ };
3092
+
3093
+ UI.component('offcanvasTrigger', {
3094
+
3095
+ boot: function() {
3096
+
3097
+ // init code
3098
+ $html.on("click.offcanvas.uikit", "[data-uk-offcanvas]", function(e) {
3099
+
3100
+ e.preventDefault();
3101
+
3102
+ var ele = UI.$(this);
3103
+
3104
+ if (!ele.data("offcanvasTrigger")) {
3105
+ var obj = UI.offcanvasTrigger(ele, UI.Utils.options(ele.attr("data-uk-offcanvas")));
3106
+ ele.trigger("click");
3107
+ }
3108
+ });
3109
+
3110
+ $html.on('keydown.uk.offcanvas', function(e) {
3111
+
3112
+ if (e.keyCode === 27) { // ESC
3113
+ Offcanvas.hide();
3114
+ }
3115
+ });
3116
+ },
3117
+
3118
+ init: function() {
3119
+
3120
+ var $this = this;
3121
+
3122
+ this.options = UI.$.extend({
3123
+ "target": $this.element.is("a") ? $this.element.attr("href") : false
3124
+ }, this.options);
3125
+
3126
+ this.on("click", function(e) {
3127
+ e.preventDefault();
3128
+ Offcanvas.show($this.options.target);
3129
+ });
3130
+ }
3131
+ });
3132
+
3133
+ UI.offcanvas = Offcanvas;
3134
+
3135
+ })(UIkit);
3136
+
3137
+ (function(UI) {
3138
+
3139
+ "use strict";
3140
+
3141
+ var Animations;
3142
+
3143
+ UI.component('switcher', {
3144
+
3145
+ defaults: {
3146
+ connect : false,
3147
+ toggle : ">*",
3148
+ active : 0,
3149
+ animation : false,
3150
+ duration : 200,
3151
+ swiping : true
3152
+ },
3153
+
3154
+ animating: false,
3155
+
3156
+ boot: function() {
3157
+
3158
+ // init code
3159
+ UI.ready(function(context) {
3160
+
3161
+ UI.$("[data-uk-switcher]", context).each(function() {
3162
+ var switcher = UI.$(this);
3163
+
3164
+ if (!switcher.data("switcher")) {
3165
+ var obj = UI.switcher(switcher, UI.Utils.options(switcher.attr("data-uk-switcher")));
3166
+ }
3167
+ });
3168
+ });
3169
+ },
3170
+
3171
+ init: function() {
3172
+
3173
+ var $this = this;
3174
+
3175
+ this.on("click.uikit.switcher", this.options.toggle, function(e) {
3176
+ e.preventDefault();
3177
+ $this.show(this);
3178
+ });
3179
+
3180
+ if (this.options.connect) {
3181
+
3182
+ this.connect = UI.$(this.options.connect);
3183
+
3184
+ this.connect.find(".uk-active").removeClass(".uk-active");
3185
+
3186
+ // delegate switch commands within container content
3187
+ if (this.connect.length) {
3188
+
3189
+ // Init ARIA for connect
3190
+ this.connect.children().attr('aria-hidden', 'true');
3191
+
3192
+ this.connect.on("click", '[data-uk-switcher-item]', function(e) {
3193
+
3194
+ e.preventDefault();
3195
+
3196
+ var item = UI.$(this).attr('data-uk-switcher-item');
3197
+
3198
+ if ($this.index == item) return;
3199
+
3200
+ switch(item) {
3201
+ case 'next':
3202
+ case 'previous':
3203
+ $this.show($this.index + (item=='next' ? 1:-1));
3204
+ break;
3205
+ default:
3206
+ $this.show(parseInt(item, 10));
3207
+ }
3208
+ });
3209
+
3210
+ if (this.options.swiping) {
3211
+
3212
+ this.connect.on('swipeRight swipeLeft', function(e) {
3213
+ e.preventDefault();
3214
+ if(!window.getSelection().toString()) {
3215
+ $this.show($this.index + (e.type == 'swipeLeft' ? 1 : -1));
3216
+ }
3217
+ });
3218
+ }
3219
+ }
3220
+
3221
+ var toggles = this.find(this.options.toggle),
3222
+ active = toggles.filter(".uk-active");
3223
+
3224
+ if (active.length) {
3225
+ this.show(active, false);
3226
+ } else {
3227
+
3228
+ if (this.options.active===false) return;
3229
+
3230
+ active = toggles.eq(this.options.active);
3231
+ this.show(active.length ? active : toggles.eq(0), false);
3232
+ }
3233
+
3234
+ // Init ARIA for toggles
3235
+ toggles.not(active).attr('aria-expanded', 'false');
3236
+ active.attr('aria-expanded', 'true');
3237
+
3238
+ this.on('changed.uk.dom', function() {
3239
+ $this.connect = UI.$($this.options.connect);
3240
+ });
3241
+ }
3242
+
3243
+ },
3244
+
3245
+ show: function(tab, animate) {
3246
+
3247
+ if (this.animating) {
3248
+ return;
3249
+ }
3250
+
3251
+ if (isNaN(tab)) {
3252
+ tab = UI.$(tab);
3253
+ } else {
3254
+
3255
+ var toggles = this.find(this.options.toggle);
3256
+
3257
+ tab = tab < 0 ? toggles.length-1 : tab;
3258
+ tab = toggles.eq(toggles[tab] ? tab : 0);
3259
+ }
3260
+
3261
+ var $this = this,
3262
+ toggles = this.find(this.options.toggle),
3263
+ active = UI.$(tab),
3264
+ animation = Animations[this.options.animation] || function(current, next) {
3265
+
3266
+ if (!$this.options.animation) {
3267
+ return Animations.none.apply($this);
3268
+ }
3269
+
3270
+ var anim = $this.options.animation.split(',');
3271
+
3272
+ if (anim.length == 1) {
3273
+ anim[1] = anim[0];
3274
+ }
3275
+
3276
+ anim[0] = anim[0].trim();
3277
+ anim[1] = anim[1].trim();
3278
+
3279
+ return coreAnimation.apply($this, [anim, current, next]);
3280
+ };
3281
+
3282
+ if (animate===false || !UI.support.animation) {
3283
+ animation = Animations.none;
3284
+ }
3285
+
3286
+ if (active.hasClass("uk-disabled")) return;
3287
+
3288
+ // Update ARIA for Toggles
3289
+ toggles.attr('aria-expanded', 'false');
3290
+ active.attr('aria-expanded', 'true');
3291
+
3292
+ toggles.filter(".uk-active").removeClass("uk-active");
3293
+ active.addClass("uk-active");
3294
+
3295
+ if (this.options.connect && this.connect.length) {
3296
+
3297
+ this.index = this.find(this.options.toggle).index(active);
3298
+
3299
+ if (this.index == -1 ) {
3300
+ this.index = 0;
3301
+ }
3302
+
3303
+ this.connect.each(function() {
3304
+
3305
+ var container = UI.$(this),
3306
+ children = UI.$(container.children()),
3307
+ current = UI.$(children.filter('.uk-active')),
3308
+ next = UI.$(children.eq($this.index));
3309
+
3310
+ $this.animating = true;
3311
+
3312
+ animation.apply($this, [current, next]).then(function(){
3313
+
3314
+ current.removeClass("uk-active");
3315
+ next.addClass("uk-active");
3316
+
3317
+ // Update ARIA for connect
3318
+ current.attr('aria-hidden', 'true');
3319
+ next.attr('aria-hidden', 'false');
3320
+
3321
+ UI.Utils.checkDisplay(next, true);
3322
+
3323
+ $this.animating = false;
3324
+
3325
+ });
3326
+ });
3327
+ }
3328
+
3329
+ this.trigger("show.uk.switcher", [active]);
3330
+ }
3331
+ });
3332
+
3333
+ Animations = {
3334
+
3335
+ 'none': function() {
3336
+ var d = UI.$.Deferred();
3337
+ d.resolve();
3338
+ return d.promise();
3339
+ },
3340
+
3341
+ 'fade': function(current, next) {
3342
+ return coreAnimation.apply(this, ['uk-animation-fade', current, next]);
3343
+ },
3344
+
3345
+ 'slide-bottom': function(current, next) {
3346
+ return coreAnimation.apply(this, ['uk-animation-slide-bottom', current, next]);
3347
+ },
3348
+
3349
+ 'slide-top': function(current, next) {
3350
+ return coreAnimation.apply(this, ['uk-animation-slide-top', current, next]);
3351
+ },
3352
+
3353
+ 'slide-vertical': function(current, next, dir) {
3354
+
3355
+ var anim = ['uk-animation-slide-top', 'uk-animation-slide-bottom'];
3356
+
3357
+ if (current && current.index() > next.index()) {
3358
+ anim.reverse();
3359
+ }
3360
+
3361
+ return coreAnimation.apply(this, [anim, current, next]);
3362
+ },
3363
+
3364
+ 'slide-left': function(current, next) {
3365
+ return coreAnimation.apply(this, ['uk-animation-slide-left', current, next]);
3366
+ },
3367
+
3368
+ 'slide-right': function(current, next) {
3369
+ return coreAnimation.apply(this, ['uk-animation-slide-right', current, next]);
3370
+ },
3371
+
3372
+ 'slide-horizontal': function(current, next, dir) {
3373
+
3374
+ var anim = ['uk-animation-slide-right', 'uk-animation-slide-left'];
3375
+
3376
+ if (current && current.index() > next.index()) {
3377
+ anim.reverse();
3378
+ }
3379
+
3380
+ return coreAnimation.apply(this, [anim, current, next]);
3381
+ },
3382
+
3383
+ 'scale': function(current, next) {
3384
+ return coreAnimation.apply(this, ['uk-animation-scale-up', current, next]);
3385
+ }
3386
+ };
3387
+
3388
+ UI.switcher.animations = Animations;
3389
+
3390
+
3391
+ // helpers
3392
+
3393
+ function coreAnimation(cls, current, next) {
3394
+
3395
+ var d = UI.$.Deferred(), clsIn = cls, clsOut = cls, release;
3396
+
3397
+ if (next[0]===current[0]) {
3398
+ d.resolve();
3399
+ return d.promise();
3400
+ }
3401
+
3402
+ if (typeof(cls) == 'object') {
3403
+ clsIn = cls[0];
3404
+ clsOut = cls[1] || cls[0];
3405
+ }
3406
+
3407
+ UI.$body.css('overflow-x', 'hidden'); // fix scroll jumping in iOS
3408
+
3409
+ release = function() {
3410
+
3411
+ if (current) current.hide().removeClass('uk-active '+clsOut+' uk-animation-reverse');
3412
+
3413
+ next.addClass(clsIn).one(UI.support.animation.end, function() {
3414
+
3415
+ next.removeClass(''+clsIn+'').css({opacity:'', display:''});
3416
+
3417
+ d.resolve();
3418
+
3419
+ UI.$body.css('overflow-x', '');
3420
+
3421
+ if (current) current.css({opacity:'', display:''});
3422
+
3423
+ }.bind(this)).show();
3424
+ };
3425
+
3426
+ next.css('animation-duration', this.options.duration+'ms');
3427
+
3428
+ if (current && current.length) {
3429
+
3430
+ current.css('animation-duration', this.options.duration+'ms');
3431
+
3432
+ current.css('display', 'none').addClass(clsOut+' uk-animation-reverse').one(UI.support.animation.end, function() {
3433
+ release();
3434
+ }.bind(this)).css('display', '');
3435
+
3436
+ } else {
3437
+ next.addClass('uk-active');
3438
+ release();
3439
+ }
3440
+
3441
+ return d.promise();
3442
+ }
3443
+
3444
+ })(UIkit);
3445
+
3446
+ (function(UI) {
3447
+
3448
+ "use strict";
3449
+
3450
+ UI.component('tab', {
3451
+
3452
+ defaults: {
3453
+ 'target' : '>li:not(.uk-tab-responsive, .uk-disabled)',
3454
+ 'connect' : false,
3455
+ 'active' : 0,
3456
+ 'animation' : false,
3457
+ 'duration' : 200,
3458
+ 'swiping' : true
3459
+ },
3460
+
3461
+ boot: function() {
3462
+
3463
+ // init code
3464
+ UI.ready(function(context) {
3465
+
3466
+ UI.$("[data-uk-tab]", context).each(function() {
3467
+
3468
+ var tab = UI.$(this);
3469
+
3470
+ if (!tab.data("tab")) {
3471
+ var obj = UI.tab(tab, UI.Utils.options(tab.attr("data-uk-tab")));
3472
+ }
3473
+ });
3474
+ });
3475
+ },
3476
+
3477
+ init: function() {
3478
+
3479
+ var $this = this;
3480
+
3481
+ this.current = false;
3482
+
3483
+ this.on("click.uikit.tab", this.options.target, function(e) {
3484
+
3485
+ e.preventDefault();
3486
+
3487
+ if ($this.switcher && $this.switcher.animating) {
3488
+ return;
3489
+ }
3490
+
3491
+ var current = $this.find($this.options.target).not(this);
3492
+
3493
+ current.removeClass("uk-active").blur();
3494
+
3495
+ $this.trigger("change.uk.tab", [UI.$(this).addClass("uk-active"), $this.current]);
3496
+
3497
+ $this.current = UI.$(this);
3498
+
3499
+ // Update ARIA
3500
+ if (!$this.options.connect) {
3501
+ current.attr('aria-expanded', 'false');
3502
+ UI.$(this).attr('aria-expanded', 'true');
3503
+ }
3504
+ });
3505
+
3506
+ if (this.options.connect) {
3507
+ this.connect = UI.$(this.options.connect);
3508
+ }
3509
+
3510
+ // init responsive tab
3511
+ this.responsivetab = UI.$('<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>');
3512
+
3513
+ this.responsivetab.dropdown = this.responsivetab.find('.uk-dropdown');
3514
+ this.responsivetab.lst = this.responsivetab.dropdown.find('ul');
3515
+ this.responsivetab.caption = this.responsivetab.find('a:first');
3516
+
3517
+ if (this.element.hasClass("uk-tab-bottom")) this.responsivetab.dropdown.addClass("uk-dropdown-up");
3518
+
3519
+ // handle click
3520
+ this.responsivetab.lst.on('click.uikit.tab', 'a', function(e) {
3521
+
3522
+ e.preventDefault();
3523
+ e.stopPropagation();
3524
+
3525
+ var link = UI.$(this);
3526
+
3527
+ $this.element.children('li:not(.uk-tab-responsive)').eq(link.data('index')).trigger('click');
3528
+ });
3529
+
3530
+ this.on('show.uk.switcher change.uk.tab', function(e, tab) {
3531
+ $this.responsivetab.caption.html(tab.text());
3532
+ });
3533
+
3534
+ this.element.append(this.responsivetab);
3535
+
3536
+ // init UIkit components
3537
+ if (this.options.connect) {
3538
+ this.switcher = UI.switcher(this.element, {
3539
+ 'toggle' : '>li:not(.uk-tab-responsive)',
3540
+ 'connect' : this.options.connect,
3541
+ 'active' : this.options.active,
3542
+ 'animation' : this.options.animation,
3543
+ 'duration' : this.options.duration,
3544
+ 'swiping' : this.options.swiping
3545
+ });
3546
+ }
3547
+
3548
+ UI.dropdown(this.responsivetab, {"mode": "click"});
3549
+
3550
+ // init
3551
+ $this.trigger("change.uk.tab", [this.element.find(this.options.target).not('.uk-tab-responsive').filter('.uk-active')]);
3552
+
3553
+ this.check();
3554
+
3555
+ UI.$win.on('resize orientationchange', UI.Utils.debounce(function(){
3556
+ if ($this.element.is(":visible")) $this.check();
3557
+ }, 100));
3558
+
3559
+ this.on('display.uk.check', function(){
3560
+ if ($this.element.is(":visible")) $this.check();
3561
+ });
3562
+ },
3563
+
3564
+ check: function() {
3565
+
3566
+ var children = this.element.children('li:not(.uk-tab-responsive)').removeClass('uk-hidden');
3567
+
3568
+ if (!children.length) {
3569
+ this.responsivetab.addClass('uk-hidden');
3570
+ return;
3571
+ }
3572
+
3573
+ var top = (children.eq(0).offset().top + Math.ceil(children.eq(0).height()/2)),
3574
+ doresponsive = false,
3575
+ item, link, clone;
3576
+
3577
+ this.responsivetab.lst.empty();
3578
+
3579
+ children.each(function(){
3580
+
3581
+ if (UI.$(this).offset().top > top) {
3582
+ doresponsive = true;
3583
+ }
3584
+ });
3585
+
3586
+ if (doresponsive) {
3587
+
3588
+ for (var i = 0; i < children.length; i++) {
3589
+
3590
+ item = UI.$(children.eq(i));
3591
+ link = item.find('a');
3592
+
3593
+ if (item.css('float') != 'none' && !item.attr('uk-dropdown')) {
3594
+
3595
+ if (!item.hasClass('uk-disabled')) {
3596
+
3597
+ clone = item[0].outerHTML.replace('<a ', '<a data-index="'+i+'" ');
3598
+
3599
+ this.responsivetab.lst.append(clone);
3600
+ }
3601
+
3602
+ item.addClass('uk-hidden');
3603
+ }
3604
+ }
3605
+ }
3606
+
3607
+ this.responsivetab[this.responsivetab.lst.children('li').length ? 'removeClass':'addClass']('uk-hidden');
3608
+ }
3609
+ });
3610
+
3611
+ })(UIkit);
3612
+
3613
+ (function(UI){
3614
+
3615
+ "use strict";
3616
+
3617
+ UI.component('cover', {
3618
+
3619
+ defaults: {
3620
+ automute : true
3621
+ },
3622
+
3623
+ boot: function() {
3624
+
3625
+ // auto init
3626
+ UI.ready(function(context) {
3627
+
3628
+ UI.$("[data-uk-cover]", context).each(function(){
3629
+
3630
+ var ele = UI.$(this);
3631
+
3632
+ if(!ele.data("cover")) {
3633
+ var plugin = UI.cover(ele, UI.Utils.options(ele.attr("data-uk-cover")));
3634
+ }
3635
+ });
3636
+ });
3637
+ },
3638
+
3639
+ init: function() {
3640
+
3641
+ this.parent = this.element.parent();
3642
+
3643
+ UI.$win.on('load resize orientationchange', UI.Utils.debounce(function(){
3644
+ this.check();
3645
+ }.bind(this), 100));
3646
+
3647
+ this.on("display.uk.check", function(e) {
3648
+ if(this.element.is(":visible")) this.check();
3649
+ }.bind(this));
3650
+
3651
+ this.check();
3652
+
3653
+ if (this.element.is('iframe') && this.options.automute) {
3654
+
3655
+ var src = this.element.attr('src');
3656
+
3657
+ this.element.attr('src', '').on('load', function(){
3658
+
3659
+ this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}', '*');
3660
+
3661
+ }).attr('src', [src, (src.indexOf('?') > -1 ? '&':'?'), 'enablejsapi=1&api=1'].join(''));
3662
+ }
3663
+ },
3664
+
3665
+ check: function() {
3666
+
3667
+ this.element.css({
3668
+ 'width' : '',
3669
+ 'height' : ''
3670
+ });
3671
+
3672
+ this.dimension = {w: this.element.width(), h: this.element.height()};
3673
+
3674
+ if (this.element.attr('width') && !isNaN(this.element.attr('width'))) {
3675
+ this.dimension.w = this.element.attr('width');
3676
+ }
3677
+
3678
+ if (this.element.attr('height') && !isNaN(this.element.attr('height'))) {
3679
+ this.dimension.h = this.element.attr('height');
3680
+ }
3681
+
3682
+ this.ratio = this.dimension.w / this.dimension.h;
3683
+
3684
+ var w = this.parent.width(), h = this.parent.height(), width, height;
3685
+
3686
+ // if element height < parent height (gap underneath)
3687
+ if ((w / this.ratio) < h) {
3688
+
3689
+ width = Math.ceil(h * this.ratio);
3690
+ height = h;
3691
+
3692
+ // element width < parent width (gap to right)
3693
+ } else {
3694
+
3695
+ width = w;
3696
+ height = Math.ceil(w / this.ratio);
3697
+ }
3698
+
3699
+ this.element.css({
3700
+ 'width' : width,
3701
+ 'height' : height
3702
+ });
3703
+ }
3704
+ });
3705
+
3706
+ })(UIkit);