uikit2-rails 0.1.9 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/uikit2/rails/version.rb +1 -1
  4. data/vendor/assets/fonts/FontAwesome.otf +0 -0
  5. data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
  6. data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
  7. data/vendor/assets/fonts/fontawesome-webfont.woff2 +0 -0
  8. data/vendor/assets/javascripts/uikit.js +512 -425
  9. data/vendor/assets/javascripts/uikit/components/accordion.js +19 -13
  10. data/vendor/assets/javascripts/uikit/components/autocomplete.js +23 -17
  11. data/vendor/assets/javascripts/uikit/components/datepicker.js +25 -24
  12. data/vendor/assets/javascripts/uikit/components/form-password.js +16 -16
  13. data/vendor/assets/javascripts/uikit/components/form-select.js +33 -25
  14. data/vendor/assets/javascripts/uikit/components/grid-parallax.js +12 -12
  15. data/vendor/assets/javascripts/uikit/components/grid.js +47 -34
  16. data/vendor/assets/javascripts/uikit/components/htmleditor.js +47 -3
  17. data/vendor/assets/javascripts/uikit/components/lightbox.js +68 -70
  18. data/vendor/assets/javascripts/uikit/components/nestable.js +6 -6
  19. data/vendor/assets/javascripts/uikit/components/notify.js +9 -9
  20. data/vendor/assets/javascripts/uikit/components/pagination.js +8 -8
  21. data/vendor/assets/javascripts/uikit/components/parallax.js +13 -13
  22. data/vendor/assets/javascripts/uikit/components/search.js +11 -11
  23. data/vendor/assets/javascripts/uikit/components/slider.js +27 -15
  24. data/vendor/assets/javascripts/uikit/components/slideset.js +21 -12
  25. data/vendor/assets/javascripts/uikit/components/slideshow-fx.js +35 -28
  26. data/vendor/assets/javascripts/uikit/components/slideshow.js +129 -95
  27. data/vendor/assets/javascripts/uikit/components/sortable.js +45 -36
  28. data/vendor/assets/javascripts/uikit/components/sticky.js +19 -13
  29. data/vendor/assets/javascripts/uikit/components/timepicker.js +6 -6
  30. data/vendor/assets/javascripts/uikit/components/tooltip.js +47 -46
  31. data/vendor/assets/javascripts/uikit/components/upload.js +46 -44
  32. data/vendor/assets/javascripts/uikit/core/alert.js +17 -17
  33. data/vendor/assets/javascripts/uikit/core/button.js +25 -26
  34. data/vendor/assets/javascripts/uikit/core/core.js +58 -23
  35. data/vendor/assets/javascripts/uikit/core/cover.js +9 -17
  36. data/vendor/assets/javascripts/uikit/core/dropdown.js +108 -99
  37. data/vendor/assets/javascripts/uikit/core/grid.js +16 -16
  38. data/vendor/assets/javascripts/uikit/core/modal.js +35 -41
  39. data/vendor/assets/javascripts/uikit/core/nav.js +35 -18
  40. data/vendor/assets/javascripts/uikit/core/offcanvas.js +50 -33
  41. data/vendor/assets/javascripts/uikit/core/scrollspy.js +33 -33
  42. data/vendor/assets/javascripts/uikit/core/smooth-scroll.js +8 -8
  43. data/vendor/assets/javascripts/uikit/core/switcher.js +54 -52
  44. data/vendor/assets/javascripts/uikit/core/tab.js +27 -25
  45. data/vendor/assets/javascripts/uikit/core/toggle.js +12 -8
  46. data/vendor/assets/javascripts/uikit/core/touch.js +3 -3
  47. data/vendor/assets/javascripts/uikit/core/utility.js +35 -19
  48. data/vendor/assets/stylesheets/uikit.almost-flat.css +299 -242
  49. data/vendor/assets/stylesheets/uikit.css +280 -223
  50. data/vendor/assets/stylesheets/uikit.gradient.css +309 -252
  51. data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.css +2 -2
  52. data/vendor/assets/stylesheets/uikit/components/accordion.css +2 -2
  53. data/vendor/assets/stylesheets/uikit/components/accordion.gradient.css +2 -2
  54. data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.css +5 -5
  55. data/vendor/assets/stylesheets/uikit/components/autocomplete.css +5 -5
  56. data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.css +5 -5
  57. data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.css +10 -10
  58. data/vendor/assets/stylesheets/uikit/components/datepicker.css +10 -10
  59. data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.css +9 -9
  60. data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.css +1 -1
  61. data/vendor/assets/stylesheets/uikit/components/dotnav.css +1 -1
  62. data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.css +1 -1
  63. data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.css +5 -5
  64. data/vendor/assets/stylesheets/uikit/components/form-advanced.css +5 -5
  65. data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.css +5 -5
  66. data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.css +1 -1
  67. data/vendor/assets/stylesheets/uikit/components/form-file.css +1 -1
  68. data/vendor/assets/stylesheets/uikit/components/form-file.gradient.css +1 -1
  69. data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.css +3 -3
  70. data/vendor/assets/stylesheets/uikit/components/form-password.css +3 -3
  71. data/vendor/assets/stylesheets/uikit/components/form-password.gradient.css +3 -3
  72. data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.css +1 -1
  73. data/vendor/assets/stylesheets/uikit/components/form-select.css +1 -1
  74. data/vendor/assets/stylesheets/uikit/components/form-select.gradient.css +1 -1
  75. data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.css +12 -12
  76. data/vendor/assets/stylesheets/uikit/components/htmleditor.css +12 -12
  77. data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.css +13 -13
  78. data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.css +7 -3
  79. data/vendor/assets/stylesheets/uikit/components/nestable.css +6 -2
  80. data/vendor/assets/stylesheets/uikit/components/nestable.gradient.css +9 -5
  81. data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.css +4 -4
  82. data/vendor/assets/stylesheets/uikit/components/notify.css +3 -3
  83. data/vendor/assets/stylesheets/uikit/components/notify.gradient.css +4 -4
  84. data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.css +3 -3
  85. data/vendor/assets/stylesheets/uikit/components/placeholder.css +3 -3
  86. data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.css +3 -3
  87. data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.css +2 -2
  88. data/vendor/assets/stylesheets/uikit/components/progress.css +3 -3
  89. data/vendor/assets/stylesheets/uikit/components/progress.gradient.css +2 -2
  90. data/vendor/assets/stylesheets/uikit/components/search.almost-flat.css +18 -18
  91. data/vendor/assets/stylesheets/uikit/components/search.css +17 -17
  92. data/vendor/assets/stylesheets/uikit/components/search.gradient.css +18 -18
  93. data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.css +1 -1
  94. data/vendor/assets/stylesheets/uikit/components/slidenav.css +1 -1
  95. data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.css +1 -1
  96. data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.css +10 -1
  97. data/vendor/assets/stylesheets/uikit/components/slider.css +10 -1
  98. data/vendor/assets/stylesheets/uikit/components/slider.gradient.css +10 -1
  99. data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.css +1 -1
  100. data/vendor/assets/stylesheets/uikit/components/slideshow.css +1 -1
  101. data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.css +1 -1
  102. data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.css +5 -1
  103. data/vendor/assets/stylesheets/uikit/components/sortable.css +5 -1
  104. data/vendor/assets/stylesheets/uikit/components/sortable.gradient.css +5 -1
  105. data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.css +4 -1
  106. data/vendor/assets/stylesheets/uikit/components/sticky.css +4 -1
  107. data/vendor/assets/stylesheets/uikit/components/sticky.gradient.css +4 -1
  108. data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.css +8 -7
  109. data/vendor/assets/stylesheets/uikit/components/tooltip.css +8 -7
  110. data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.css +8 -7
  111. data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.css +1 -1
  112. data/vendor/assets/stylesheets/uikit/components/upload.css +1 -1
  113. data/vendor/assets/stylesheets/uikit/components/upload.gradient.css +1 -1
  114. metadata +2 -2
