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";
@@ -8,10 +8,10 @@
8
8
  UI.component('gridMatchHeight', {
9
9
 
10
10
  defaults: {
11
- "target" : false,
12
- "row" : true,
13
- "ignorestacked" : false,
14
- "observe" : false
11
+ target : false,
12
+ row : true,
13
+ ignorestacked : false,
14
+ observe : false
15
15
  },
16
16
 
17
17
  boot: function() {
@@ -19,11 +19,11 @@
19
19
  // init code
20
20
  UI.ready(function(context) {
21
21
 
22
- UI.$("[data-uk-grid-match]", context).each(function() {
22
+ UI.$('[data-uk-grid-match]', context).each(function() {
23
23
  var grid = UI.$(this), obj;
24
24
 
25
- if (!grid.data("gridMatchHeight")) {
26
- obj = UI.gridMatchHeight(grid, UI.Utils.options(grid.attr("data-uk-grid-match")));
25
+ if (!grid.data('gridMatchHeight')) {
26
+ obj = UI.gridMatchHeight(grid, UI.Utils.options(grid.attr('data-uk-grid-match')));
27
27
  }
28
28
  });
29
29
  });
@@ -41,7 +41,7 @@
41
41
  UI.$win.on('load resize orientationchange', (function() {
42
42
 
43
43
  var fn = function() {
44
- if ($this.element.is(":visible")) $this.match();
44
+ if ($this.element.is(':visible')) $this.match();
45
45
  };
46
46
 
47
47
  UI.$(function() { fn(); });
@@ -52,12 +52,12 @@
52
52
  if (this.options.observe) {
53
53
 
54
54
  UI.domObserve(this.element, function(e) {
55
- if ($this.element.is(":visible")) $this.match();
55
+ if ($this.element.is(':visible')) $this.match();
56
56
  });
57
57
  }
58
58
 
59
- this.on("display.uk.check", function(e) {
60
- if(this.element.is(":visible")) this.match();
59
+ this.on('display.uk.check', function(e) {
60
+ if(this.element.is(':visible')) this.match();
61
61
  }.bind(this));
62
62
 
63
63
  grids.push(this);
@@ -65,7 +65,7 @@
65
65
 
66
66
  match: function() {
67
67
 
68
- var firstvisible = this.columns.filter(":visible:first");
68
+ var firstvisible = this.columns.filter(':visible:first');
69
69
 
70
70
  if (!firstvisible.length) return;
71
71
 
@@ -98,11 +98,11 @@
98
98
  // init code
99
99
  UI.ready(function(context) {
100
100
 
101
- UI.$("[data-uk-grid-margin]", context).each(function() {
101
+ UI.$('[data-uk-grid-margin]', context).each(function() {
102
102
  var grid = UI.$(this), obj;
103
103
 
104
- if (!grid.data("gridMargin")) {
105
- obj = UI.gridMargin(grid, UI.Utils.options(grid.attr("data-uk-grid-margin")));
104
+ if (!grid.data('gridMargin')) {
105
+ obj = UI.gridMargin(grid, UI.Utils.options(grid.attr('data-uk-grid-margin')));
106
106
  }
107
107
  });
108
108
  });
@@ -1,13 +1,13 @@
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, activeCount = 0, $html = UI.$html, body;
7
7
 
8
- UI.$win.on("resize orientationchange", UI.Utils.debounce(function(){
8
+ UI.$win.on('resize orientationchange', UI.Utils.debounce(function(){
9
9
  UI.$('.uk-modal.uk-open').each(function(){
10
- UI.$(this).data('modal').resize();
10
+ return UI.$(this).data('modal') && UI.$(this).data('modal').resize();
11
11
  });
12
12
  }, 150));
13
13
 
@@ -33,18 +33,18 @@
33
33
 
34
34
  var $this = this;
35
35
 
36
- this.paddingdir = "padding-" + (UI.langdirection == 'left' ? "right":"left");
37
- this.dialog = this.find(".uk-modal-dialog");
36
+ this.paddingdir = 'padding-' + (UI.langdirection == 'left' ? 'right':'left');
37
+ this.dialog = this.find('.uk-modal-dialog');
38
38
 
39
39
  this.active = false;
40
40
 
41
41
  // Update ARIA
42
- this.element.attr('aria-hidden', this.element.hasClass("uk-open"));
42
+ this.element.attr('aria-hidden', this.element.hasClass('uk-open'));
43
43
 
44
- this.on("click", ".uk-modal-close", function(e) {
44
+ this.on('click', '.uk-modal-close', function(e) {
45
45
  e.preventDefault();
46
46
  $this.hide();
47
- }).on("click", function(e) {
47
+ }).on('click', function(e) {
48
48
 
49
49
  var target = UI.$(e.target);
50
50
 
@@ -57,7 +57,7 @@
57
57
  },
58
58
 
59
59
  toggle: function() {
60
- return this[this.isActive() ? "hide" : "show"]();
60
+ return this[this.isActive() ? 'hide' : 'show']();
61
61
  },
62
62
 
63
63
  show: function() {
@@ -72,7 +72,7 @@
72
72
  active.hide(true);
73
73
  }
74
74
 
75
- this.element.removeClass("uk-open").show();
75
+ this.element.removeClass('uk-open').show();
76
76
  this.resize(true);
77
77
 
78
78
  if (this.options.modal) {
@@ -87,17 +87,19 @@
87
87
  this.hasTransitioned = false;
88
88
  this.element.one(UI.support.transition.end, function(){
89
89
  $this.hasTransitioned = true;
90
- }).addClass("uk-open");
90
+ UI.Utils.focus($this.dialog, 'a[href]');
91
+ }).addClass('uk-open');
91
92
  } else {
92
- this.element.addClass("uk-open");
93
+ this.element.addClass('uk-open');
94
+ UI.Utils.focus(this.dialog, 'a[href]');
93
95
  }
94
96
 
95
- $html.addClass("uk-modal-page").height(); // force browser engine redraw
97
+ $html.addClass('uk-modal-page').height(); // force browser engine redraw
96
98
 
97
99
  // Update ARIA
98
100
  this.element.attr('aria-hidden', 'false');
99
101
 
100
- this.element.trigger("show.uk.modal");
102
+ this.element.trigger('show.uk.modal');
101
103
 
102
104
  UI.Utils.checkDisplay(this.dialog, true);
103
105
 
@@ -112,7 +114,7 @@
112
114
 
113
115
  this.one(UI.support.transition.end, function() {
114
116
  $this._hide();
115
- }).removeClass("uk-open");
117
+ }).removeClass('uk-open');
116
118
 
117
119
  } else {
118
120
 
@@ -140,9 +142,9 @@
140
142
  pad = parseInt(this.dialog.css('margin-top'), 10) + parseInt(this.dialog.css('margin-bottom'), 10);
141
143
 
142
144
  if ((dh + pad) < window.innerHeight) {
143
- this.dialog.css({'top': (window.innerHeight/2 - dh/2) - pad });
145
+ this.dialog.css({top: (window.innerHeight/2 - dh/2) - pad });
144
146
  } else {
145
- this.dialog.css({'top': ''});
147
+ this.dialog.css({top: ''});
146
148
  }
147
149
  }
148
150
  },
@@ -162,8 +164,8 @@
162
164
  h = wh - 2*(offset < 20 ? 20:offset) - dh;
163
165
 
164
166
  scrollable.css({
165
- 'max-height': (h < this.options.minScrollHeight ? '':h),
166
- 'height':''
167
+ maxHeight: (h < this.options.minScrollHeight ? '':h),
168
+ height:''
167
169
  });
168
170
 
169
171
  return true;
@@ -204,16 +206,16 @@
204
206
  boot: function() {
205
207
 
206
208
  // init code
207
- UI.$html.on("click.modal.uikit", "[data-uk-modal]", function(e) {
209
+ UI.$html.on('click.modal.uikit', '[data-uk-modal]', function(e) {
208
210
 
209
211
  var ele = UI.$(this);
210
212
 
211
- if (ele.is("a")) {
213
+ if (ele.is('a')) {
212
214
  e.preventDefault();
213
215
  }
214
216
 
215
- if (!ele.data("modalTrigger")) {
216
- var modal = UI.modalTrigger(ele, UI.Utils.options(ele.attr("data-uk-modal")));
217
+ if (!ele.data('modalTrigger')) {
218
+ var modal = UI.modalTrigger(ele, UI.Utils.options(ele.attr('data-uk-modal')));
217
219
  modal.show();
218
220
  }
219
221
 
@@ -234,7 +236,7 @@
234
236
  var $this = this;
235
237
 
236
238
  this.options = UI.$.extend({
237
- "target": $this.element.is("a") ? $this.element.attr("href") : false
239
+ target: $this.element.is('a') ? $this.element.attr('href') : false
238
240
  }, this.options);
239
241
 
240
242
  this.modal = UI.modal(this.options.target, this.options);
@@ -245,17 +247,17 @@
245
247
  });
246
248
 
247
249
  //methods
248
- this.proxy(this.modal, "show hide isActive");
250
+ this.proxy(this.modal, 'show hide isActive');
249
251
  }
250
252
  });
251
253
 
252
254
  UI.modal.dialog = function(content, options) {
253
255
 
254
- var modal = UI.modal(UI.$(UI.modal.dialog.template).appendTo("body"), options);
256
+ var modal = UI.modal(UI.$(UI.modal.dialog.template).appendTo('body'), options);
255
257
 
256
- modal.on("hide.uk.modal", function(){
258
+ modal.on('hide.uk.modal', function(){
257
259
  if (modal.persist) {
258
- modal.persist.appendTo(modal.persist.data("modalPersistParent"));
260
+ modal.persist.appendTo(modal.persist.data('modalPersistParent'));
259
261
  modal.persist = false;
260
262
  }
261
263
  modal.element.remove();
@@ -326,22 +328,16 @@
326
328
 
327
329
  input = modal.element.find("input[type='text']").val(value || '').on('keyup', function(e){
328
330
  if (e.keyCode == 13) {
329
- modal.element.find(".js-modal-ok").trigger('click');
331
+ modal.element.find('.js-modal-ok').trigger('click');
330
332
  }
331
333
  });
332
334
 
333
- modal.element.find(".js-modal-ok").on("click", function(){
335
+ modal.element.find('.js-modal-ok').on('click', function(){
334
336
  if (onsubmit(input.val())!==false){
335
337
  modal.hide();
336
338
  }
337
339
  });
338
340
 
339
- modal.on('show.uk.modal', function(){
340
- setTimeout(function(){
341
- input.focus();
342
- }, 50);
343
- });
344
-
345
341
  return modal.show();
346
342
  };
347
343
 
@@ -356,13 +352,11 @@
356
352
  return modal.show();
357
353
  };
358
354
 
359
-
360
355
  UI.modal.labels = {
361
- 'Ok': 'Ok',
362
- 'Cancel': 'Cancel'
356
+ Ok: 'Ok',
357
+ Cancel: 'Cancel'
363
358
  };
364
359
 
365
-
366
360
  // helper functions
367
361
  function setContent(content, modal){
368
362
 
@@ -375,7 +369,7 @@
375
369
 
376
370
  if(content.parent().length) {
377
371
  modal.persist = content;
378
- modal.persist.data("modalPersistParent", content.parent());
372
+ modal.persist.data('modalPersistParent', content.parent());
379
373
  }
380
374
  }else if (typeof content === 'string' || typeof content === 'number') {
381
375
  // just insert the data as innerHTML
@@ -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";
@@ -6,9 +6,9 @@
6
6
  UI.component('nav', {
7
7
 
8
8
  defaults: {
9
- "toggle": ">li.uk-parent > a[href='#']",
10
- "lists": ">li.uk-parent > ul",
11
- "multiple": false
9
+ toggle: '>li.uk-parent > a[href="#"]',
10
+ lists: '>li.uk-parent > ul',
11
+ multiple: false
12
12
  },
13
13
 
14
14
  boot: function() {
@@ -16,11 +16,11 @@
16
16
  // init code
17
17
  UI.ready(function(context) {
18
18
 
19
- UI.$("[data-uk-nav]", context).each(function() {
19
+ UI.$('[data-uk-nav]', context).each(function() {
20
20
  var nav = UI.$(this);
21
21
 
22
- if (!nav.data("nav")) {
23
- var obj = UI.nav(nav, UI.Utils.options(nav.attr("data-uk-nav")));
22
+ if (!nav.data('nav')) {
23
+ var obj = UI.nav(nav, UI.Utils.options(nav.attr('data-uk-nav')));
24
24
  }
25
25
  });
26
26
  });
@@ -30,26 +30,41 @@
30
30
 
31
31
  var $this = this;
32
32
 
33
- this.on("click.uk.nav", this.options.toggle, function(e) {
33
+ this.on('click.uk.nav', this.options.toggle, function(e) {
34
34
  e.preventDefault();
35
35
  var ele = UI.$(this);
36
36
  $this.open(ele.parent()[0] == $this.element[0] ? ele : ele.parent("li"));
37
37
  });
38
38
 
39
+ this.update();
40
+
41
+ UI.domObserve(this.element, function(e) {
42
+ if ($this.element.find($this.options.lists).not('[role]').length) {
43
+ $this.update();
44
+ }
45
+ });
46
+ },
47
+
48
+ update: function() {
49
+
50
+ var $this = this;
51
+
39
52
  this.find(this.options.lists).each(function() {
40
- var $ele = UI.$(this),
41
- parent = $ele.parent(),
53
+
54
+ var $ele = UI.$(this).attr('role', 'menu'),
55
+ parent = $ele.closest('li'),
42
56
  active = parent.hasClass("uk-active");
43
57
 
44
- $ele.wrap('<div style="overflow:hidden;height:0;position:relative;"></div>');
45
- parent.data("list-container", $ele.parent()[active ? 'removeClass':'addClass']('uk-hidden'));
58
+ if (!parent.data('list-container')) {
59
+ $ele.wrap('<div style="overflow:hidden;height:0;position:relative;"></div>');
60
+ parent.data('list-container', $ele.parent()[active ? 'removeClass':'addClass']('uk-hidden'));
61
+ }
46
62
 
47
63
  // Init ARIA
48
64
  parent.attr('aria-expanded', parent.hasClass("uk-open"));
49
65
 
50
66
  if (active) $this.open(parent, true);
51
67
  });
52
-
53
68
  },
54
69
 
55
70
  open: function(li, noanimation) {
@@ -114,15 +129,17 @@
114
129
  // helper
115
130
 
116
131
  function getHeight(ele) {
117
- var $ele = UI.$(ele), height = "auto";
118
132
 
119
- if ($ele.is(":visible")) {
133
+ var $ele = UI.$(ele), height = 'auto';
134
+
135
+ if ($ele.is(':visible')) {
120
136
  height = $ele.outerHeight();
121
137
  } else {
138
+
122
139
  var tmp = {
123
- position: $ele.css("position"),
124
- visibility: $ele.css("visibility"),
125
- display: $ele.css("display")
140
+ position: $ele.css('position'),
141
+ visibility: $ele.css('visibility'),
142
+ display: $ele.css('display')
126
143
  };
127
144
 
128
145
  height = $ele.css({position: 'absolute', visibility: 'hidden', display: 'block'}).outerHeight();
@@ -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";
@@ -9,30 +9,41 @@
9
9
  $html = UI.$html,
10
10
  Offcanvas = {
11
11
 
12
- show: function(element) {
12
+ show: function(element, options) {
13
13
 
14
14
  element = UI.$(element);
15
15
 
16
16
  if (!element.length) return;
17
17
 
18
+ options = UI.$.extend({mode: 'push'}, options);
19
+
18
20
  var $body = UI.$('body'),
19
- bar = element.find(".uk-offcanvas-bar:first"),
20
- rtl = (UI.langdirection == "right"),
21
- flip = bar.hasClass("uk-offcanvas-bar-flip") ? -1:1,
21
+ bar = element.find('.uk-offcanvas-bar:first'),
22
+ rtl = (UI.langdirection == 'right'),
23
+ flip = bar.hasClass('uk-offcanvas-bar-flip') ? -1:1,
22
24
  dir = flip * (rtl ? -1 : 1),
23
25
 
24
26
  scrollbarwidth = window.innerWidth - $body.width();
25
27
 
26
28
  scrollpos = {x: window.pageXOffset, y: window.pageYOffset};
27
29
 
28
- element.addClass("uk-active");
30
+ bar.attr('mode', options.mode);
31
+ element.addClass('uk-active');
32
+
33
+ $body.css({width: window.innerWidth - scrollbarwidth, height: window.innerHeight}).addClass('uk-offcanvas-page');
34
+
35
+ if (options.mode == 'push' || options.mode == 'reveal') {
36
+ $body.css((rtl ? 'margin-right' : 'margin-left'), (rtl ? -1 : 1) * (bar.outerWidth() * dir));
37
+ }
38
+
39
+ if (options.mode == 'reveal') {
40
+ bar.css('clip', 'rect(0, '+bar.outerWidth()+'px, 100vh, 0)');
41
+ }
29
42
 
30
- $body.css({"width": window.innerWidth - scrollbarwidth, "height": window.innerHeight}).addClass("uk-offcanvas-page");
31
- $body.css((rtl ? "margin-right" : "margin-left"), (rtl ? -1 : 1) * (bar.outerWidth() * dir)).width(); // .width() - force redraw
43
+ $html.css('margin-top', scrollpos.y * -1).width(); // .width() - force redraw
32
44
 
33
- $html.css('margin-top', scrollpos.y * -1);
34
45
 
35
- bar.addClass("uk-offcanvas-bar-show");
46
+ bar.addClass('uk-offcanvas-bar-show');
36
47
 
37
48
  this._initElement(element);
38
49
 
@@ -45,14 +56,14 @@
45
56
  hide: function(force) {
46
57
 
47
58
  var $body = UI.$('body'),
48
- panel = UI.$(".uk-offcanvas.uk-active"),
49
- rtl = (UI.langdirection == "right"),
50
- bar = panel.find(".uk-offcanvas-bar:first"),
59
+ panel = UI.$('.uk-offcanvas.uk-active'),
60
+ rtl = (UI.langdirection == 'right'),
61
+ bar = panel.find('.uk-offcanvas-bar:first'),
51
62
  finalize = function() {
52
- $body.removeClass("uk-offcanvas-page").css({"width": "", "height": "", "margin-left": "", "margin-right": ""});
53
- panel.removeClass("uk-active");
63
+ $body.removeClass('uk-offcanvas-page').css({width: '', height: '', marginLeft: '', marginRight: ''});
64
+ panel.removeClass('uk-active');
54
65
 
55
- bar.removeClass("uk-offcanvas-bar-show");
66
+ bar.removeClass('uk-offcanvas-bar-show');
56
67
  $html.css('margin-top', '');
57
68
  window.scrollTo(scrollpos.x, scrollpos.y);
58
69
  bar.trigger('hide.uk.offcanvas', [panel, bar]);
@@ -62,15 +73,20 @@
62
73
  };
63
74
 
64
75
  if (!panel.length) return;
76
+ if (bar.attr('mode') == 'none') force = true;
65
77
 
66
78
  if (UI.support.transition && !force) {
67
79
 
68
80
  $body.one(UI.support.transition.end, function() {
69
81
  finalize();
70
- }).css((rtl ? "margin-right" : "margin-left"), "");
82
+ }).css((rtl ? 'margin-right' : 'margin-left'), '');
83
+
84
+ if (bar.attr('mode') == 'reveal') {
85
+ bar.css('clip', '');
86
+ }
71
87
 
72
88
  setTimeout(function(){
73
- bar.removeClass("uk-offcanvas-bar-show");
89
+ bar.removeClass('uk-offcanvas-bar-show');
74
90
  }, 0);
75
91
 
76
92
  } else {
@@ -80,17 +96,17 @@
80
96
 
81
97
  _initElement: function(element) {
82
98
 
83
- if (element.data("OffcanvasInit")) return;
99
+ if (element.data('OffcanvasInit')) return;
84
100
 
85
- element.on("click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas", function(e) {
101
+ element.on('click.uk.offcanvas swipeRight.uk.offcanvas swipeLeft.uk.offcanvas', function(e) {
86
102
 
87
103
  var target = UI.$(e.target);
88
104
 
89
105
  if (!e.type.match(/swipe/)) {
90
106
 
91
- if (!target.hasClass("uk-offcanvas-close")) {
92
- if (target.hasClass("uk-offcanvas-bar")) return;
93
- if (target.parents(".uk-offcanvas-bar:first").length) return;
107
+ if (!target.hasClass('uk-offcanvas-close')) {
108
+ if (target.hasClass('uk-offcanvas-bar')) return;
109
+ if (target.parents('.uk-offcanvas-bar:first').length) return;
94
110
  }
95
111
  }
96
112
 
@@ -98,12 +114,12 @@
98
114
  Offcanvas.hide();
99
115
  });
100
116
 
101
- element.on("click", "a[href*='#']", function(e){
117
+ element.on('click', 'a[href*="#"]', function(e){
102
118
 
103
119
  var link = UI.$(this),
104
- href = link.attr("href");
120
+ href = link.attr('href');
105
121
 
106
- if (href == "#") {
122
+ if (href == '#') {
107
123
  return;
108
124
  }
109
125
 
@@ -131,7 +147,7 @@
131
147
  Offcanvas.hide();
132
148
  });
133
149
 
134
- element.data("OffcanvasInit", true);
150
+ element.data('OffcanvasInit', true);
135
151
  }
136
152
  };
137
153
 
@@ -140,14 +156,14 @@
140
156
  boot: function() {
141
157
 
142
158
  // init code
143
- $html.on("click.offcanvas.uikit", "[data-uk-offcanvas]", function(e) {
159
+ $html.on('click.offcanvas.uikit', '[data-uk-offcanvas]', function(e) {
144
160
 
145
161
  e.preventDefault();
146
162
 
147
163
  var ele = UI.$(this);
148
164
 
149
- if (!ele.data("offcanvasTrigger")) {
150
- var obj = UI.offcanvasTrigger(ele, UI.Utils.options(ele.attr("data-uk-offcanvas")));
165
+ if (!ele.data('offcanvasTrigger')) {
166
+ var obj = UI.offcanvasTrigger(ele, UI.Utils.options(ele.attr('data-uk-offcanvas')));
151
167
  ele.trigger("click");
152
168
  }
153
169
  });
@@ -165,12 +181,13 @@
165
181
  var $this = this;
166
182
 
167
183
  this.options = UI.$.extend({
168
- "target": $this.element.is("a") ? $this.element.attr("href") : false
184
+ target: $this.element.is('a') ? $this.element.attr('href') : false,
185
+ mode: 'push'
169
186
  }, this.options);
170
187
 
171
- this.on("click", function(e) {
188
+ this.on('click', function(e) {
172
189
  e.preventDefault();
173
- Offcanvas.show($this.options.target);
190
+ Offcanvas.show($this.options.target, $this.options);
174
191
  });
175
192
  }
176
193
  });