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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8c2e36056f5251b206f6562e7512476ac42d2c4e
4
- data.tar.gz: 5ddd1ae15f0557b82f2f64caef4573f40ef378b3
3
+ metadata.gz: 86b8471ce66b662417471d44bf9d5587dbea8a78
4
+ data.tar.gz: 26a08097d6c9831bbf5389dfafb033c886a0bb4a
5
5
  SHA512:
6
- metadata.gz: 2f907bc1966385e2c9d28efaf537e733ed17ef8059a1169e5846e5883662b38a69200c493fd3c181f542f7758f7ec8a44896fd41049da01ff54c777be80435f1
7
- data.tar.gz: 2930819122e896ef17083a94d099054e1a79d147b1c30e8f35b3e2eea58ef9b0ebc5d67956965de8b0de5e184286902764ea74172b2f884d94eb7efc54ebd6eb
6
+ metadata.gz: 06e4e20340179e007da5b8c0c5117ae3ee565501b60a39b317fc35ad3c4cdd6330686eb536098c43eb9806186e1e7dcace7b42f08cce12670044bb57a8984d85
7
+ data.tar.gz: 9bedcc384b90667aae6ac61246465b2cdd090f50aa084a12a28c4c9b773e19b5c36ef90964cd4a44c0ae03fd57797b84f3000bcd8c5da1dc4923e7b676ecd8f1
data/.travis.yml CHANGED
@@ -1,4 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - 2.2.3
4
+ - 2.1.7
5
+ - 2.0.0
6
+ - 1.9.3
4
7
  before_install: gem install bundler -v 1.10.6
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/uikit2-rails.svg)](http://badge.fury.io/rb/uikit2-rails)
4
4
 
5
- UIkit 2.22.0
5
+ UIkit 2.23.0
6
6
 
7
7
  ## Installation
8
8
 
@@ -46,7 +46,7 @@ In your application.css:
46
46
  */
47
47
  ```
48
48
 
49
- And in yor application js:
49
+ And in your application js:
50
50
 
51
51
  ```js
52
52
  //= require uikit
@@ -1,5 +1,5 @@
1
1
  module Uikit2
2
2
  module Rails
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
@@ -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(addon) {
3
3
  var component;
4
4
 
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -207,7 +207,7 @@
207
207
  var offset = this.element.offset(),
208
208
  css = {"left": offset.left, "right":""};
209
209
 
210
- this.current = initdate ? moment(initdate, this.options.format):moment();
210
+ this.current = isNaN(initdate) ? moment(initdate, this.options.format):moment();
211
211
  this.initdate = this.current.format("YYYY-MM-DD");
212
212
 
213
213
  this.update();
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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
  /*
3
3
  * Based on Nestable jQuery Plugin - Copyright (c) 2012 David Bushell - http://dbushell.com/
4
4
  */
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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
  /*
3
3
  * Based on simplePagination - Copyright (c) 2012 Flavius Matis - http://flaviusmatis.github.com/simplePagination.js/ (MIT)
4
4
  */
@@ -26,8 +26,8 @@
26
26
  items : 1,
27
27
  itemsOnPage : 1,
28
28
  pages : 0,
29
- displayedPages : 3,
30
- edges : 3,
29
+ displayedPages : 7,
30
+ edges : 1,
31
31
  currentPage : 0,
32
32
  lblPrev : false,
33
33
  lblNext : false,
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -25,11 +25,11 @@
25
25
 
26
26
  scrolltop = UI.$win.scrollTop();
27
27
 
28
- window.requestAnimationFrame.apply(window, [function(){
28
+ window.requestAnimationFrame(function(){
29
29
  for (var i=0; i < parallaxes.length; i++) {
30
30
  parallaxes[i].process();
31
31
  }
32
- }]);
32
+ });
33
33
  };
34
34
 
35
35
 
@@ -294,6 +294,10 @@
294
294
  h += extra;
295
295
  w += Math.ceil(extra * ratio);
296
296
 
297
+ if (w > size.w && h < size.h) {
298
+ return obj.element.css({'background-size': ''});
299
+ }
300
+
297
301
  // if element height < parent height (gap underneath)
298
302
  if ((w / ratio) < h) {
299
303
  width = Math.ceil(h * ratio);
@@ -305,7 +309,7 @@
305
309
  height = Math.ceil(w / ratio);
306
310
  }
307
311
 
308
- obj.element.css({'background-size': (width+'px '+height+'px')});
312
+ element.css({'background-size': (width+'px '+height+'px')});
309
313
  };
310
314
 
