uikit2-rails 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (110) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -0
  3. data/README.md +2 -2
  4. data/lib/uikit2/rails/version.rb +1 -1
  5. data/vendor/assets/javascripts/uikit/components/accordion.js +1 -1
  6. data/vendor/assets/javascripts/uikit/components/autocomplete.js +1 -1
  7. data/vendor/assets/javascripts/uikit/components/datepicker.js +2 -2
  8. data/vendor/assets/javascripts/uikit/components/form-password.js +1 -1
  9. data/vendor/assets/javascripts/uikit/components/form-select.js +1 -1
  10. data/vendor/assets/javascripts/uikit/components/grid.js +1 -1
  11. data/vendor/assets/javascripts/uikit/components/htmleditor.js +1 -1
  12. data/vendor/assets/javascripts/uikit/components/lightbox.js +1 -1
  13. data/vendor/assets/javascripts/uikit/components/nestable.js +1 -1
  14. data/vendor/assets/javascripts/uikit/components/notify.js +1 -1
  15. data/vendor/assets/javascripts/uikit/components/pagination.js +3 -3
  16. data/vendor/assets/javascripts/uikit/components/parallax.js +9 -5
  17. data/vendor/assets/javascripts/uikit/components/search.js +1 -1
  18. data/vendor/assets/javascripts/uikit/components/slider.js +12 -3
  19. data/vendor/assets/javascripts/uikit/components/slideset.js +1 -1
  20. data/vendor/assets/javascripts/uikit/components/slideshow-fx.js +1 -1
  21. data/vendor/assets/javascripts/uikit/components/slideshow.js +1 -1
  22. data/vendor/assets/javascripts/uikit/components/sortable.js +1 -1
  23. data/vendor/assets/javascripts/uikit/components/sticky.js +4 -1
  24. data/vendor/assets/javascripts/uikit/components/timepicker.js +1 -1
  25. data/vendor/assets/javascripts/uikit/components/tooltip.js +1 -1
  26. data/vendor/assets/javascripts/uikit/components/upload.js +1 -1
  27. data/vendor/assets/javascripts/uikit/core/alert.js +1 -1
  28. data/vendor/assets/javascripts/uikit/core/button.js +1 -1
  29. data/vendor/assets/javascripts/uikit/core/core.js +27 -22
  30. data/vendor/assets/javascripts/uikit/core/cover.js +1 -1
  31. data/vendor/assets/javascripts/uikit/core/dropdown.js +126 -50
  32. data/vendor/assets/javascripts/uikit/core/grid.js +1 -1
  33. data/vendor/assets/javascripts/uikit/core/modal.js +13 -4
  34. data/vendor/assets/javascripts/uikit/core/nav.js +1 -1
  35. data/vendor/assets/javascripts/uikit/core/offcanvas.js +1 -1
  36. data/vendor/assets/javascripts/uikit/core/scrollspy.js +1 -1
  37. data/vendor/assets/javascripts/uikit/core/smooth-scroll.js +1 -1
  38. data/vendor/assets/javascripts/uikit/core/switcher.js +6 -1
  39. data/vendor/assets/javascripts/uikit/core/tab.js +9 -7
  40. data/vendor/assets/javascripts/uikit/core/toggle.js +1 -1
  41. data/vendor/assets/javascripts/uikit/core/touch.js +10 -8
  42. data/vendor/assets/javascripts/uikit/core/utility.js +51 -1
  43. data/vendor/assets/javascripts/uikit.js +236 -87
  44. data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.css +1 -1
  45. data/vendor/assets/stylesheets/uikit/components/accordion.css +1 -1
  46. data/vendor/assets/stylesheets/uikit/components/accordion.gradient.css +1 -1
  47. data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.css +1 -1
  48. data/vendor/assets/stylesheets/uikit/components/autocomplete.css +1 -1
  49. data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.css +1 -1
  50. data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.css +1 -1
  51. data/vendor/assets/stylesheets/uikit/components/datepicker.css +1 -1
  52. data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.css +1 -1
  53. data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.css +1 -1
  54. data/vendor/assets/stylesheets/uikit/components/dotnav.css +1 -1
  55. data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.css +1 -1
  56. data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.css +1 -1
  57. data/vendor/assets/stylesheets/uikit/components/form-advanced.css +1 -1
  58. data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.css +1 -1
  59. data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.css +1 -1
  60. data/vendor/assets/stylesheets/uikit/components/form-file.css +1 -1
  61. data/vendor/assets/stylesheets/uikit/components/form-file.gradient.css +1 -1
  62. data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.css +1 -1
  63. data/vendor/assets/stylesheets/uikit/components/form-password.css +1 -1
  64. data/vendor/assets/stylesheets/uikit/components/form-password.gradient.css +1 -1
  65. data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.css +1 -1
  66. data/vendor/assets/stylesheets/uikit/components/form-select.css +1 -1
  67. data/vendor/assets/stylesheets/uikit/components/form-select.gradient.css +1 -1
  68. data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.css +1 -1
  69. data/vendor/assets/stylesheets/uikit/components/htmleditor.css +1 -1
  70. data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.css +1 -1
  71. data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.css +1 -1
  72. data/vendor/assets/stylesheets/uikit/components/nestable.css +1 -1
  73. data/vendor/assets/stylesheets/uikit/components/nestable.gradient.css +1 -1
  74. data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.css +1 -1
  75. data/vendor/assets/stylesheets/uikit/components/notify.css +1 -1
  76. data/vendor/assets/stylesheets/uikit/components/notify.gradient.css +1 -1
  77. data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.css +1 -1
  78. data/vendor/assets/stylesheets/uikit/components/placeholder.css +1 -1
  79. data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.css +1 -1
  80. data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.css +1 -1
  81. data/vendor/assets/stylesheets/uikit/components/progress.css +1 -1
  82. data/vendor/assets/stylesheets/uikit/components/progress.gradient.css +1 -1
  83. data/vendor/assets/stylesheets/uikit/components/search.almost-flat.css +1 -1
  84. data/vendor/assets/stylesheets/uikit/components/search.css +1 -1
  85. data/vendor/assets/stylesheets/uikit/components/search.gradient.css +1 -1
  86. data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.css +1 -1
  87. data/vendor/assets/stylesheets/uikit/components/slidenav.css +1 -1
  88. data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.css +1 -1
  89. data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.css +1 -1
  90. data/vendor/assets/stylesheets/uikit/components/slider.css +1 -1
  91. data/vendor/assets/stylesheets/uikit/components/slider.gradient.css +1 -1
  92. data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.css +1 -1
  93. data/vendor/assets/stylesheets/uikit/components/slideshow.css +1 -1
  94. data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.css +1 -1
  95. data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.css +1 -1
  96. data/vendor/assets/stylesheets/uikit/components/sortable.css +1 -1
  97. data/vendor/assets/stylesheets/uikit/components/sortable.gradient.css +1 -1
  98. data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.css +1 -1
  99. data/vendor/assets/stylesheets/uikit/components/sticky.css +1 -1
  100. data/vendor/assets/stylesheets/uikit/components/sticky.gradient.css +1 -1
  101. data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.css +1 -1
  102. data/vendor/assets/stylesheets/uikit/components/tooltip.css +1 -1
  103. data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.css +1 -1
  104. data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.css +1 -1
  105. data/vendor/assets/stylesheets/uikit/components/upload.css +1 -1
  106. data/vendor/assets/stylesheets/uikit/components/upload.gradient.css +1 -1
  107. data/vendor/assets/stylesheets/uikit.almost-flat.css +173 -24
  108. data/vendor/assets/stylesheets/uikit.css +173 -24
  109. data/vendor/assets/stylesheets/uikit.gradient.css +173 -24
  110. metadata +2 -2
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI) {
3
3
 
4
4
  "use strict";
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI) {
3
3
 
4
4
  "use strict";
@@ -17,6 +17,7 @@
17
17
 
18
18
  scrollable: false,
19
19
  transition: false,
20
+ hasTransitioned: true,
20
21
 
21
22
  init: function() {
22
23
 
@@ -74,7 +75,14 @@
74
75
 
75
76
  activeCount++;
76
77
 
77
- this.element.addClass("uk-open");
78
+ if (UI.support.transition) {
79
+ this.hasTransitioned = false;
80
+ this.element.one(UI.support.transition.end, function(){
81
+ $this.hasTransitioned = true;
82
+ }).addClass("uk-open");
83
+ } else {
84
+ this.element.addClass("uk-open");
85
+ }
78
86
 
79
87
  $html.addClass("uk-modal-page").height(); // force browser engine redraw
80
88
 
@@ -90,7 +98,7 @@
90
98
 
91
99
  hide: function(force) {
92
100
 
93
- if (!force && UI.support.transition) {
101
+ if (!force && UI.support.transition && this.hasTransitioned) {
94
102
 
95
103
  var $this = this;
96
104
 
@@ -154,7 +162,8 @@
154
162
  _hide: function() {
155
163
 
156
164
  this.active = false;
157
- activeCount--;
165
+ if (activeCount > 0) activeCount--;
166
+ else activeCount = 0;
158
167
 
159
168
  this.element.hide().removeClass("uk-open");
160
169
 
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI) {
3
3
 
4
4
  "use strict";
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI) {
3
3
 
4
4
  "use strict";
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI) {
3
3
 
4
4
  "use strict";
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI) {
3
3
 
4
4
  "use strict";
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI) {
3
3
 
4
4
  "use strict";
@@ -186,6 +186,7 @@
186
186
  UI.Utils.checkDisplay(next, true);
187
187
 
188
188
  $this.animating = false;
189
+
189
190
  });
190
191
  });
191
192
  }
@@ -268,6 +269,8 @@
268
269
  clsOut = cls[1] || cls[0];
269
270
  }
