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.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/uikit2/rails/version.rb +1 -1
- data/vendor/assets/fonts/FontAwesome.otf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.ttf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.woff2 +0 -0
- data/vendor/assets/javascripts/uikit.js +512 -425
- data/vendor/assets/javascripts/uikit/components/accordion.js +19 -13
- data/vendor/assets/javascripts/uikit/components/autocomplete.js +23 -17
- data/vendor/assets/javascripts/uikit/components/datepicker.js +25 -24
- data/vendor/assets/javascripts/uikit/components/form-password.js +16 -16
- data/vendor/assets/javascripts/uikit/components/form-select.js +33 -25
- data/vendor/assets/javascripts/uikit/components/grid-parallax.js +12 -12
- data/vendor/assets/javascripts/uikit/components/grid.js +47 -34
- data/vendor/assets/javascripts/uikit/components/htmleditor.js +47 -3
- data/vendor/assets/javascripts/uikit/components/lightbox.js +68 -70
- data/vendor/assets/javascripts/uikit/components/nestable.js +6 -6
- data/vendor/assets/javascripts/uikit/components/notify.js +9 -9
- data/vendor/assets/javascripts/uikit/components/pagination.js +8 -8
- data/vendor/assets/javascripts/uikit/components/parallax.js +13 -13
- data/vendor/assets/javascripts/uikit/components/search.js +11 -11
- data/vendor/assets/javascripts/uikit/components/slider.js +27 -15
- data/vendor/assets/javascripts/uikit/components/slideset.js +21 -12
- data/vendor/assets/javascripts/uikit/components/slideshow-fx.js +35 -28
- data/vendor/assets/javascripts/uikit/components/slideshow.js +129 -95
- data/vendor/assets/javascripts/uikit/components/sortable.js +45 -36
- data/vendor/assets/javascripts/uikit/components/sticky.js +19 -13
- data/vendor/assets/javascripts/uikit/components/timepicker.js +6 -6
- data/vendor/assets/javascripts/uikit/components/tooltip.js +47 -46
- data/vendor/assets/javascripts/uikit/components/upload.js +46 -44
- data/vendor/assets/javascripts/uikit/core/alert.js +17 -17
- data/vendor/assets/javascripts/uikit/core/button.js +25 -26
- data/vendor/assets/javascripts/uikit/core/core.js +58 -23
- data/vendor/assets/javascripts/uikit/core/cover.js +9 -17
- data/vendor/assets/javascripts/uikit/core/dropdown.js +108 -99
- data/vendor/assets/javascripts/uikit/core/grid.js +16 -16
- data/vendor/assets/javascripts/uikit/core/modal.js +35 -41
- data/vendor/assets/javascripts/uikit/core/nav.js +35 -18
- data/vendor/assets/javascripts/uikit/core/offcanvas.js +50 -33
- data/vendor/assets/javascripts/uikit/core/scrollspy.js +33 -33
- data/vendor/assets/javascripts/uikit/core/smooth-scroll.js +8 -8
- data/vendor/assets/javascripts/uikit/core/switcher.js +54 -52
- data/vendor/assets/javascripts/uikit/core/tab.js +27 -25
- data/vendor/assets/javascripts/uikit/core/toggle.js +12 -8
- data/vendor/assets/javascripts/uikit/core/touch.js +3 -3
- data/vendor/assets/javascripts/uikit/core/utility.js +35 -19
- data/vendor/assets/stylesheets/uikit.almost-flat.css +299 -242
- data/vendor/assets/stylesheets/uikit.css +280 -223
- data/vendor/assets/stylesheets/uikit.gradient.css +309 -252
- data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.css +2 -2
- data/vendor/assets/stylesheets/uikit/components/accordion.css +2 -2
- data/vendor/assets/stylesheets/uikit/components/accordion.gradient.css +2 -2
- data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.css +5 -5
- data/vendor/assets/stylesheets/uikit/components/autocomplete.css +5 -5
- data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.css +5 -5
- data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.css +10 -10
- data/vendor/assets/stylesheets/uikit/components/datepicker.css +10 -10
- data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.css +9 -9
- data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/dotnav.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.css +5 -5
- data/vendor/assets/stylesheets/uikit/components/form-advanced.css +5 -5
- data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.css +5 -5
- data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/form-file.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/form-file.gradient.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.css +3 -3
- data/vendor/assets/stylesheets/uikit/components/form-password.css +3 -3
- data/vendor/assets/stylesheets/uikit/components/form-password.gradient.css +3 -3
- data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/form-select.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/form-select.gradient.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.css +12 -12
- data/vendor/assets/stylesheets/uikit/components/htmleditor.css +12 -12
- data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.css +13 -13
- data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.css +7 -3
- data/vendor/assets/stylesheets/uikit/components/nestable.css +6 -2
- data/vendor/assets/stylesheets/uikit/components/nestable.gradient.css +9 -5
- data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.css +4 -4
- data/vendor/assets/stylesheets/uikit/components/notify.css +3 -3
- data/vendor/assets/stylesheets/uikit/components/notify.gradient.css +4 -4
- data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.css +3 -3
- data/vendor/assets/stylesheets/uikit/components/placeholder.css +3 -3
- data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.css +3 -3
- data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.css +2 -2
- data/vendor/assets/stylesheets/uikit/components/progress.css +3 -3
- data/vendor/assets/stylesheets/uikit/components/progress.gradient.css +2 -2
- data/vendor/assets/stylesheets/uikit/components/search.almost-flat.css +18 -18
- data/vendor/assets/stylesheets/uikit/components/search.css +17 -17
- data/vendor/assets/stylesheets/uikit/components/search.gradient.css +18 -18
- data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/slidenav.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.css +10 -1
- data/vendor/assets/stylesheets/uikit/components/slider.css +10 -1
- data/vendor/assets/stylesheets/uikit/components/slider.gradient.css +10 -1
- data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/slideshow.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.css +5 -1
- data/vendor/assets/stylesheets/uikit/components/sortable.css +5 -1
- data/vendor/assets/stylesheets/uikit/components/sortable.gradient.css +5 -1
- data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.css +4 -1
- data/vendor/assets/stylesheets/uikit/components/sticky.css +4 -1
- data/vendor/assets/stylesheets/uikit/components/sticky.gradient.css +4 -1
- data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.css +8 -7
- data/vendor/assets/stylesheets/uikit/components/tooltip.css +8 -7
- data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.css +8 -7
- data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/upload.css +1 -1
- data/vendor/assets/stylesheets/uikit/components/upload.gradient.css +1 -1
- metadata +2 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! UIkit 2.
|
1
|
+
/*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
2
|
(function(addon) {
|
3
3
|
|
4
4
|
var component;
|
@@ -7,8 +7,8 @@
|
|
7
7
|
component = addon(UIkit);
|
8
8
|
}
|
9
9
|
|
10
|
-
if (typeof define ==
|
11
|
-
define(
|
10
|
+
if (typeof define == 'function' && define.amd) {
|
11
|
+
define('uikit-upload', ['uikit'], function(){
|
12
12
|
return component || addon(UIkit);
|
13
13
|
});
|
14
14
|
}
|
@@ -23,7 +23,7 @@
|
|
23
23
|
|
24
24
|
var $this = this;
|
25
25
|
|
26
|
-
this.on(
|
26
|
+
this.on('change', function() {
|
27
27
|
xhrupload($this.element[0].files, $this.options);
|
28
28
|
var twin = $this.element.clone(true).data('uploadSelect', $this);
|
29
29
|
$this.element.replaceWith(twin);
|
@@ -42,23 +42,23 @@
|
|
42
42
|
|
43
43
|
var $this = this, hasdragCls = false;
|
44
44
|
|
45
|
-
this.on(
|
45
|
+
this.on('drop', function(e){
|
46
46
|
|
47
|
-
if (e.dataTransfer && e.dataTransfer.files) {
|
47
|
+
if (e.originalEvent.dataTransfer && e.originalEvent.dataTransfer.files) {
|
48
48
|
|
49
49
|
e.stopPropagation();
|
50
50
|
e.preventDefault();
|
51
51
|
|
52
52
|
$this.element.removeClass($this.options.dragoverClass);
|
53
|
-
$this.element.trigger('dropped.uk.upload', [e.dataTransfer.files]);
|
53
|
+
$this.element.trigger('dropped.uk.upload', [e.originalEvent.dataTransfer.files]);
|
54
54
|
|
55
|
-
xhrupload(e.dataTransfer.files, $this.options);
|
55
|
+
xhrupload(e.originalEvent.dataTransfer.files, $this.options);
|
56
56
|
}
|
57
57
|
|
58
|
-
}).on(
|
58
|
+
}).on('dragenter', function(e){
|
59
59
|
e.stopPropagation();
|
60
60
|
e.preventDefault();
|
61
|
-
}).on(
|
61
|
+
}).on('dragover', function(e){
|
62
62
|
e.stopPropagation();
|
63
63
|
e.preventDefault();
|
64
64
|
|
@@ -66,7 +66,7 @@
|
|
66
66
|
$this.element.addClass($this.options.dragoverClass);
|
67
67
|
hasdragCls = true;
|
68
68
|
}
|
69
|
-
}).on(
|
69
|
+
}).on('dragleave', function(e){
|
70
70
|
e.stopPropagation();
|
71
71
|
e.preventDefault();
|
72
72
|
$this.element.removeClass($this.options.dragoverClass);
|
@@ -93,9 +93,6 @@
|
|
93
93
|
return supportFileAPI() && supportAjaxUploadProgressEvents() && supportFormData();
|
94
94
|
})();
|
95
95
|
|
96
|
-
if (UI.support.ajaxupload){
|
97
|
-
UI.$.event.props.push("dataTransfer");
|
98
|
-
}
|
99
96
|
|
100
97
|
function xhrupload(files, settings) {
|
101
98
|
|
@@ -175,21 +172,25 @@
|
|
175
172
|
for (var p in settings.params) { formData.append(p, settings.params[p]); }
|
176
173
|
|
177
174
|
// Add any event handlers here...
|
178
|
-
xhr.upload.addEventListener(
|
175
|
+
xhr.upload.addEventListener('progress', function(e){
|
179
176
|
var percent = (e.loaded / e.total)*100;
|
180
177
|
settings.progress(percent, e);
|
181
178
|
}, false);
|
182
179
|
|
183
|
-
xhr.addEventListener(
|
184
|
-
xhr.addEventListener(
|
185
|
-
xhr.addEventListener(
|
186
|
-
xhr.addEventListener(
|
187
|
-
xhr.addEventListener(
|
180
|
+
xhr.addEventListener('loadstart', function(e){ settings.loadstart(e); }, false);
|
181
|
+
xhr.addEventListener('load', function(e){ settings.load(e); }, false);
|
182
|
+
xhr.addEventListener('loadend', function(e){ settings.loadend(e); }, false);
|
183
|
+
xhr.addEventListener('error', function(e){ settings.error(e); }, false);
|
184
|
+
xhr.addEventListener('abort', function(e){ settings.abort(e); }, false);
|
188
185
|
|
189
186
|
xhr.open(settings.method, settings.action, true);
|
190
187
|
|
191
|
-
if (settings.type==
|
192
|
-
xhr.setRequestHeader(
|
188
|
+
if (settings.type=='json') {
|
189
|
+
xhr.setRequestHeader('Accept', 'application/json');
|
190
|
+
}
|
191
|
+
|
192
|
+
for (var h in settings.headers) {
|
193
|
+
xhr.setRequestHeader(h, settings.headers[h]);
|
193
194
|
}
|
194
195
|
|
195
196
|
xhr.onreadystatechange = function() {
|
@@ -200,7 +201,7 @@
|
|
200
201
|
|
201
202
|
var response = xhr.responseText;
|
202
203
|
|
203
|
-
if (settings.type==
|
204
|
+
if (settings.type=='json') {
|
204
205
|
try {
|
205
206
|
response = UI.$.parseJSON(response);
|
206
207
|
} catch(e) {
|
@@ -217,29 +218,30 @@
|
|
217
218
|
}
|
218
219
|
|
219
220
|
xhrupload.defaults = {
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
221
|
+
action: '',
|
222
|
+
single: true,
|
223
|
+
method: 'POST',
|
224
|
+
param : 'files[]',
|
225
|
+
params: {},
|
226
|
+
allow : '*.*',
|
227
|
+
type : 'text',
|
228
|
+
filelimit: false,
|
229
|
+
headers: {},
|
228
230
|
|
229
231
|
// events
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
232
|
+
before : function(o){},
|
233
|
+
beforeSend : function(xhr){},
|
234
|
+
beforeAll : function(){},
|
235
|
+
loadstart : function(){},
|
236
|
+
load : function(){},
|
237
|
+
loadend : function(){},
|
238
|
+
error : function(){},
|
239
|
+
abort : function(){},
|
240
|
+
progress : function(){},
|
241
|
+
complete : function(){},
|
242
|
+
allcomplete : function(){},
|
243
|
+
readystatechange: function(){},
|
244
|
+
notallowed : function(file, settings){ alert('Only the following file types are allowed: '+settings.allow); }
|
243
245
|
};
|
244
246
|
|
245
247
|
function matchName(pattern, path) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! UIkit 2.
|
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,21 +6,21 @@
|
|
6
6
|
UI.component('alert', {
|
7
7
|
|
8
8
|
defaults: {
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
fade: true,
|
10
|
+
duration: 200,
|
11
|
+
trigger: '.uk-alert-close'
|
12
12
|
},
|
13
13
|
|
14
14
|
boot: function() {
|
15
15
|
|
16
16
|
// init code
|
17
|
-
UI.$html.on(
|
17
|
+
UI.$html.on('click.alert.uikit', '[data-uk-alert]', function(e) {
|
18
18
|
|
19
19
|
var ele = UI.$(this);
|
20
20
|
|
21
|
-
if (!ele.data(
|
21
|
+
if (!ele.data('alert')) {
|
22
22
|
|
23
|
-
var alert = UI.alert(ele, UI.Utils.options(ele.attr(
|
23
|
+
var alert = UI.alert(ele, UI.Utils.options(ele.attr('data-uk-alert')));
|
24
24
|
|
25
25
|
if (UI.$(e.target).is(alert.options.trigger)) {
|
26
26
|
e.preventDefault();
|
@@ -34,7 +34,7 @@
|
|
34
34
|
|
35
35
|
var $this = this;
|
36
36
|
|
37
|
-
this.on(
|
37
|
+
this.on('click', this.options.trigger, function(e) {
|
38
38
|
e.preventDefault();
|
39
39
|
$this.close();
|
40
40
|
});
|
@@ -42,19 +42,19 @@
|
|
42
42
|
|
43
43
|
close: function() {
|
44
44
|
|
45
|
-
var element = this.trigger(
|
45
|
+
var element = this.trigger('close.uk.alert'),
|
46
46
|
removeElement = function () {
|
47
|
-
this.trigger(
|
47
|
+
this.trigger('closed.uk.alert').remove();
|
48
48
|
}.bind(this);
|
49
49
|
|
50
50
|
if (this.options.fade) {
|
51
|
-
element.css(
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
51
|
+
element.css('overflow', 'hidden').css("max-height", element.height()).animate({
|
52
|
+
height : 0,
|
53
|
+
opacity : 0,
|
54
|
+
paddingTop : 0,
|
55
|
+
paddingBottom : 0,
|
56
|
+
marginTop : 0,
|
57
|
+
marginBottom : 0
|
58
58
|
}, this.options.duration, removeElement);
|
59
59
|
} else {
|
60
60
|
removeElement();
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! UIkit 2.
|
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,24 +6,24 @@
|
|
6
6
|
UI.component('buttonRadio', {
|
7
7
|
|
8
8
|
defaults: {
|
9
|
-
|
10
|
-
|
9
|
+
activeClass: 'uk-active',
|
10
|
+
target: '.uk-button'
|
11
11
|
},
|
12
12
|
|
13
13
|
boot: function() {
|
14
14
|
|
15
15
|
// init code
|
16
|
-
UI.$html.on(
|
16
|
+
UI.$html.on('click.buttonradio.uikit', '[data-uk-button-radio]', function(e) {
|
17
17
|
|
18
18
|
var ele = UI.$(this);
|
19
19
|
|
20
|
-
if (!ele.data(
|
20
|
+
if (!ele.data('buttonRadio')) {
|
21
21
|
|
22
|
-
var obj = UI.buttonRadio(ele, UI.Utils.options(ele.attr(
|
22
|
+
var obj = UI.buttonRadio(ele, UI.Utils.options(ele.attr('data-uk-button-radio'))),
|
23
23
|
target = UI.$(e.target);
|
24
24
|
|
25
25
|
if (target.is(obj.options.target)) {
|
26
|
-
target.trigger(
|
26
|
+
target.trigger('click');
|
27
27
|
}
|
28
28
|
}
|
29
29
|
});
|
@@ -36,7 +36,7 @@
|
|
36
36
|
// Init ARIA
|
37
37
|
this.find($this.options.target).attr('aria-checked', 'false').filter('.' + $this.options.activeClass).attr('aria-checked', 'true');
|
38
38
|
|
39
|
-
this.on(
|
39
|
+
this.on('click', this.options.target, function(e) {
|
40
40
|
|
41
41
|
var ele = UI.$(this);
|
42
42
|
|
@@ -49,7 +49,7 @@
|
|
49
49
|
$this.find($this.options.target).not(ele).attr('aria-checked', 'false');
|
50
50
|
ele.attr('aria-checked', 'true');
|
51
51
|
|
52
|
-
$this.trigger(
|
52
|
+
$this.trigger('change.uk.button', [ele]);
|
53
53
|
});
|
54
54
|
|
55
55
|
},
|
@@ -62,22 +62,22 @@
|
|
62
62
|
UI.component('buttonCheckbox', {
|
63
63
|
|
64
64
|
defaults: {
|
65
|
-
|
66
|
-
|
65
|
+
activeClass: 'uk-active',
|
66
|
+
target: '.uk-button'
|
67
67
|
},
|
68
68
|
|
69
69
|
boot: function() {
|
70
70
|
|
71
|
-
UI.$html.on(
|
71
|
+
UI.$html.on('click.buttoncheckbox.uikit', '[data-uk-button-checkbox]', function(e) {
|
72
72
|
var ele = UI.$(this);
|
73
73
|
|
74
|
-
if (!ele.data(
|
74
|
+
if (!ele.data('buttonCheckbox')) {
|
75
75
|
|
76
|
-
var obj = UI.buttonCheckbox(ele, UI.Utils.options(ele.attr(
|
76
|
+
var obj = UI.buttonCheckbox(ele, UI.Utils.options(ele.attr('data-uk-button-checkbox'))),
|
77
77
|
target = UI.$(e.target);
|
78
78
|
|
79
79
|
if (target.is(obj.options.target)) {
|
80
|
-
target.trigger(
|
80
|
+
target.trigger('click');
|
81
81
|
}
|
82
82
|
}
|
83
83
|
});
|
@@ -90,7 +90,7 @@
|
|
90
90
|
// Init ARIA
|
91
91
|
this.find($this.options.target).attr('aria-checked', 'false').filter('.' + $this.options.activeClass).attr('aria-checked', 'true');
|
92
92
|
|
93
|
-
this.on(
|
93
|
+
this.on('click', this.options.target, function(e) {
|
94
94
|
var ele = UI.$(this);
|
95
95
|
|
96
96
|
if (ele.is('a[href="#"]')) e.preventDefault();
|
@@ -100,7 +100,7 @@
|
|
100
100
|
// Update ARIA
|
101
101
|
ele.attr('aria-checked', ele.hasClass($this.options.activeClass));
|
102
102
|
|
103
|
-
$this.trigger(
|
103
|
+
$this.trigger('change.uk.button', [ele]);
|
104
104
|
});
|
105
105
|
|
106
106
|
},
|
@@ -117,13 +117,13 @@
|
|
117
117
|
|
118
118
|
boot: function() {
|
119
119
|
|
120
|
-
UI.$html.on(
|
120
|
+
UI.$html.on('click.button.uikit', '[data-uk-button]', function(e) {
|
121
121
|
var ele = UI.$(this);
|
122
122
|
|
123
|
-
if (!ele.data(
|
123
|
+
if (!ele.data('button')) {
|
124
124
|
|
125
|
-
var obj = UI.button(ele, UI.Utils.options(ele.attr(
|
126
|
-
ele.trigger(
|
125
|
+
var obj = UI.button(ele, UI.Utils.options(ele.attr('data-uk-button')));
|
126
|
+
ele.trigger('click');
|
127
127
|
}
|
128
128
|
});
|
129
129
|
},
|
@@ -135,23 +135,22 @@
|
|
135
135
|
// Init ARIA
|
136
136
|
this.element.attr('aria-pressed', this.element.hasClass("uk-active"));
|
137
137
|
|
138
|
-
this.on(
|
138
|
+
this.on('click', function(e) {
|
139
139
|
|
140
140
|
if ($this.element.is('a[href="#"]')) e.preventDefault();
|
141
141
|
|
142
142
|
$this.toggle();
|
143
|
-
$this.trigger(
|
143
|
+
$this.trigger('change.uk.button', [$this.element.blur().hasClass('uk-active')]);
|
144
144
|
});
|
145
145
|
|
146
146
|
},
|
147
147
|
|
148
148
|
toggle: function() {
|
149
|
-
this.element.toggleClass(
|
149
|
+
this.element.toggleClass('uk-active');
|
150
150
|
|
151
151
|
// Update ARIA
|
152
|
-
this.element.attr('aria-pressed', this.element.hasClass(
|
152
|
+
this.element.attr('aria-pressed', this.element.hasClass('uk-active'));
|
153
153
|
}
|
154
154
|
});
|
155
155
|
|
156
156
|
})(UIkit);
|
157
|
-
|
@@ -1,18 +1,18 @@
|
|
1
|
-
/*! UIkit 2.
|
1
|
+
/*! UIkit 2.27.2 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
2
|
(function(core) {
|
3
3
|
|
4
|
-
if (typeof define ==
|
4
|
+
if (typeof define == 'function' && define.amd) { // AMD
|
5
5
|
|
6
|
-
define(
|
6
|
+
define('uikit', function(){
|
7
7
|
|
8
8
|
var uikit = window.UIkit || core(window, window.jQuery, window.document);
|
9
9
|
|
10
10
|
uikit.load = function(res, req, onload, config) {
|
11
11
|
|
12
|
-
var resources = res.split(','), load = [], i, base = (config.config && config.config.uikit && config.config.uikit.base ? config.config.uikit.base :
|
12
|
+
var resources = res.split(','), load = [], i, base = (config.config && config.config.uikit && config.config.uikit.base ? config.config.uikit.base : '').replace(/\/+$/g, '');
|
13
13
|
|
14
14
|
if (!base) {
|
15
|
-
throw new Error(
|
15
|
+
throw new Error('Please define base path to UIkit in the requirejs config.');
|
16
16
|
}
|
17
17
|
|
18
18
|
for (i = 0; i < resources.length; i += 1) {
|
@@ -30,7 +30,7 @@
|
|
30
30
|
}
|
31
31
|
|
32
32
|
if (!window.jQuery) {
|
33
|
-
throw new Error(
|
33
|
+
throw new Error('UIkit requires jQuery');
|
34
34
|
}
|
35
35
|
|
36
36
|
if (window && window.jQuery) {
|
@@ -44,7 +44,7 @@
|
|
44
44
|
|
45
45
|
var UI = {}, _UI = global.UIkit ? Object.create(global.UIkit) : undefined;
|
46
46
|
|
47
|
-
UI.version = '2.
|
47
|
+
UI.version = '2.27.2';
|
48
48
|
|
49
49
|
UI.noConflict = function() {
|
50
50
|
// restore UIkit version
|
@@ -161,7 +161,7 @@
|
|
161
161
|
.replace(/'([^']+)'/g, function(_, $1){return '"'+$1+'"';})
|
162
162
|
);
|
163
163
|
} else {
|
164
|
-
return (new Function(
|
164
|
+
return (new Function('', 'var json = ' + str + '; return JSON.parse(JSON.stringify(json));'))();
|
165
165
|
}
|
166
166
|
} catch(e) { return false; }
|
167
167
|
};
|
@@ -260,7 +260,7 @@
|
|
260
260
|
|
261
261
|
var ele = UI.$(this),
|
262
262
|
cls = ele.attr('class'),
|
263
|
-
anim = cls.match(/uk
|
263
|
+
anim = cls.match(/uk-animation-(.+)/);
|
264
264
|
|
265
265
|
ele.removeClass(anim[0]).width();
|
266
266
|
|
@@ -327,30 +327,30 @@
|
|
327
327
|
|
328
328
|
switch(cmd) {
|
329
329
|
case '~':
|
330
|
-
output.push(
|
330
|
+
output.push('for(var $i=0;$i<'+prop+'.length;$i++) { var $item = '+prop+'[$i];');
|
331
331
|
openblocks++;
|
332
332
|
break;
|
333
333
|
case ':':
|
334
|
-
output.push(
|
334
|
+
output.push('for(var $key in '+prop+') { var $val = '+prop+'[$key];');
|
335
335
|
openblocks++;
|
336
336
|
break;
|
337
337
|
case '#':
|
338
|
-
output.push(
|
338
|
+
output.push('if('+prop+') {');
|
339
339
|
openblocks++;
|
340
340
|
break;
|
341
341
|
case '^':
|
342
|
-
output.push(
|
342
|
+
output.push('if(!'+prop+') {');
|
343
343
|
openblocks++;
|
344
344
|
break;
|
345
345
|
case '/':
|
346
|
-
output.push(
|
346
|
+
output.push('}');
|
347
347
|
openblocks--;
|
348
348
|
break;
|
349
349
|
case '!':
|
350
|
-
output.push(
|
350
|
+
output.push('__ret.push('+prop+');');
|
351
351
|
break;
|
352
352
|
default:
|
353
|
-
output.push(
|
353
|
+
output.push('__ret.push(escape('+prop+'));');
|
354
354
|
break;
|
355
355
|
}
|
356
356
|
} else {
|
@@ -371,6 +371,40 @@
|
|
371
371
|
return data ? fn(data) : fn;
|
372
372
|
};
|
373
373
|
|
374
|
+
UI.Utils.focus = function(element, extra) {
|
375
|
+
|
376
|
+
element = $(element);
|
377
|
+
|
378
|
+
if (!element.length) {
|
379
|
+
return element;
|
380
|
+
}
|
381
|
+
|
382
|
+
var autofocus = element.find('[autofocus]:first'), tabidx;
|
383
|
+
|
384
|
+
if (autofocus.length) {
|
385
|
+
return autofocus.focus();
|
386
|
+
}
|
387
|
+
|
388
|
+
autofocus = element.find(':input'+(extra && (','+extra) || '')).first();
|
389
|
+
|
390
|
+
if (autofocus.length) {
|
391
|
+
return autofocus.focus();
|
392
|
+
}
|
393
|
+
|
394
|
+
if (!element.attr('tabindex')) {
|
395
|
+
tabidx = 1000;
|
396
|
+
element.attr('tabindex', tabidx);
|
397
|
+
}
|
398
|
+
|
399
|
+
element[0].focus();
|
400
|
+
|
401
|
+
if (tabidx) {
|
402
|
+
element.attr('tabindex', '');
|
403
|
+
}
|
404
|
+
|
405
|
+
return element;
|
406
|
+
}
|
407
|
+
|
374
408
|
UI.Utils.events = {};
|
375
409
|
UI.Utils.events.click = UI.support.touch ? 'tap' : 'click';
|
376
410
|
|
@@ -383,7 +417,7 @@
|
|
383
417
|
var args = arguments, cmd = command.match(/^([a-z\-]+)(?:\.([a-z]+))?/i), component = cmd[1], method = cmd[2];
|
384
418
|
|
385
419
|
if (!UI[component]) {
|
386
|
-
$.error(
|
420
|
+
$.error('UIkit component [' + component + '] does not exist.');
|
387
421
|
return this;
|
388
422
|
}
|
389
423
|
|
@@ -501,7 +535,7 @@
|
|
501
535
|
switch(arguments.length) {
|
502
536
|
case 1:
|
503
537
|
|
504
|
-
if (typeof arguments[0] ===
|
538
|
+
if (typeof arguments[0] === 'string' || arguments[0].nodeType || arguments[0] instanceof jQuery) {
|
505
539
|
element = $(arguments[0]);
|
506
540
|
} else {
|
507
541
|
options = arguments[0];
|
@@ -605,7 +639,7 @@
|
|
605
639
|
try {
|
606
640
|
|
607
641
|
var observer = new UI.support.mutationobserver(UI.Utils.debounce(function(mutations) {
|
608
|
-
fn.apply(element, []);
|
642
|
+
fn.apply(element, [$element]);
|
609
643
|
$element.trigger('changed.uk.dom');
|
610
644
|
}, 50), {childList: true, subtree: true});
|
611
645
|
|
@@ -645,7 +679,7 @@
|
|
645
679
|
UI.component.bootComponents();
|
646
680
|
|
647
681
|
// custom scroll observer
|
648
|
-
requestAnimationFrame((function(){
|
682
|
+
var rafToken = requestAnimationFrame((function(){
|
649
683
|
|
650
684
|
var memory = {dir: {x:0, y:0}, x: window.pageXOffset, y:window.pageYOffset};
|
651
685
|
|
@@ -668,11 +702,12 @@
|
|
668
702
|
// Trigger the scroll event, this could probably be sent using memory.clone() but this is
|
669
703
|
// more explicit and easier to see exactly what is being sent in the event.
|
670
704
|
UI.$doc.trigger('scrolling.uk.document', [{
|
671
|
-
|
705
|
+
dir: {x: memory.dir.x, y: memory.dir.y}, x: wpxo, y: wpyo
|
672
706
|
}]);
|
673
707
|
}
|
674
708
|
|
675
|
-
|
709
|
+
cancelAnimationFrame(rafToken);
|
710
|
+
rafToken = requestAnimationFrame(fn);
|
676
711
|
};
|
677
712
|
|
678
713
|
if (UI.support.touch) {
|
@@ -755,7 +790,7 @@
|
|
755
790
|
}());
|
756
791
|
|
757
792
|
// add touch identifier class
|
758
|
-
UI.$html.addClass(UI.support.touch ?
|
793
|
+
UI.$html.addClass(UI.support.touch ? 'uk-touch' : 'uk-notouch');
|
759
794
|
|
760
795
|
// add uk-hover class on tap to support overlays on touch devices
|
761
796
|
if (UI.support.touch) {
|