@@ -1,4 +1,4 @@
1
- /*! UIkit 2.26.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI){
3
3
 
4
4
  "use strict";
@@ -14,12 +14,12 @@
14
14
  // auto init
15
15
  UI.ready(function(context) {
16
16
 
17
- UI.$("[data-uk-cover]", context).each(function(){
17
+ UI.$('[data-uk-cover]', context).each(function(){
18
18
 
19
19
  var ele = UI.$(this);
20
20
 
21
- if(!ele.data("cover")) {
22
- var plugin = UI.cover(ele, UI.Utils.options(ele.attr("data-uk-cover")));
21
+ if(!ele.data('cover')) {
22
+ var plugin = UI.cover(ele, UI.Utils.options(ele.attr('data-uk-cover')));
23
23
  }
24
24
  });
25
25
  });
@@ -33,8 +33,8 @@
33
33
  this.check();
34
34
  }.bind(this), 100));
35
35
 
36
- this.on("display.uk.check", function(e) {
37
- if(this.element.is(":visible")) this.check();
36
+ this.on('display.uk.check', function(e) {
37
+ if (this.element.is(':visible')) this.check();
38
38
  }.bind(this));
39
39
 
40
40
  this.check();
@@ -44,19 +44,14 @@
44
44
  var src = this.element.attr('src');
45
45
 
46
46
  this.element.attr('src', '').on('load', function(){
47
-
48
47
  this.contentWindow.postMessage('{ "event": "command", "func": "mute", "method":"setVolume", "value":0}', '*');
49
-
50
48
  }).attr('src', [src, (src.indexOf('?') > -1 ? '&':'?'), 'enablejsapi=1&api=1'].join(''));
51
49
  }
52
50
  },
53
51
 
54
52
  check: function() {
55
53
 
56
- this.element.css({
57
- 'width' : '',
58
- 'height' : ''
59
- });
54
+ this.element.css({ width : '', height : '' });
60
55
 
61
56
  this.dimension = {w: this.element.width(), h: this.element.height()};
62
57
 
@@ -68,7 +63,7 @@
68
63
  this.dimension.h = this.element.attr('height');
69
64
  }
70
65
 
71
- this.ratio = this.dimension.w / this.dimension.h;
66
+ this.ratio = this.dimension.w / this.dimension.h;
72
67
 
73
68
  var w = this.parent.width(), h = this.parent.height(), width, height;
74
69
 
@@ -85,10 +80,7 @@
85
80
  height = Math.ceil(w / this.ratio);
86
81
  }
87
82
 
88
- this.element.css({
89
- 'width' : width,
90
- 'height' : height
91
- });
83
+ this.element.css({ width : width, height : height });
92
84
  }
93
85
  });
94
86
 
@@ -1,88 +1,88 @@
1
- /*! UIkit 2.26.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
1
+ /*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
2
2
  (function(UI) {
3
3
 
4
4
  "use strict";
5
5
 
6
6
  var active = false, hoverIdle, flips = {
7
- 'x': {
8
- "bottom-left" : 'bottom-right',
9
- "bottom-right" : 'bottom-left',
10
- "bottom-center" : 'bottom-center',
11
- "top-left" : 'top-right',
12
- "top-right" : 'top-left',
13
- "top-center" : 'top-center',
14
- "left-top" : 'right-top',
15
- "left-bottom" : 'right-bottom',
16
- "left-center" : 'right-center',
17
- "right-top" : 'left-top',
18
- "right-bottom" : 'left-bottom',
19
- "right-center" : 'left-center'
7
+ x: {
8
+ 'bottom-left' : 'bottom-right',
9
+ 'bottom-right' : 'bottom-left',
10
+ 'bottom-center' : 'bottom-center',
11
+ 'top-left' : 'top-right',
12
+ 'top-right' : 'top-left',
13
+ 'top-center' : 'top-center',
14
+ 'left-top' : 'right-top',
15
+ 'left-bottom' : 'right-bottom',
16
+ 'left-center' : 'right-center',
17
+ 'right-top' : 'left-top',
18
+ 'right-bottom' : 'left-bottom',
19
+ 'right-center' : 'left-center'
20
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" : 'left-bottom',
29
- "left-bottom" : 'left-top',
30
- "left-center" : 'left-center',
31
- "right-top" : 'right-bottom',
32
- "right-bottom" : 'right-top',
33
- "right-center" : 'right-center'
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' : 'left-bottom',
29
+ 'left-bottom' : 'left-top',
30
+ 'left-center' : 'left-center',
31
+ 'right-top' : 'right-bottom',
32
+ 'right-bottom' : 'right-top',
33
+ 'right-center' : 'right-center'
34
34
  },
35
- 'xy': {
36
- "bottom-left" : 'top-right',
37
- "bottom-right" : 'top-left',
38
- "bottom-center" : 'top-center',
39
- "top-left" : 'bottom-right',
40
- "top-right" : 'bottom-left',
41
- "top-center" : 'bottom-center',
42
- "left-top" : 'right-bottom',
43
- "left-bottom" : 'right-top',
44
- "left-center" : 'right-center',
45
- "right-top" : 'left-bottom',
46
- "right-bottom" : 'left-top',
47
- "right-center" : 'left-center'
35
+ xy: {
36
+ 'bottom-left' : 'top-right',
37
+ 'bottom-right' : 'top-left',
38
+ 'bottom-center' : 'top-center',
39
+ 'top-left' : 'bottom-right',
40
+ 'top-right' : 'bottom-left',
41
+ 'top-center' : 'bottom-center',
42
+ 'left-top' : 'right-bottom',
43
+ 'left-bottom' : 'right-top',
44
+ 'left-center' : 'right-center',
45
+ 'right-top' : 'left-bottom',
46
+ 'right-bottom' : 'left-top',
47
+ 'right-center' : 'left-center'
48
48
  }
49
49
  };
50
50
 
51
51
  UI.component('dropdown', {
52
52
 
53
53
  defaults: {
54
- 'mode' : 'hover',
55
- 'pos' : 'bottom-left',
56
- 'offset' : 0,
57
- 'remaintime' : 800,
58
- 'justify' : false,
59
- 'boundary' : UI.$win,
60
- 'delay' : 0,
61
- 'dropdownSelector': '.uk-dropdown,.uk-dropdown-blank',
62
- 'hoverDelayIdle' : 250,
63
- 'preventflip' : false
54
+ mode : 'hover',
55
+ pos : 'bottom-left',
56
+ offset : 0,
57
+ remaintime : 800,
58
+ justify : false,
59
+ boundary : UI.$win,
60
+ delay : 0,
61
+ dropdownSelector: '.uk-dropdown,.uk-dropdown-blank',
62
+ hoverDelayIdle : 250,
63
+ preventflip : false
64
64
  },
65
65
 
66
66
  remainIdle: false,
67
67
 
68
68
  boot: function() {
69
69
 
70
- var triggerevent = UI.support.touch ? "click" : "mouseenter";
70
+ var triggerevent = UI.support.touch ? 'click' : 'mouseenter';
71
71
 
72
72
  // init code
73
- UI.$html.on(triggerevent+".dropdown.uikit", "[data-uk-dropdown]", function(e) {
73
+ UI.$html.on(triggerevent+'.dropdown.uikit focus pointerdown', '[data-uk-dropdown]', function(e) {
74
74
 
75
75
  var ele = UI.$(this);
76
76
 
77
- if (!ele.data("dropdown")) {
77
+ if (!ele.data('dropdown')) {
78
78
 
79
- var dropdown = UI.dropdown(ele, UI.Utils.options(ele.attr("data-uk-dropdown")));
79
+ var dropdown = UI.dropdown(ele, UI.Utils.options(ele.attr('data-uk-dropdown')));
80
80
 
81
- if (triggerevent=="click" || (triggerevent=="mouseenter" && dropdown.options.mode=="hover")) {
81
+ if (e.type=='click' || (e.type=='mouseenter' && dropdown.options.mode=='hover')) {
82
82
  dropdown.element.trigger(triggerevent);
83
83
  }
84
84
 
85
- if (dropdown.element.find(dropdown.options.dropdownSelector).length) {
85
+ if (dropdown.dropdown.length) {
86
86
  e.preventDefault();
87
87
  }
88
88
  }
@@ -98,6 +98,10 @@
98
98
  return UI.$.inArray(UI.$(this).css('position'), ['relative', 'fixed', 'absolute']) !== -1;
99
99
  }).slice(0,1);
100
100
 
101
+ if (!this.offsetParent.length) {
102
+ this.offsetParent = this.element;
103
+ }
104
+
101
105
  this.centered = this.dropdown.hasClass('uk-dropdown-center');
102
106
  this.justified = this.options.justify ? UI.$(this.options.justify) : false;
103
107
 
@@ -121,17 +125,18 @@
121
125
 
122
126
  // Init ARIA
123
127
  this.element.attr('aria-haspopup', 'true');
124
- this.element.attr('aria-expanded', this.element.hasClass("uk-open"));
128
+ this.element.attr('aria-expanded', this.element.hasClass('uk-open'));
129
+ this.dropdown.attr('aria-hidden', 'true');
125
130
 
126
- if (this.options.mode == "click" || UI.support.touch) {
131
+ if (this.options.mode == 'click' || UI.support.touch) {
127
132
 
128
- this.on("click.uk.dropdown", function(e) {
133
+ this.on('click.uk.dropdown', function(e) {
129
134
 
130
135
  var $target = UI.$(e.target);
131
136
 
132
137
  if (!$target.parents($this.options.dropdownSelector).length) {
133
138
 
134
- if ($target.is("a[href='#']") || $target.parent().is("a[href='#']") || ($this.dropdown.length && !$this.dropdown.is(":visible")) ){
139
+ if ($target.is("a[href='#']") || $target.parent().is("a[href='#']") || ($this.dropdown.length && !$this.dropdown.is(':visible')) ){
135
140
  e.preventDefault();
136
141
  }
137
142
 
@@ -144,7 +149,7 @@
144
149
 
145
150
  } else {
146
151
 
147
- if (!$this.dropdown.find(e.target).length || $target.is(".uk-dropdown-close") || $target.parents(".uk-dropdown-close").length) {
152
+ if (!$this.dropdown.find(e.target).length || $target.is('.uk-dropdown-close') || $target.parents('.uk-dropdown-close').length) {
148
153
  $this.hide();
149
154
  }
150
155
  }
@@ -152,7 +157,7 @@
152
157
 
153
158
  } else {
154
159
 
155
- this.on("mouseenter", function(e) {
160
+ this.on('mouseenter', function(e) {
156
161
 
157
162
  $this.trigger('pointerenter.uk.dropdown', [$this]);
158
163
 
@@ -180,7 +185,7 @@
180
185
  hoverIdle = setTimeout($this.show.bind($this), $this.options.delay);
181
186
  }
182
187
 
183
- }).on("mouseleave", function() {
188
+ }).on('mouseleave', function() {
184
189
 
185
190
  if (hoverIdle) {
186
191
  clearTimeout(hoverIdle);
@@ -192,7 +197,7 @@
192
197
 
193
198
  $this.trigger('pointerleave.uk.dropdown', [$this]);
194
199
 
195
- }).on("click", function(e){
200
+ }).on('click', function(e){
196
201
 
197
202
  var $target = UI.$(e.target);
198
203
 
@@ -201,7 +206,7 @@
201
206
  }
202
207
 
203
208
  if (active && active == $this) {
204
- if (!$this.dropdown.find(e.target).length || $target.is(".uk-dropdown-close") || $target.parents(".uk-dropdown-close").length) {
209
+ if (!$this.dropdown.find(e.target).length || $target.is('.uk-dropdown-close') || $target.parents('.uk-dropdown-close').length) {
205
210
  $this.hide();
206
211
  }
207
212
  return;
@@ -218,7 +223,7 @@
218
223
 
219
224
  show: function(){
220
225
 
221
- UI.$html.off("click.outer.dropdown");
226
+ UI.$html.off('click.outer.dropdown');
222
227
 
223
228
  if (active && active != this) {
224
229
  active.hide(true);
@@ -235,10 +240,12 @@
235
240
 
236
241
  // Update ARIA
237
242
  this.element.attr('aria-expanded', 'true');
243
+ this.dropdown.attr('aria-hidden', 'false');
238
244
 
239
245
  this.trigger('show.uk.dropdown', [this]);
240
246
 
241
247
  UI.Utils.checkDisplay(this.dropdown, true);
248
+ UI.Utils.focus(this.dropdown);
242
249
  active = this;
243
250
 
244
251
  this.registerOuterClick();
@@ -258,6 +265,7 @@
258
265
 
259
266
  // Update ARIA
260
267
  this.element.attr('aria-expanded', 'false');
268
+ this.dropdown.attr('aria-hidden', 'true');
261
269
 
262
270
  this.trigger('hide.uk.dropdown', [this, force]);
263
271
 
@@ -268,11 +276,11 @@
268
276
 
269
277
  var $this = this;
270
278
 
271
- UI.$html.off("click.outer.dropdown");
279
+ UI.$html.off('click.outer.dropdown');
272
280
 
273
281
  setTimeout(function() {
274
282
 
275
- UI.$html.on("click.outer.dropdown", function(e) {
283
+ UI.$html.on('click.outer.dropdown', function(e) {
276
284
 
277
285
  if (hoverIdle) {
278
286
  clearTimeout(hoverIdle);
@@ -282,7 +290,7 @@
282
290
 
283
291
  if (active == $this && !$this.element.find(e.target).length) {
284
292
  $this.hide(true);
285
- UI.$html.off("click.outer.dropdown");
293
+ UI.$html.off('click.outer.dropdown');
286
294
  }
287
295
  });
288
296
  }, 10);
@@ -293,15 +301,15 @@
293
301
  if (!this.dropdown.length) return;
294
302
 
295
303
  // reset
296
- this.dropdown.removeClass('uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack').css({
297
- 'top-left':'',
298
- 'left':'',
299
- 'margin-left' :'',
300
- 'margin-right':''
304
+ this.dropdown.removeClass('uk-dropdown-top uk-dropdown-bottom uk-dropdown-left uk-dropdown-right uk-dropdown-stack uk-dropdown-autoflip').css({
305
+ topLeft :'',
306
+ left :'',
307
+ marginLeft :'',
308
+ marginRight :''
301
309
  });
302
310
 
303
311
  if (this.justified && this.justified.length) {
304
- this.dropdown.css("min-width", "");
312
+ this.dropdown.css('min-width', '');
305
313
  }
306
314
 
307
315
  var $this = this,
@@ -316,18 +324,18 @@
316
324
  dpos = this.options.pos;
317
325
 
318
326
  var variants = {
319
- "bottom-left" : {top: 0 + pos.height + posoffset, left: 0},
320
- "bottom-right" : {top: 0 + pos.height + posoffset, left: 0 + pos.width - width},
321
- "bottom-center" : {top: 0 + pos.height + posoffset, left: 0 + pos.width / 2 - width / 2},
322
- "top-left" : {top: 0 - height - posoffset, left: 0},
323
- "top-right" : {top: 0 - height - posoffset, left: 0 + pos.width - width},
324
- "top-center" : {top: 0 - height - posoffset, left: 0 + pos.width / 2 - width / 2},
325
- "left-top" : {top: 0, left: 0 - width - posoffset},
326
- "left-bottom" : {top: 0 + pos.height - height, left: 0 - width - posoffset},
327
- "left-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 - width - posoffset},
328
- "right-top" : {top: 0, left: 0 + pos.width + posoffset},
329
- "right-bottom" : {top: 0 + pos.height - height, left: 0 + pos.width + posoffset},
330
- "right-center" : {top: 0 + pos.height / 2 - height / 2, left: 0 + pos.width + posoffset}
327
+ 'bottom-left' : {top: 0 + pos.height + posoffset, left: 0},
328
+ 'bottom-right' : {top: 0 + pos.height + posoffset, left: 0 + pos.width - width},
329
+ 'bottom-center' : {top: 0 + pos.height + posoffset, left: 0 + pos.width / 2 - width / 2},
330
+ 'top-left' : {top: 0 - height - posoffset, left: 0},
331
+ 'top-right' : {top: 0 - height - posoffset, left: 0 + pos.width - width},
332
+ 'top-center' : {top: 0 - height - posoffset, left: 0 + pos.width / 2 - width / 2},
333
+ 'left-top' : {top: 0, left: 0 - width - posoffset},
334
+ 'left-bottom' : {top: 0 + pos.height - height, left: 0 - width - posoffset},
335
+ 'left-center' : {top: 0 + pos.height / 2 - height / 2, left: 0 - width - posoffset},
336
+ 'right-top' : {top: 0, left: 0 + pos.width + posoffset},
337
+ 'right-bottom' : {top: 0 + pos.height - height, left: 0 + pos.width + posoffset},
338
+ 'right-center' : {top: 0 + pos.height / 2 - height / 2, left: 0 + pos.width + posoffset}
331
339
  },
332
340
  css = {},
333
341
  pp;
@@ -360,6 +368,7 @@
360
368
 
361
369
  pp = fdpos.split('-');
362
370
  css = variants[fdpos] ? variants[fdpos] : variants['bottom-left'];
371
+ dropdown.addClass('uk-dropdown-autoflip');
363
372
 
364
373
  // check flipped
365
374
  if (this.checkBoundary(pos.left + css.left, pos.top + css.top, width, height, boundarywidth)) {
@@ -371,11 +380,11 @@
371
380
  }
372
381
 
373
382
  if (width > boundarywidth) {
374
- dropdown.addClass("uk-dropdown-stack");
383
+ dropdown.addClass('uk-dropdown-stack');
375
384
  this.trigger('stack.uk.dropdown', [this]);
376
385
  }
377
386
 
378
- dropdown.css(css).css("display", "").addClass('uk-dropdown-'+pp[0]);
387
+ dropdown.css(css).css('display', '').addClass('uk-dropdown-'+pp[0]);
379
388
  },
380
389
 
381
390
  checkBoundary: function(left, top, width, height, boundarywidth) {
@@ -398,9 +407,9 @@
398
407
  UI.component('dropdownOverlay', {
399
408
 
400
409
  defaults: {
401
- 'justify' : false,
402
- 'cls' : '',
403
- 'duration': 200
410
+ justify : false,
411
+ cls : '',
412
+ duration: 200
404
413
  },
405
414
 
406
415
  boot: function() {
@@ -408,11 +417,11 @@
408
417
  // init code
409
418
  UI.ready(function(context) {
410
419
 
411
- UI.$("[data-uk-dropdown-overlay]", context).each(function() {
420
+ UI.$('[data-uk-dropdown-overlay]', context).each(function() {
412
421
  var ele = UI.$(this);
413
422
 
414
- if (!ele.data("dropdownOverlay")) {
415
- UI.dropdownOverlay(ele, UI.Utils.options(ele.attr("data-uk-dropdown-overlay")));
423
+ if (!ele.data('dropdownOverlay')) {
424
+ UI.dropdownOverlay(ele, UI.Utils.options(ele.attr('data-uk-dropdown-overlay')));
416
425
  }
417
426
  });
418
427
  });
@@ -437,7 +446,7 @@
437
446
  $this.dropdown = dropdown;
438
447
 
439
448
  if ($this.justified && $this.justified.length) {
440
- justify($this.overlay.css({'display':'block', 'margin-left':'','margin-right':''}), $this.justified, $this.justified.outerWidth());
449
+ justify($this.overlay.css({display:'block', marginLeft:'', marginRight:''}), $this.justified, $this.justified.outerWidth());
441
450
  }
442
451
  },
443
452
 
@@ -507,17 +516,17 @@
507
516
 
508
517
  var jwidth = justifyTo.outerWidth();
509
518
 
510
- ele.css("min-width", jwidth);
519
+ ele.css('min-width', jwidth);
511
520
 
512
521
  if (UI.langdirection == 'right') {
513
522
 
514
523
  var right1 = boundarywidth - (justifyTo.offset().left + jwidth),
515
524
  right2 = boundarywidth - (ele.offset().left + ele.outerWidth());
516
525
 
517
- ele.css("margin-right", right1 - right2);
526
+ ele.css('margin-right', right1 - right2);
518
527
 
519
528
  } else {
520
- ele.css("margin-left", justifyTo.offset().left - offset.left);
529
+ ele.css('margin-left', justifyTo.offset().left - offset.left);
521
530
  }
522
531
  }
523
532
  }