270
271
 
272
+ UI.$body.css('overflow-x', 'hidden'); // fix scroll jumping in iOS
273
+
271
274
  release = function() {
272
275
 
273
276
  if (current) current.hide().removeClass('uk-active '+clsOut+' uk-animation-reverse');
@@ -278,6 +281,8 @@
278
281
 
279
282
  d.resolve();
280
283
 
284
+ UI.$body.css('overflow-x', '');
285
+
281
286
  if (current) current.css({opacity:'', display:''});
282
287
 
283
288
  }.bind(this)).show();
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI) {
3
3
 
4
4
  "use strict";
@@ -10,7 +10,8 @@
10
10
  'connect' : false,
11
11
  'active' : 0,
12
12
  'animation' : false,
13
- 'duration' : 200
13
+ 'duration' : 200,
14
+ 'swiping' : true
14
15
  },
15
16
 
16
17
  boot: function() {
@@ -91,11 +92,12 @@
91
92
  // init UIkit components
92
93
  if (this.options.connect) {
93
94
  this.switcher = UI.switcher(this.element, {
94
- "toggle" : ">li:not(.uk-tab-responsive)",
95
- "connect" : this.options.connect,
96
- "active" : this.options.active,
97
- "animation" : this.options.animation,
98
- "duration" : this.options.duration
95
+ 'toggle' : '>li:not(.uk-tab-responsive)',
96
+ 'connect' : this.options.connect,
97
+ 'active' : this.options.active,
98
+ 'animation' : this.options.animation,
99
+ 'duration' : this.options.duration,
100
+ 'swiping' : this.options.swiping
99
101
  });
100
102
  }
101
103
 
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI){
3
3
 
4
4
  "use strict";
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  // Based on Zeptos touch.js
3
3
  // https://raw.github.com/madrobby/zepto/master/src/touch.js
4
4
  // Zepto.js may be freely distributed under the MIT license.
@@ -19,7 +19,7 @@
19
19
  function longTap() {
20
20
  longTapTimeout = null;
21
21
  if (touch.last) {
22
- touch.el.trigger('longTap');
22
+ if ( touch.el !== undefined ) touch.el.trigger('longTap');
23
23
  touch = {};
24
24
  }
25
25
  }
@@ -55,7 +55,7 @@
55
55
 
56
56
  var swipeDirectionFromVelocity = e.originalEvent.velocityX > 1 ? 'Right' : e.originalEvent.velocityX < -1 ? 'Left' : e.originalEvent.velocityY > 1 ? 'Down' : e.originalEvent.velocityY < -1 ? 'Up' : null;
57
57
 
58
- if (swipeDirectionFromVelocity) {
58
+ if (swipeDirectionFromVelocity && touch.el !== undefined) {
59
59
  touch.el.trigger('swipe');
60
60
  touch.el.trigger('swipe'+ swipeDirectionFromVelocity);
61
61
  }
@@ -115,8 +115,10 @@
115
115
  if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)){
116
116
 
117
117
  swipeTimeout = setTimeout(function() {
118
- touch.el.trigger('swipe');
119
- touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)));
118
+ if ( touch.el !== undefined ) {
119
+ touch.el.trigger('swipe');
120
+ touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)));
121
+ }
120
122
  touch = {};