311
315
  img.onerror = function(){
@@ -313,7 +317,7 @@
313
317
  };
314
318
 
315
319
  img.onload = function(){
316
- size = {w:img.width, height:img.height};
320
+ size = {w:img.width, h:img.height};
317
321
  ratio = img.width / img.height;
318
322
 
319
323
  UI.$win.on("load resize orientationchange", UI.Utils.debounce(function(){
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -269,13 +269,22 @@
269
269
 
270
270
  area += this.items.eq(i).data('width');
271
271
 
272
- if (area >= this.vp) {
272
+ if (area == this.vp) {
273
273
  idx = i;
274
274
  break;
275
275
  }
276
+
277
+ if (area > this.vp) {
278
+ idx = (i < this.items.length-1) ? i+1 : i;
279
+ break;
280
+ }
276
281
  }
277
282
 
278
- this.updatePos(this.items.eq(idx).data('left')*-1);
283
+ if (area > this.vp) {
284
+ this.updatePos((this.container.width() - this.vp) * -1);
285
+ } else {
286
+ this.updatePos(this.items.eq(idx).data('left')*-1);
287
+ }
279
288
  }
280
289
  }
281
290
  }
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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
  /*
3
3
  * Based on nativesortable - Copyright (c) Brian Grinstead - https://github.com/bgrins/nativesortable
4
4
  */
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -43,6 +43,7 @@
43
43
 
44
44
  // should be more efficient than using $win.scroll(checkscrollposition):
45
45
  UI.$doc.on('scrolling.uk.document', function(e, data) {
46
+ if (!data || !data.dir) return;
46
47
  direction = data.dir.y;
47
48
  checkscrollposition();
48
49
  });
@@ -141,6 +142,7 @@
141
142
  this.element.css({"position":"", "top":"", "width":"", "left":"", "margin":"0"});
142
143
  this.element.removeClass([this.options.animation, 'uk-animation-reverse', this.options.clsactive].join(' '));
143
144
  this.element.addClass(this.options.clsinactive);
145
+ this.element.trigger('inactive.uk.sticky');
144
146
 
145
147
  this.currentTop = null;
146
148
  this.animate = false;
@@ -331,6 +333,7 @@
331
333
  }
332
334
 
333
335
  sticky.element.addClass(sticky.options.clsactive).removeClass(sticky.options.clsinactive);
336
+ sticky.element.trigger('active.uk.sticky');
334
337
  sticky.element.css('margin', '');
335
338
 