121
123
  }, 0);
122
124
 
@@ -134,11 +136,11 @@
134
136
  // (cancelTouch cancels processing of single vs double taps for faster 'tap' response)
135
137
  var event = $.Event('tap');
136
138
  event.cancelTouch = cancelAll;
137
- touch.el.trigger(event);
139
+ if ( touch.el !== undefined ) touch.el.trigger(event);
138
140
 
139
141
  // trigger double tap immediately
140
142
  if (touch.isDoubleTap) {
141
- touch.el.trigger('doubleTap');
143
+ if ( touch.el !== undefined ) touch.el.trigger('doubleTap');
142
144
  touch = {};
143
145
  }
144
146
 
@@ -146,7 +148,7 @@
146
148
  else {
147
149
  touchTimeout = setTimeout(function(){
148
150
  touchTimeout = null;
149
- touch.el.trigger('singleTap');
151
+ if ( touch.el !== undefined ) touch.el.trigger('singleTap');
150
152
  touch = {};
151
153
  }, 250);
152
154
  }
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI) {
3
3
 
4
4
  "use strict";
@@ -236,4 +236,54 @@
236
236
  }
237
237
  };
238
238
 
239
+ (function(cacheSvgs){
240
+
241
+ UI.Utils.inlineSvg = function(selector, root) {
242
+
243
+ var images = UI.$(selector || 'img[src$=".svg"]', root || document).each(function(){
244
+
245
+ var img = UI.$(this),
246
+ src = img.attr('src');
247
+
248
+ if (!cacheSvgs[src]) {
249
+
250
+ var d = UI.$.Deferred();
251
+
252
+ UI.$.get(src, {nc: Math.random()}, function(data){
253
+ d.resolve(UI.$(data).find('svg'));
254
+ });
255
+
256
+ cacheSvgs[src] = d.promise();
257
+ }
258
+
259
+ cacheSvgs[src].then(function(svg) {
260
+
261
+ var $svg = UI.$(svg).clone();
262
+
263
+ if (img.attr('id')) $svg.attr('id', img.attr('id'));
264
+ if (img.attr('class')) $svg.attr('class', img.attr('class'));
265
+ if (img.attr('style')) $svg.attr('style', img.attr('style'));
266
+
267
+ if (img.attr('width')) {
268
+ $svg.attr('width', img.attr('width'));
269
+ if (!img.attr('height')) $svg.removeAttr('height');
270
+ }
271
+
272
+ if (img.attr('height')){
273
+ $svg.attr('height', img.attr('height'));
274
+ if (!img.attr('width')) $svg.removeAttr('width');
275
+ }
276
+
277
+ img.replaceWith($svg);
278
+ });
279
+ });
280
+ };
281
+
282
+ // init code
283
+ UI.ready(function(context) {
284
+ UI.Utils.inlineSvg('[data-uk-svg]', context);
285
+ });
286
+
287
+ })({});
288
+
239
289
  })(UIkit);
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.22.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.23.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(core) {
3
3
 
4
4
  if (typeof define == "function" && define.amd) { // AMD
@@ -44,7 +44,7 @@
44
44
 
45
45
  var UI = {}, _UI = global.UIkit ? Object.create(global.UIkit) : undefined;
46
46
 
47
- UI.version = '2.22.0';
47
+ UI.version = '2.23.0';
48
48
 
49
49
  UI.noConflict = function() {
50
50
  // restore UIkit version
@@ -110,27 +110,30 @@
110
110
  })();
111
111
 
112
112
  // requestAnimationFrame polyfill
113
- // https://gist.github.com/paulirish/1579671
114
- (function(){
115
-
116
- var lastTime = 0;
113
+ //https://github.com/darius/requestAnimationFrame
114
+ (function() {
117
115
 
118
- global.requestAnimationFrame = global.requestAnimationFrame || global.webkitRequestAnimationFrame || function(callback, element) {
119
- var currTime = new Date().getTime();
120
- var timeToCall = Math.max(0, 16 - (currTime - lastTime));
121
- var id = global.setTimeout(function() { callback(currTime + timeToCall); }, timeToCall);
122
- lastTime = currTime + timeToCall;
123
- return id;
124
- };
116
+ Date.now = Date.now || function() { return new Date().getTime(); };
125
117
 
126
- if (!global.cancelAnimationFrame) {
127
-
128
- global.cancelAnimationFrame = function(id) {
129
- clearTimeout(id);
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);
130
133
  };
134
+ window.cancelAnimationFrame = clearTimeout;
131
135
  }
132
-
133
- })();
136
+ }());
134
137
 
135
138
  UI.support.touch = (
136
139
  ('ontouchstart' in document) ||
@@ -145,7 +148,7 @@
145
148
  UI.Utils = {};
146
149
 
147
150
  UI.Utils.isFullscreen = function() {
148
- return document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement || document.fullscreenElement || false;
151
+ return document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement || document.fullscreenElement || false;
149
152
  };
150
153
 
151
154
  UI.Utils.str2json = function(str, notevil) {
@@ -633,7 +636,7 @@
633
636
  UI.component.bootComponents();
634
637
 
635
638
  // custom scroll observer
636
- setInterval((function(){
639
+ requestAnimationFrame((function(){
637
640
 
638
641
  var memory = {x: window.pageXOffset, y:window.pageYOffset}, dir;
639
642
 
@@ -652,6 +655,8 @@
652
655
 
653
656
  UI.$doc.trigger('scrolling.uk.document', [memory]);
654
657
  }
658
+
659
+ requestAnimationFrame(fn);
655
660
  };
656
661
 
657
662
  if (UI.support.touch) {
@@ -662,7 +667,7 @@
662
667
 
663
668
  return fn;
664
669
 
665
- })(), 15);
670
+ })());
666
671
 
667
672
  // run component init functions on dom
668
673
  UI.trigger('domready.uk.dom');
@@ -744,7 +749,7 @@
744
749
  function longTap() {
745
750
  longTapTimeout = null;
746
751
  if (touch.last) {
747
- touch.el.trigger('longTap');
752
+ if ( touch.el !== undefined ) touch.el.trigger('longTap');
748
753
  touch = {};
749
754
  }
750
755
  }
@@ -780,7 +785,7 @@
780
785
 
781
786
  var swipeDirectionFromVelocity = e.originalEvent.velocityX > 1 ? 'Right' : e.originalEvent.velocityX < -1 ? 'Left' : e.originalEvent.velocityY > 1 ? 'Down' : e.originalEvent.velocityY < -1 ? 'Up' : null;
782
787
 
783
- if (swipeDirectionFromVelocity) {
788
+ if (swipeDirectionFromVelocity && touch.el !== undefined) {
784
789
  touch.el.trigger('swipe');
785
790
  touch.el.trigger('swipe'+ swipeDirectionFromVelocity);
786
791
  }
@@ -840,8 +845,10 @@
840
845
  if ((touch.x2 && Math.abs(touch.x1 - touch.x2) > 30) || (touch.y2 && Math.abs(touch.y1 - touch.y2) > 30)){
841
846
 
842
847
  swipeTimeout = setTimeout(function() {
843
- touch.el.trigger('swipe');
844
- touch.el.trigger('swipe' + (swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2)));
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
+ }
845
852
  touch = {};
846
853
  }, 0);
847
854
 
@@ -859,11 +866,11 @@
859
866
  // (cancelTouch cancels processing of single vs double taps for faster 'tap' response)
860
867
  var event = $.Event('tap');
861
868
  event.cancelTouch = cancelAll;
862
- touch.el.trigger(event);
869
+ if ( touch.el !== undefined ) touch.el.trigger(event);
863
870
 
864
871
  // trigger double tap immediately
865
872
  if (touch.isDoubleTap) {
866
- touch.el.trigger('doubleTap');
873
+ if ( touch.el !== undefined ) touch.el.trigger('doubleTap');
867
874
  touch = {};
868
875
  }
869
876
 
@@ -871,7 +878,7 @@
871
878
  else {
872
879
  touchTimeout = setTimeout(function(){
873
880
  touchTimeout = null;
874
- touch.el.trigger('singleTap');
881
+ if ( touch.el !== undefined ) touch.el.trigger('singleTap');
875
882
  touch = {};
876
883
  }, 250);
877
884
  }
@@ -1134,6 +1141,56 @@
1134
1141
  }