336
339
  if (sticky.options.animation && sticky.init && !UI.Utils.isInView(sticky.wrapper)) {
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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(addon) {
3
3
  var component;
4
4
 
@@ -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(addon) {
3
3
 
4
4
  var component;
@@ -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(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(){
113
+ //https://github.com/darius/requestAnimationFrame
114
+ (function() {
115
115
 
116
- var lastTime = 0;
116
+ Date.now = Date.now || function() { return new Date().getTime(); };
117
117
 
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
- };
125
-
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');
@@ -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,18 +1,53 @@
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";
5
5
 
6
- var active = false, hoverIdle;
6
+ var active = false, hoverIdle, flips = {
7
+ 'x': {
8
+ "bottom-left" : 'bottom-right',
9
+ "bottom-right" : 'bottom-left',
10
+ "bottom-center" : 'bottom-right',
11
+ "top-left" : 'top-right',
12
+ "top-right" : 'top-left',
13
+ "top-center" : 'top-right',
14
+ "left-top" : 'right',
15
+ "left-bottom" : 'right-bottom',
16
+ "left-center" : 'right-center',
17
+ "right-top" : 'left',
18
+ "right-bottom" : 'left-bottom',
19
+ "right-center" : 'left-center'
20
+ },
21
+ 'y': {
22
+ "bottom-left" : 'top-left',
23
+ "bottom-right" : 'top-right',
24
+ "bottom-center" : 'top-center',
25
+ "top-left" : 'bottom-left',
26
+ "top-right" : 'bottom-right',
27
+ "top-center" : 'bottom-center',
28
+ "left-top" : 'top-left',
29
+ "left-bottom" : 'left-bottom',
30
+ "left-center" : 'top-left',
31
+ "right-top" : 'top-left',
32
+ "right-bottom" : 'bottom-left',
33
+ "right-center" : 'top-left'
34
+ },
35
+ 'xy': {
36
+
37
+ }
38
+ };
7
39
 
8
40
  UI.component('dropdown', {
9
41
 
10
42
  defaults: {
11
- 'mode' : 'hover',
12
- 'remaintime' : 800,
13
- 'justify' : false,
14
- 'boundary' : UI.$win,
15
- 'delay' : 0,
43
+ 'mode' : 'hover',
44
+ 'pos' : 'bottom-left',
45
+ 'offset' : 0,
46
+ 'remaintime' : 800,
47
+ 'justify' : false,
48
+ 'boundary' : UI.$win,
49
+ 'delay' : 0,
50
+ 'dropdownSelector': '.uk-dropdown,.uk-dropdown-blank',
16
51
  'hoverDelayIdle' : 250
17
52
  },
18
53
 
@@ -35,7 +70,7 @@
35
70
  dropdown.element.trigger(triggerevent);
36
71
  }
37
72
 
38
- if (dropdown.element.find('.uk-dropdown').length) {
73
+ if (dropdown.element.find(dropdown.options.dropdownSelector).length) {
39
74
  e.preventDefault();
40
75
  }
41
76
  }
@@ -46,18 +81,32 @@
46
81
 
47
82
  var $this = this;
48
83
 
49
- this.dropdown = this.find('.uk-dropdown');
84
+ this.dropdown = this.find(this.options.dropdownSelector);
85
+ this.offsetParent = this.dropdown.parents().filter(function() {
86
+ return UI.$.inArray(UI.$(this).css('position'), ['relative', 'fixed', 'absolute']) !== -1;
87
+ }).slice(0,1);
50
88
 
51
89
  this.centered = this.dropdown.hasClass('uk-dropdown-center');
52
90
  this.justified = this.options.justify ? UI.$(this.options.justify) : false;
53
91
 
54
92
  this.boundary = UI.$(this.options.boundary);
55
- this.flipped = this.dropdown.hasClass('uk-dropdown-flip');
56
93
 
57
94
  if (!this.boundary.length) {
58
95
  this.boundary = UI.$win;
59
96
  }
60
97
 
98
+ // legacy DEPRECATED!
99
+ if (this.dropdown.hasClass('uk-dropdown-up')) {
100
+ this.options.pos = 'top-left';
101
+ }
102
+ if (this.dropdown.hasClass('uk-dropdown-flip')) {
103
+ this.options.pos = this.options.pos.replace('left','right');
104
+ }
105
+ if (this.dropdown.hasClass('uk-dropdown-center')) {
106
+ this.options.pos = this.options.pos.replace(/(left|right)/,'center');
107
+ }
108
+ //-- end legacy
109
+
61
110
  // Init ARIA
62
111
  this.element.attr('aria-haspopup', 'true');
63
112
  this.element.attr('aria-expanded', this.element.hasClass("uk-open"));
@@ -68,7 +117,7 @@
68
117
 
69
118
  var $target = UI.$(e.target);
70
119
 
71
- if (!$target.parents(".uk-dropdown").length) {
120
+ if (!$target.parents($this.options.dropdownSelector).length) {
72
121
 
73
122
  if ($target.is("a[href='#']") || $target.parent().is("a[href='#']") || ($this.dropdown.length && !$this.dropdown.is(":visible")) ){
74
123
  e.preventDefault();
@@ -228,66 +277,93 @@
228
277
 
229
278
  if (!this.dropdown.length) return;
230
279
 
280
+ // reset
281
+ this.dropdown.removeClass('uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack').css({
282
+ 'top-left':'',
283
+ 'left':'',
284
+ 'margin-left' :'',
285
+ 'margin-right':''
286
+ });
287
+
231
288
  if (this.justified && this.justified.length) {
232
289
  this.dropdown.css("min-width", "");
233
290
  }
234
291
 
235
- var $this = this,
236
- dropdown = this.dropdown.css("margin-" + UI.langdirection, ""),
237
- offset = dropdown.show().offset(),
238
- width = dropdown.outerWidth(),
292
+ var $this = this,
293
+ pos = UI.$.extend({}, this.offsetParent.offset(), {width: this.offsetParent[0].offsetWidth, height: this.offsetParent[0].offsetHeight}),
294
+ posoffset = this.options.offset,
295
+ dropdown = this.dropdown,
296
+ offset = dropdown.show().offset(),
297
+ width = dropdown.outerWidth(),
298
+ height = dropdown.outerHeight(),
239
299
  boundarywidth = this.boundary.width(),
240
- boundaryoffset = this.boundary.offset() ? this.boundary.offset().left:0;
241
-
242
- // centered dropdown
243
- if (this.centered) {
244
- dropdown.css("margin-" + UI.langdirection, (parseFloat(width) / 2 - dropdown.parent().width() / 2) * -1);
245
- offset = dropdown.offset();
300
+ boundaryoffset = this.boundary.offset() ? this.boundary.offset(): {top:0, left:0},
301
+ dpos = this.options.pos;
302
+
303
+ var variants = {
304
+ "bottom-left" : {top: 0 + pos.height + posoffset, left: 0},
305
+ "bottom-right" : {top: 0 + pos.height + posoffset, left: 0 + pos.width - width},
306
+ "bottom-center" : {top: 0 + pos.height + posoffset, left: 0 + pos.width / 2 - width / 2},
307
+ "top-left" : {top: 0 - height - posoffset, left: 0},
308
+ "top-right" : {top: 0 - height - posoffset, left: 0 + pos.width - width},
309
+ "top-center" : {top: 0 - height - posoffset, left: 0 + pos.width / 2 - width / 2},
310
+ "left-top" : {top: 0, left: 0 - width - posoffset},
311
+ "left-bottom" : {top: 0 + pos.height - height, left: 0 - width - posoffset},
312
+ "left-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 - width - posoffset},
313
+ "right-top" : {top: 0, left: 0 + pos.width + posoffset},
314
+ "right-bottom" : {top: 0 + pos.height - height, left: 0 + pos.width + posoffset},
315
+ "right-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 + pos.width + posoffset}
316
+ },
317
+ css = {},
318
+ pp;
246
319
 
247
- // reset dropdown
248
- if ((width + offset.left) > boundarywidth || offset.left < 0) {
249
- dropdown.css("margin-" + UI.langdirection, "");
250
- offset = dropdown.offset();
251
- }
252
- }
320
+ pp = dpos.split('-');
321
+ css = variants[dpos] ? variants[dpos] : variants['bottom-left'];
253
322
 
254
323
  // justify dropdown
255
324
  if (this.justified && this.justified.length) {
256
- justify(dropdown, this.justified, boundarywidth, offset);
257
- offset = dropdown.offset();
258
- }
325
+ justify(dropdown.css({left:0}), this.justified, boundarywidth);
326
+ } else {
259
327
 
260
- if ((width + (offset.left-boundaryoffset)) > boundarywidth) {
261
- dropdown.addClass('uk-dropdown-flip');
262
- offset = dropdown.offset();
263
- }
328
+ switch(this.checkBoundary(pos.left + css.left, pos.top + css.top, width, height, boundarywidth)) {
329
+
330
+ case "x":
331
+ dpos = flips['x'][dpos] || 'right-top';
332
+ break;
333
+ case "y":
334
+ dpos = flips['y'][dpos] || 'top-left';
335
+ break;
336
+ case "xy":
337
+ dpos = flips['xy'][dpos] || 'right-bottom';
338
+ break;
339
+ }
264
340
 
265
- if ((offset.left-boundaryoffset) < 0) {
341
+ pp = dpos.split('-');
342
+ css = variants[dpos] ? variants[dpos] : variants['bottom-left'];
343
+ }
266
344
 
345
+ if (width > boundarywidth) {
267
346
  dropdown.addClass("uk-dropdown-stack");
347
+ this.trigger('stack.uk.dropdown', [this]);
348
+ }
268
349
 
269
- if (dropdown.hasClass('uk-dropdown-flip')) {
350
+ dropdown.css(css).css("display", "").addClass('uk-dropdown-'+pp[0]);
351
+ },
270
352
 
271
- if (!this.flipped) {
272
- dropdown.removeClass('uk-dropdown-flip');
273
- offset = dropdown.offset();
274
- dropdown.addClass('uk-dropdown-flip');
275
- }
353
+ checkBoundary: function(left, top, width, height, boundarywidth) {
276
354
 
277
- setTimeout(function(){
355
+ var axis = "";
278
356
 
279
- if ((dropdown.offset().left-boundaryoffset) < 0 || !$this.flipped && (dropdown.outerWidth() + (offset.left-boundaryoffset)) < boundarywidth) {
280
- dropdown.removeClass('uk-dropdown-flip');
281
- }
282
- }, 0);
283
- }
357
+ if (left < 0 || ((left - UI.$win.scrollLeft())+width) > boundarywidth) {
358
+ axis += "x";
359
+ }
284
360
 
285
- this.trigger('stack.uk.dropdown', [this]);
361
+ if (top < 0 || ((top - UI.$win.scrollTop())+height) > window.innerHeight) {
362
+ axis += "y";
286
363
  }
287
364
 
288
- dropdown.css("display", "");
365
+ return axis;
289
366
  }
290
-
291
367
  });
292
368
 
293
369