1135
1142
  };
1136
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
+
1137
1194
  })(UIkit);
1138
1195
 
1139
1196
  (function(UI) {
@@ -1753,16 +1810,51 @@
1753
1810
 
1754
1811
  "use strict";
1755
1812
 
1756
- var active = false, hoverIdle;
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
+ };
1757
1846
 
1758
1847
  UI.component('dropdown', {
1759
1848
 
1760
1849
  defaults: {
1761
- 'mode' : 'hover',
1762
- 'remaintime' : 800,
1763
- 'justify' : false,
1764
- 'boundary' : UI.$win,
1765
- 'delay' : 0,
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',
1766
1858
  'hoverDelayIdle' : 250
1767
1859
  },
1768
1860
 
@@ -1785,7 +1877,7 @@
1785
1877
  dropdown.element.trigger(triggerevent);
1786
1878
  }
1787
1879
 
1788
- if (dropdown.element.find('.uk-dropdown').length) {
1880
+ if (dropdown.element.find(dropdown.options.dropdownSelector).length) {
1789
1881
  e.preventDefault();
1790
1882
  }
1791
1883
  }
@@ -1796,18 +1888,32 @@
1796
1888
 
1797
1889
  var $this = this;
1798
1890
 
1799
- this.dropdown = this.find('.uk-dropdown');
1891
+ this.dropdown = this.find(this.options.dropdownSelector);
1892
+ this.offsetParent = this.dropdown.parents().filter(function() {
1893
+ return UI.$.inArray(UI.$(this).css('position'), ['relative', 'fixed', 'absolute']) !== -1;
1894
+ }).slice(0,1);
1800
1895
 
1801
1896
  this.centered = this.dropdown.hasClass('uk-dropdown-center');
1802
1897
  this.justified = this.options.justify ? UI.$(this.options.justify) : false;
1803
1898
 
1804
1899
  this.boundary = UI.$(this.options.boundary);
1805
- this.flipped = this.dropdown.hasClass('uk-dropdown-flip');
1806
1900
 
1807
1901
  if (!this.boundary.length) {
1808
1902
  this.boundary = UI.$win;
1809
1903
  }
1810
1904
 
1905
+ // legacy DEPRECATED!
1906
+ if (this.dropdown.hasClass('uk-dropdown-up')) {
1907
+ this.options.pos = 'top-left';
1908
+ }
1909
+ if (this.dropdown.hasClass('uk-dropdown-flip')) {
1910
+ this.options.pos = this.options.pos.replace('left','right');
1911
+ }
1912
+ if (this.dropdown.hasClass('uk-dropdown-center')) {
1913
+ this.options.pos = this.options.pos.replace(/(left|right)/,'center');
1914
+ }
1915
+ //-- end legacy
1916
+
1811
1917
  // Init ARIA
1812
1918
  this.element.attr('aria-haspopup', 'true');
1813
1919
  this.element.attr('aria-expanded', this.element.hasClass("uk-open"));
@@ -1818,7 +1924,7 @@
1818
1924
 
1819
1925
  var $target = UI.$(e.target);
1820
1926
 
1821
- if (!$target.parents(".uk-dropdown").length) {
1927
+ if (!$target.parents($this.options.dropdownSelector).length) {
1822
1928
 
1823
1929
  if ($target.is("a[href='#']") || $target.parent().is("a[href='#']") || ($this.dropdown.length && !$this.dropdown.is(":visible")) ){
1824
1930
  e.preventDefault();
@@ -1978,66 +2084,93 @@
1978
2084
 
1979
2085
  if (!this.dropdown.length) return;
1980
2086
 
2087
+ // reset
2088
+ this.dropdown.removeClass('uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack').css({
2089
+ 'top-left':'',
2090
+ 'left':'',
2091
+ 'margin-left' :'',
2092
+ 'margin-right':''
2093
+ });
2094
+
1981
2095
  if (this.justified && this.justified.length) {
1982
2096
  this.dropdown.css("min-width", "");
1983
2097
  }
1984
2098
 
1985
- var $this = this,
1986
- dropdown = this.dropdown.css("margin-" + UI.langdirection, ""),
1987
- offset = dropdown.show().offset(),
1988
- width = dropdown.outerWidth(),
2099
+ var $this = this,
2100
+ pos = UI.$.extend({}, this.offsetParent.offset(), {width: this.offsetParent[0].offsetWidth, height: this.offsetParent[0].offsetHeight}),
2101
+ posoffset = this.options.offset,
2102
+ dropdown = this.dropdown,
2103
+ offset = dropdown.show().offset(),
2104
+ width = dropdown.outerWidth(),
2105
+ height = dropdown.outerHeight(),
1989
2106
  boundarywidth = this.boundary.width(),
1990
- boundaryoffset = this.boundary.offset() ? this.boundary.offset().left:0;
1991
-
1992
- // centered dropdown
1993
- if (this.centered) {
1994
- dropdown.css("margin-" + UI.langdirection, (parseFloat(width) / 2 - dropdown.parent().width() / 2) * -1);
1995
- offset = dropdown.offset();
2107
+ boundaryoffset = this.boundary.offset() ? this.boundary.offset(): {top:0, left:0},
2108
+ dpos = this.options.pos;
2109
+
2110
+ var variants = {
2111
+ "bottom-left" : {top: 0 + pos.height + posoffset, left: 0},
2112
+ "bottom-right" : {top: 0 + pos.height + posoffset, left: 0 + pos.width - width},
2113
+ "bottom-center" : {top: 0 + pos.height + posoffset, left: 0 + pos.width / 2 - width / 2},
2114
+ "top-left" : {top: 0 - height - posoffset, left: 0},
2115
+ "top-right" : {top: 0 - height - posoffset, left: 0 + pos.width - width},
2116
+ "top-center" : {top: 0 - height - posoffset, left: 0 + pos.width / 2 - width / 2},
2117
+ "left-top" : {top: 0, left: 0 - width - posoffset},
2118
+ "left-bottom" : {top: 0 + pos.height - height, left: 0 - width - posoffset},
2119
+ "left-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 - width - posoffset},
2120
+ "right-top" : {top: 0, left: 0 + pos.width + posoffset},
2121
+ "right-bottom" : {top: 0 + pos.height - height, left: 0 + pos.width + posoffset},
2122
+ "right-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 + pos.width + posoffset}
2123
+ },
2124
+ css = {},
2125
+ pp;
1996
2126
 
1997
- // reset dropdown
1998
- if ((width + offset.left) > boundarywidth || offset.left < 0) {
1999
- dropdown.css("margin-" + UI.langdirection, "");
2000
- offset = dropdown.offset();
2001
- }
2002
- }
2127
+ pp = dpos.split('-');
2128
+ css = variants[dpos] ? variants[dpos] : variants['bottom-left'];
2003
2129
 
2004
2130
  // justify dropdown
2005
2131
  if (this.justified && this.justified.length) {
2006
- justify(dropdown, this.justified, boundarywidth, offset);
2007
- offset = dropdown.offset();
2008
- }
2132
+ justify(dropdown.css({left:0}), this.justified, boundarywidth);
2133
+ } else {
2009
2134
 
2010
- if ((width + (offset.left-boundaryoffset)) > boundarywidth) {
2011
- dropdown.addClass('uk-dropdown-flip');
2012
- offset = dropdown.offset();
2013
- }
2135
+ switch(this.checkBoundary(pos.left + css.left, pos.top + css.top, width, height, boundarywidth)) {
2014
2136
 
2015
- if ((offset.left-boundaryoffset) < 0) {
2137
+ case "x":
2138
+ dpos = flips['x'][dpos] || 'right-top';
2139
+ break;
2140
+ case "y":
2141
+ dpos = flips['y'][dpos] || 'top-left';
2142
+ break;
2143
+ case "xy":
2144
+ dpos = flips['xy'][dpos] || 'right-bottom';
2145
+ break;
2146
+ }
2147
+
2148
+ pp = dpos.split('-');
2149
+ css = variants[dpos] ? variants[dpos] : variants['bottom-left'];
2150
+ }
2016
2151
 
2152
+ if (width > boundarywidth) {
2017
2153
  dropdown.addClass("uk-dropdown-stack");
2154
+ this.trigger('stack.uk.dropdown', [this]);
2155
+ }
2018
2156
 
2019
- if (dropdown.hasClass('uk-dropdown-flip')) {
2157
+ dropdown.css(css).css("display", "").addClass('uk-dropdown-'+pp[0]);
2158
+ },
2020
2159
 
2021
- if (!this.flipped) {
2022
- dropdown.removeClass('uk-dropdown-flip');
2023
- offset = dropdown.offset();
2024
- dropdown.addClass('uk-dropdown-flip');
2025
- }
2160
+ checkBoundary: function(left, top, width, height, boundarywidth) {
2026
2161
 
2027
- setTimeout(function(){
2162
+ var axis = "";
2028
2163
 
2029
- if ((dropdown.offset().left-boundaryoffset) < 0 || !$this.flipped && (dropdown.outerWidth() + (offset.left-boundaryoffset)) < boundarywidth) {
2030
- dropdown.removeClass('uk-dropdown-flip');
2031
- }
2032
- }, 0);
2033
- }
2164
+ if (left < 0 || ((left - UI.$win.scrollLeft())+width) > boundarywidth) {
2165
+ axis += "x";
2166
+ }
2034
2167
 
2035
- this.trigger('stack.uk.dropdown', [this]);
2168
+ if (top < 0 || ((top - UI.$win.scrollTop())+height) > window.innerHeight) {
2169
+ axis += "y";
2036
2170
  }
2037
2171
 
2038
- dropdown.css("display", "");
2172
+ return axis;
2039
2173
  }
2040
-
2041
2174
  });
2042
2175
 
2043
2176
 
@@ -2302,6 +2435,7 @@
2302
2435
 
2303
2436
  scrollable: false,
2304
2437
  transition: false,
2438
+ hasTransitioned: true,
2305
2439
 
2306
2440
  init: function() {
2307
2441
 
@@ -2359,7 +2493,14 @@
2359
2493
 
2360
2494
  activeCount++;
2361
2495
 
2362
- this.element.addClass("uk-open");
2496
+ if (UI.support.transition) {
2497
+ this.hasTransitioned = false;
2498
+ this.element.one(UI.support.transition.end, function(){
2499
+ $this.hasTransitioned = true;
2500
+ }).addClass("uk-open");
2501
+ } else {
2502
+ this.element.addClass("uk-open");
2503
+ }
2363
2504
 
2364
2505
  $html.addClass("uk-modal-page").height(); // force browser engine redraw
2365
2506
 
@@ -2375,7 +2516,7 @@
2375
2516
 
2376
2517
  hide: function(force) {
2377
2518
 
2378
- if (!force && UI.support.transition) {
2519
+ if (!force && UI.support.transition && this.hasTransitioned) {
2379
2520
 
2380
2521
  var $this = this;
2381
2522
 
@@ -2439,7 +2580,8 @@
2439
2580
  _hide: function() {
2440
2581
 
2441
2582
  this.active = false;
2442
- activeCount--;
2583
+ if (activeCount > 0) activeCount--;
2584
+ else activeCount = 0;
2443
2585
 
2444
2586
  this.element.hide().removeClass("uk-open");
2445
2587
 
@@ -3159,6 +3301,7 @@
3159
3301
  UI.Utils.checkDisplay(next, true);
3160
3302
 
3161
3303
  $this.animating = false;
3304
+
3162
3305
  });
3163
3306
  });
3164
3307
  }
@@ -3241,6 +3384,8 @@
3241
3384
  clsOut = cls[1] || cls[0];
3242
3385
  }
3243
3386
 
3387
+ UI.$body.css('overflow-x', 'hidden'); // fix scroll jumping in iOS
3388
+
3244
3389
  release = function() {
3245
3390
 
3246
3391
  if (current) current.hide().removeClass('uk-active '+clsOut+' uk-animation-reverse');
@@ -3251,6 +3396,8 @@
3251
3396
 
3252
3397
  d.resolve();
3253
3398
 
3399
+ UI.$body.css('overflow-x', '');
3400
+
3254
3401
  if (current) current.css({opacity:'', display:''});
3255
3402
 
3256
3403
  }.bind(this)).show();
@@ -3287,7 +3434,8 @@
3287
3434
  'connect' : false,
3288
3435
  'active' : 0,
3289
3436
  'animation' : false,
3290
- 'duration' : 200
3437
+ 'duration' : 200,
3438
+ 'swiping' : true
3291
3439
  },
3292
3440
 
3293
3441
  boot: function() {
@@ -3368,11 +3516,12 @@
3368
3516
  // init UIkit components
3369
3517
  if (this.options.connect) {
3370
3518
  this.switcher = UI.switcher(this.element, {
3371
- "toggle" : ">li:not(.uk-tab-responsive)",
3372
- "connect" : this.options.connect,
3373
- "active" : this.options.active,
3374
- "animation" : this.options.animation,
3375
- "duration" : this.options.duration
3519
+ 'toggle' : '>li:not(.uk-tab-responsive)',
3520
+ 'connect' : this.options.connect,
3521
+ 'active' : this.options.active,
3522
+ 'animation' : this.options.animation,
3523
+ 'duration' : this.options.duration,
3524
+ 'swiping' : this.options.swiping
3376
3525
  });
3377
3526
  }
3378
3527