uikit-sass-rails 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +15 -12
- data/lib/uikit/sass/rails/engine.rb +1 -1
- data/lib/uikit/sass/rails/version.rb +1 -1
- data/vendor/assets/fonts/fontawesome-webfont.eot +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.otf +0 -0
- data/vendor/assets/fonts/fontawesome-webfont.svg +525 -464
- 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 +30 -3
- data/vendor/assets/javascripts/uikit/components/accordion.js +172 -0
- data/vendor/assets/javascripts/uikit/components/autocomplete.js +48 -27
- data/vendor/assets/javascripts/uikit/components/datepicker.js +2887 -97
- data/vendor/assets/javascripts/uikit/components/form-password.js +24 -19
- data/vendor/assets/javascripts/uikit/components/form-select.js +24 -18
- data/vendor/assets/javascripts/uikit/components/grid.js +524 -0
- data/vendor/assets/javascripts/uikit/components/htmleditor.js +46 -39
- data/vendor/assets/javascripts/uikit/components/lightbox.js +543 -0
- data/vendor/assets/javascripts/uikit/components/nestable.js +125 -98
- data/vendor/assets/javascripts/uikit/components/notify.js +34 -22
- data/vendor/assets/javascripts/uikit/components/pagination.js +24 -21
- data/vendor/assets/javascripts/uikit/components/parallax.js +400 -0
- data/vendor/assets/javascripts/uikit/components/search.js +19 -16
- data/vendor/assets/javascripts/uikit/components/slider.js +482 -0
- data/vendor/assets/javascripts/uikit/components/slideset.js +498 -0
- data/vendor/assets/javascripts/uikit/components/slideshow-fx.js +377 -0
- data/vendor/assets/javascripts/uikit/components/slideshow.js +540 -0
- data/vendor/assets/javascripts/uikit/components/sortable.js +392 -263
- data/vendor/assets/javascripts/uikit/components/sticky.js +127 -68
- data/vendor/assets/javascripts/uikit/components/timepicker.js +65 -42
- data/vendor/assets/javascripts/uikit/components/tooltip.js +220 -0
- data/vendor/assets/javascripts/uikit/components/upload.js +11 -10
- data/vendor/assets/javascripts/uikit/core/alert.js +66 -0
- data/vendor/assets/javascripts/uikit/core/button.js +154 -0
- data/vendor/assets/javascripts/uikit/core/core.js +717 -0
- data/vendor/assets/javascripts/uikit/{components → core}/cover.js +41 -35
- data/vendor/assets/javascripts/uikit/core/dropdown.js +296 -0
- data/vendor/assets/javascripts/uikit/core/grid.js +172 -0
- data/vendor/assets/javascripts/uikit/core/modal.js +323 -0
- data/vendor/assets/javascripts/uikit/core/nav.js +117 -0
- data/vendor/assets/javascripts/uikit/core/offcanvas.js +178 -0
- data/vendor/assets/javascripts/uikit/core/scrollspy.js +208 -0
- data/vendor/assets/javascripts/uikit/core/smooth-scroll.js +62 -0
- data/vendor/assets/javascripts/uikit/core/switcher.js +298 -0
- data/vendor/assets/javascripts/uikit/core/tab.js +159 -0
- data/vendor/assets/javascripts/uikit/core/toggle.js +117 -0
- data/vendor/assets/javascripts/uikit/core/touch.js +173 -0
- data/vendor/assets/javascripts/uikit/core/utility.js +157 -0
- data/vendor/assets/javascripts/uikit/uikit.js +1538 -871
- data/vendor/assets/stylesheets/extra/font-awesome.scss +4 -7
- data/vendor/assets/stylesheets/uikit.scss +22 -1
- data/vendor/assets/stylesheets/uikit/almost-flat.scss +22 -2
- data/vendor/assets/stylesheets/uikit/components/accordion.almost-flat.scss +45 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.gradient.scss +45 -0
- data/vendor/assets/stylesheets/uikit/components/accordion.scss +43 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.almost-flat.scss +62 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.gradient.scss +62 -0
- data/vendor/assets/stylesheets/uikit/components/autocomplete.scss +60 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.almost-flat.scss +148 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.gradient.scss +158 -0
- data/vendor/assets/stylesheets/uikit/components/datepicker.scss +142 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.almost-flat.scss +152 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.gradient.scss +152 -0
- data/vendor/assets/stylesheets/uikit/components/dotnav.scss +148 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.almost-flat.scss +92 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.gradient.scss +92 -0
- data/vendor/assets/stylesheets/uikit/components/form-advanced.scss +92 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.almost-flat.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.gradient.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/form-file.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.almost-flat.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.gradient.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/form-password.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.almost-flat.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.gradient.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/form-select.scss +37 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.almost-flat.scss +282 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.gradient.scss +290 -0
- data/vendor/assets/stylesheets/uikit/components/htmleditor.scss +208 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.almost-flat.scss +137 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.gradient.scss +141 -0
- data/vendor/assets/stylesheets/uikit/components/nestable.scss +134 -0
- data/vendor/assets/stylesheets/uikit/components/notify.almost-flat.scss +112 -0
- data/vendor/assets/stylesheets/uikit/components/notify.gradient.scss +112 -0
- data/vendor/assets/stylesheets/uikit/components/notify.scss +106 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.almost-flat.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.gradient.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/placeholder.scss +36 -0
- data/vendor/assets/stylesheets/uikit/components/progress.almost-flat.scss +130 -0
- data/vendor/assets/stylesheets/uikit/components/progress.gradient.scss +138 -0
- data/vendor/assets/stylesheets/uikit/components/progress.scss +118 -0
- data/vendor/assets/stylesheets/uikit/components/search.almost-flat.scss +216 -0
- data/vendor/assets/stylesheets/uikit/components/search.gradient.scss +216 -0
- data/vendor/assets/stylesheets/uikit/components/search.scss +214 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.almost-flat.scss +110 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.gradient.scss +110 -0
- data/vendor/assets/stylesheets/uikit/components/slidenav.scss +110 -0
- data/vendor/assets/stylesheets/uikit/components/slider.almost-flat.scss +105 -0
- data/vendor/assets/stylesheets/uikit/components/slider.gradient.scss +105 -0
- data/vendor/assets/stylesheets/uikit/components/slider.scss +105 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.almost-flat.scss +166 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.gradient.scss +166 -0
- data/vendor/assets/stylesheets/uikit/components/slideshow.scss +166 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.almost-flat.scss +90 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.gradient.scss +90 -0
- data/vendor/assets/stylesheets/uikit/components/sortable.scss +90 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.almost-flat.scss +39 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.gradient.scss +39 -0
- data/vendor/assets/stylesheets/uikit/components/sticky.scss +39 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.almost-flat.scss +129 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.gradient.scss +129 -0
- data/vendor/assets/stylesheets/uikit/components/tooltip.scss +127 -0
- data/vendor/assets/stylesheets/uikit/components/upload.almost-flat.scss +11 -0
- data/vendor/assets/stylesheets/uikit/components/upload.gradient.scss +11 -0
- data/vendor/assets/stylesheets/uikit/components/upload.scss +11 -0
- data/vendor/assets/stylesheets/uikit/gradient.scss +22 -2
- data/vendor/assets/stylesheets/uikit/uikit.almost-flat.scss +1768 -498
- data/vendor/assets/stylesheets/uikit/uikit.gradient.scss +1776 -512
- data/vendor/assets/stylesheets/uikit/uikit.scss +1722 -462
- metadata +92 -7
- data/vendor/assets/stylesheets/uikit/components/uikit.components.almost-flat.scss +0 -1586
- data/vendor/assets/stylesheets/uikit/components/uikit.components.gradient.scss +0 -1608
- data/vendor/assets/stylesheets/uikit/components/uikit.components.scss +0 -1489
@@ -1,19 +1,21 @@
|
|
1
|
-
/*! UIkit 2.
|
1
|
+
/*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
2
|
(function(addon) {
|
3
3
|
|
4
4
|
var component;
|
5
5
|
|
6
|
-
if (
|
7
|
-
component = addon(
|
6
|
+
if (window.UIkit) {
|
7
|
+
component = addon(UIkit);
|
8
8
|
}
|
9
9
|
|
10
10
|
if (typeof define == "function" && define.amd) {
|
11
11
|
define("uikit-sticky", ["uikit"], function(){
|
12
|
-
return component || addon(
|
12
|
+
return component || addon(UIkit);
|
13
13
|
});
|
14
14
|
}
|
15
15
|
|
16
|
-
})(function(
|
16
|
+
})(function(UI){
|
17
|
+
|
18
|
+
"use strict";
|
17
19
|
|
18
20
|
var $win = UI.$win,
|
19
21
|
$doc = UI.$doc,
|
@@ -28,28 +30,78 @@
|
|
28
30
|
clsinit : 'uk-sticky-init',
|
29
31
|
clsactive : 'uk-active',
|
30
32
|
getWidthFrom : '',
|
33
|
+
boundary : false,
|
31
34
|
media : false,
|
32
|
-
target : false
|
35
|
+
target : false,
|
36
|
+
disabled : false
|
37
|
+
},
|
38
|
+
|
39
|
+
boot: function() {
|
40
|
+
|
41
|
+
// should be more efficient than using $win.scroll(checkscrollposition):
|
42
|
+
UI.$doc.on('scrolling.uk.document', function() { checkscrollposition(); });
|
43
|
+
UI.$win.on('resize orientationchange', UI.Utils.debounce(function() {
|
44
|
+
|
45
|
+
if (!sticked.length) return;
|
46
|
+
|
47
|
+
for (var i = 0; i < sticked.length; i++) {
|
48
|
+
sticked[i].reset(true);
|
49
|
+
sticked[i].self.computeWrapper();
|
50
|
+
}
|
51
|
+
|
52
|
+
checkscrollposition();
|
53
|
+
}, 100));
|
54
|
+
|
55
|
+
// init code
|
56
|
+
UI.ready(function(context) {
|
57
|
+
|
58
|
+
setTimeout(function(){
|
59
|
+
|
60
|
+
UI.$("[data-uk-sticky]", context).each(function(){
|
61
|
+
|
62
|
+
var $ele = UI.$(this);
|
63
|
+
|
64
|
+
if(!$ele.data("sticky")) {
|
65
|
+
UI.sticky($ele, UI.Utils.options($ele.attr('data-uk-sticky')));
|
66
|
+
}
|
67
|
+
});
|
68
|
+
|
69
|
+
checkscrollposition();
|
70
|
+
}, 0);
|
71
|
+
});
|
33
72
|
},
|
34
73
|
|
35
74
|
init: function() {
|
36
75
|
|
37
|
-
var wrapper =
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
76
|
+
var wrapper = UI.$('<div class="uk-sticky-placeholder"></div>'), boundary = this.options.boundary, boundtoparent;
|
77
|
+
|
78
|
+
this.wrapper = this.element.css('margin', 0).wrap(wrapper).parent();
|
79
|
+
|
80
|
+
this.computeWrapper();
|
81
|
+
|
82
|
+
if (boundary) {
|
42
83
|
|
43
|
-
|
84
|
+
if (boundary === true) {
|
85
|
+
|
86
|
+
boundary = this.wrapper.parent();
|
87
|
+
boundtoparent = true;
|
88
|
+
|
89
|
+
} else if (typeof boundary === "string") {
|
90
|
+
boundary = UI.$(boundary);
|
91
|
+
}
|
92
|
+
}
|
44
93
|
|
45
94
|
this.sticky = {
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
95
|
+
self : this,
|
96
|
+
options : this.options,
|
97
|
+
element : this.element,
|
98
|
+
currentTop : null,
|
99
|
+
wrapper : this.wrapper,
|
100
|
+
init : false,
|
101
|
+
getWidthFrom : this.options.getWidthFrom || this.wrapper,
|
102
|
+
boundary : boundary,
|
103
|
+
boundtoparent : boundtoparent,
|
104
|
+
reset : function(force) {
|
53
105
|
|
54
106
|
var finalize = function() {
|
55
107
|
this.element.css({"position":"", "top":"", "width":"", "left":"", "margin":"0"});
|
@@ -73,8 +125,13 @@
|
|
73
125
|
finalize();
|
74
126
|
}
|
75
127
|
},
|
128
|
+
|
76
129
|
check: function() {
|
77
130
|
|
131
|
+
if (this.options.disabled) {
|
132
|
+
return false;
|
133
|
+
}
|
134
|
+
|
78
135
|
if (this.options.media) {
|
79
136
|
|
80
137
|
switch(typeof(this.options.media)) {
|
@@ -93,7 +150,7 @@
|
|
93
150
|
|
94
151
|
var scrollTop = $win.scrollTop(),
|
95
152
|
documentHeight = $doc.height(),
|
96
|
-
dwh = documentHeight -
|
153
|
+
dwh = documentHeight - window.innerHeight,
|
97
154
|
extra = (scrollTop > dwh) ? dwh - scrollTop : 0,
|
98
155
|
elementTop = this.wrapper.offset().top,
|
99
156
|
etse = elementTop - this.options.top - extra;
|
@@ -106,31 +163,50 @@
|
|
106
163
|
},
|
107
164
|
|
108
165
|
update: function() {
|
109
|
-
|
166
|
+
checkscrollposition(this.sticky);
|
167
|
+
},
|
168
|
+
|
169
|
+
enable: function() {
|
170
|
+
this.options.disabled = false;
|
171
|
+
this.update();
|
172
|
+
},
|
173
|
+
|
174
|
+
disable: function(force) {
|
175
|
+
this.options.disabled = true;
|
176
|
+
this.sticky.reset(force);
|
177
|
+
},
|
178
|
+
|
179
|
+
computeWrapper: function() {
|
180
|
+
|
181
|
+
this.wrapper.css({
|
182
|
+
'height' : this.element.css('position') != 'absolute' ? this.element.outerHeight() : '',
|
183
|
+
'float' : this.element.css("float") != "none" ? this.element.css("float") : '',
|
184
|
+
'margin' : this.element.css("margin")
|
185
|
+
});
|
110
186
|
}
|
111
187
|
});
|
112
188
|
|
113
|
-
function
|
189
|
+
function checkscrollposition() {
|
114
190
|
|
115
|
-
|
191
|
+
var stickies = arguments.length ? arguments : sticked;
|
192
|
+
|
193
|
+
if (!stickies.length || $win.scrollTop() < 0) return;
|
116
194
|
|
117
195
|
var scrollTop = $win.scrollTop(),
|
118
196
|
documentHeight = $doc.height(),
|
119
|
-
|
197
|
+
windowHeight = $win.height(),
|
198
|
+
dwh = documentHeight - windowHeight,
|
120
199
|
extra = (scrollTop > dwh) ? dwh - scrollTop : 0,
|
121
|
-
|
122
|
-
|
123
|
-
if(scrollTop < 0) return;
|
200
|
+
newTop, containerBottom, stickyHeight, sticky;
|
124
201
|
|
202
|
+
for (var i = 0; i < stickies.length; i++) {
|
125
203
|
|
126
|
-
|
204
|
+
sticky = stickies[i];
|
127
205
|
|
128
|
-
if (!
|
206
|
+
if (!sticky.element.is(":visible") || sticky.animate) {
|
129
207
|
continue;
|
130
208
|
}
|
131
209
|
|
132
|
-
var sticky = sticked[i];
|
133
|
-
|
134
210
|
if (!sticky.check()) {
|
135
211
|
|
136
212
|
if (sticky.currentTop !== null) {
|
@@ -142,16 +218,31 @@
|
|
142
218
|
if (sticky.options.top < 0) {
|
143
219
|
newTop = 0;
|
144
220
|
} else {
|
145
|
-
|
221
|
+
stickyHeight = sticky.element.outerHeight();
|
222
|
+
newTop = documentHeight - stickyHeight - sticky.options.top - sticky.options.bottom - scrollTop - extra;
|
146
223
|
newTop = newTop < 0 ? newTop + sticky.options.top : sticky.options.top;
|
147
224
|
}
|
148
225
|
|
226
|
+
if (sticky.boundary && sticky.boundary.length) {
|
227
|
+
|
228
|
+
var bTop = sticky.boundary.position().top;
|
229
|
+
|
230
|
+
if (sticky.boundtoparent) {
|
231
|
+
containerBottom = documentHeight - (bTop + sticky.boundary.outerHeight()) + parseInt(sticky.boundary.css('padding-bottom'));
|
232
|
+
} else {
|
233
|
+
containerBottom = documentHeight - bTop - parseInt(sticky.boundary.css('margin-top'));
|
234
|
+
}
|
235
|
+
|
236
|
+
newTop = (scrollTop + stickyHeight) > (documentHeight - containerBottom - (sticky.options.top < 0 ? 0 : sticky.options.top)) ? (documentHeight - containerBottom) - (scrollTop + stickyHeight) : newTop;
|
237
|
+
}
|
238
|
+
|
239
|
+
|
149
240
|
if (sticky.currentTop != newTop) {
|
150
241
|
|
151
242
|
sticky.element.css({
|
152
243
|
"position" : "fixed",
|
153
244
|
"top" : newTop,
|
154
|
-
"width" : (typeof sticky.getWidthFrom !== 'undefined') ?
|
245
|
+
"width" : (typeof sticky.getWidthFrom !== 'undefined') ? UI.$(sticky.getWidthFrom).width() : sticky.element.width(),
|
155
246
|
"left" : sticky.wrapper.offset().left
|
156
247
|
});
|
157
248
|
|
@@ -161,7 +252,7 @@
|
|
161
252
|
|
162
253
|
if (location.hash && scrollTop > 0 && sticky.options.target) {
|
163
254
|
|
164
|
-
var $target =
|
255
|
+
var $target = UI.$(location.hash);
|
165
256
|
|
166
257
|
if ($target.length) {
|
167
258
|
|
@@ -201,39 +292,7 @@
|
|
201
292
|
|
202
293
|
sticky.init = true;
|
203
294
|
}
|
204
|
-
|
205
295
|
}
|
206
296
|
|
207
|
-
|
208
|
-
|
209
|
-
$win.on('resize orientationchange', UI.Utils.debounce(function() {
|
210
|
-
|
211
|
-
if (!sticked.length) return;
|
212
|
-
|
213
|
-
for (var i = 0; i < sticked.length; i++) {
|
214
|
-
sticked[i].reset(true);
|
215
|
-
}
|
216
|
-
|
217
|
-
scroller();
|
218
|
-
}, 100));
|
219
|
-
|
220
|
-
// init code
|
221
|
-
UI.ready(function(context) {
|
222
|
-
|
223
|
-
setTimeout(function(){
|
224
|
-
|
225
|
-
$("[data-uk-sticky]", context).each(function(){
|
226
|
-
|
227
|
-
var $ele = $(this);
|
228
|
-
|
229
|
-
if(!$ele.data("sticky")) {
|
230
|
-
UI.sticky($ele, UI.Utils.options($ele.attr('data-uk-sticky')));
|
231
|
-
}
|
232
|
-
});
|
233
|
-
|
234
|
-
scroller();
|
235
|
-
}, 0);
|
236
|
-
});
|
237
|
-
|
238
|
-
return $.fn.uksticky;
|
239
|
-
});
|
297
|
+
return UI.sticky;
|
298
|
+
});
|
@@ -1,60 +1,52 @@
|
|
1
|
-
/*! UIkit 2.
|
1
|
+
/*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
2
|
(function(addon) {
|
3
3
|
|
4
4
|
var component;
|
5
5
|
|
6
|
-
if (
|
7
|
-
component = addon(
|
6
|
+
if (window.UIkit) {
|
7
|
+
component = addon(UIkit);
|
8
8
|
}
|
9
9
|
|
10
10
|
if (typeof define == "function" && define.amd) {
|
11
11
|
define("uikit-search", ["uikit"], function(){
|
12
|
-
return component || addon(
|
12
|
+
return component || addon(UIkit);
|
13
13
|
});
|
14
14
|
}
|
15
15
|
|
16
|
-
})(function(
|
16
|
+
})(function(UI){
|
17
17
|
|
18
18
|
"use strict";
|
19
19
|
|
20
|
-
var times = {'12h':[], '24h':[]};
|
21
20
|
|
22
|
-
|
23
|
-
|
24
|
-
h = ''+i;
|
25
|
-
|
26
|
-
if(i<10) h = '0'+h;
|
27
|
-
|
28
|
-
times['24h'].push({value: (h+':00')});
|
29
|
-
times['24h'].push({value: (h+':30')});
|
30
|
-
|
31
|
-
if (i > 0 && i<13) {
|
32
|
-
times['12h'].push({value: (h+':00 AM')});
|
33
|
-
times['12h'].push({value: (h+':30 AM')});
|
34
|
-
}
|
35
|
-
|
36
|
-
if (i > 12) {
|
21
|
+
UI.component('timepicker', {
|
37
22
|
|
38
|
-
|
23
|
+
defaults: {
|
24
|
+
format : '24h',
|
25
|
+
delay : 0,
|
26
|
+
start : 0,
|
27
|
+
end : 24
|
28
|
+
},
|
39
29
|
|
40
|
-
|
30
|
+
boot: function() {
|
41
31
|
|
42
|
-
|
43
|
-
|
44
|
-
}
|
45
|
-
}
|
32
|
+
// init code
|
33
|
+
UI.$html.on("focus.timepicker.uikit", "[data-uk-timepicker]", function(e) {
|
46
34
|
|
35
|
+
var ele = UI.$(this);
|
47
36
|
|
48
|
-
|
37
|
+
if (!ele.data("timepicker")) {
|
38
|
+
var obj = UI.timepicker(ele, UI.Utils.options(ele.attr("data-uk-timepicker")));
|
49
39
|
|
50
|
-
|
51
|
-
|
52
|
-
|
40
|
+
setTimeout(function(){
|
41
|
+
obj.autocomplete.input.focus();
|
42
|
+
}, 40);
|
43
|
+
}
|
44
|
+
});
|
53
45
|
},
|
54
46
|
|
55
47
|
init: function() {
|
56
48
|
|
57
|
-
var $this = this;
|
49
|
+
var $this = this, times = getTimeRange(this.options.start, this.options.end);
|
58
50
|
|
59
51
|
this.options.minLength = 0;
|
60
52
|
this.options.template = '<ul class="uk-nav uk-nav-autocomplete uk-autocomplete-results">{{~items}}<li data-value="{{$item.value}}"><a>{{$item.value}}</a></li>{{/items}}</ul>';
|
@@ -68,7 +60,7 @@
|
|
68
60
|
this.autocomplete = UI.autocomplete(this.element.parent(), this.options);
|
69
61
|
this.autocomplete.dropdown.addClass('uk-dropdown-small uk-dropdown-scrollable');
|
70
62
|
|
71
|
-
this.autocomplete.on('uk.autocomplete
|
63
|
+
this.autocomplete.on('show.uk.autocomplete', function() {
|
72
64
|
|
73
65
|
var selected = $this.autocomplete.dropdown.find('[data-value="'+$this.autocomplete.input.val()+'"]');
|
74
66
|
|
@@ -149,16 +141,47 @@
|
|
149
141
|
}
|
150
142
|
});
|
151
143
|
|
152
|
-
//
|
153
|
-
UI.$html.on("focus.timepicker.uikit", "[data-uk-timepicker]", function(e) {
|
154
|
-
var ele = $(this);
|
144
|
+
// helper
|
155
145
|
|
156
|
-
|
157
|
-
var obj = UI.timepicker(ele, UI.Utils.options(ele.attr("data-uk-timepicker")));
|
146
|
+
function getTimeRange(start, end) {
|
158
147
|
|
159
|
-
|
160
|
-
|
161
|
-
|
148
|
+
start = start || 0;
|
149
|
+
end = end || 24;
|
150
|
+
|
151
|
+
var times = {'12h':[], '24h':[]}, i, h;
|
152
|
+
|
153
|
+
for (i = start, h=''; i<end; i++) {
|
154
|
+
|
155
|
+
h = ''+i;
|
156
|
+
|
157
|
+
if (i<10) h = '0'+h;
|
158
|
+
|
159
|
+
times['24h'].push({value: (h+':00')});
|
160
|
+
times['24h'].push({value: (h+':30')});
|
161
|
+
|
162
|
+
if (i === 0) {
|
163
|
+
h = 12;
|
164
|
+
times['12h'].push({value: (h+':00 AM')});
|
165
|
+
times['12h'].push({value: (h+':30 AM')});
|
166
|
+
}
|
167
|
+
|
168
|
+
if (i > 0 && i<13 && i!==12) {
|
169
|
+
times['12h'].push({value: (h+':00 AM')});
|
170
|
+
times['12h'].push({value: (h+':30 AM')});
|
171
|
+
}
|
172
|
+
|
173
|
+
if (i >= 12) {
|
174
|
+
|
175
|
+
h = h-12;
|
176
|
+
if (h === 0) h = 12;
|
177
|
+
if (h < 10) h = '0'+String(h);
|
178
|
+
|
179
|
+
times['12h'].push({value: (h+':00 PM')});
|
180
|
+
times['12h'].push({value: (h+':30 PM')});
|
181
|
+
}
|
162
182
|
}
|
163
|
-
|
183
|
+
|
184
|
+
return times;
|
185
|
+
}
|
186
|
+
|
164
187
|
});
|
@@ -0,0 +1,220 @@
|
|
1
|
+
/*! UIkit 2.20.3 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
|
+
(function(addon) {
|
3
|
+
var component;
|
4
|
+
|
5
|
+
if (window.UIkit) {
|
6
|
+
component = addon(UIkit);
|
7
|
+
}
|
8
|
+
|
9
|
+
if (typeof define == "function" && define.amd) {
|
10
|
+
define("uikit-tooltip", ["uikit"], function(){
|
11
|
+
return component || addon(UIkit);
|
12
|
+
});
|
13
|
+
}
|
14
|
+
})(function(UI){
|
15
|
+
|
16
|
+
"use strict";
|
17
|
+
|
18
|
+
var $tooltip, // tooltip container
|
19
|
+
tooltipdelay, checkdelay;
|
20
|
+
|
21
|
+
UI.component('tooltip', {
|
22
|
+
|
23
|
+
defaults: {
|
24
|
+
"offset": 5,
|
25
|
+
"pos": "top",
|
26
|
+
"animation": false,
|
27
|
+
"delay": 0, // in miliseconds
|
28
|
+
"cls": "",
|
29
|
+
"src": function() { return this.attr("title"); }
|
30
|
+
},
|
31
|
+
|
32
|
+
tip: "",
|
33
|
+
|
34
|
+
boot: function() {
|
35
|
+
|
36
|
+
// init code
|
37
|
+
UI.$html.on("mouseenter.tooltip.uikit focus.tooltip.uikit", "[data-uk-tooltip]", function(e) {
|
38
|
+
var ele = UI.$(this);
|
39
|
+
|
40
|
+
if (!ele.data("tooltip")) {
|
41
|
+
var obj = UI.tooltip(ele, UI.Utils.options(ele.attr("data-uk-tooltip")));
|
42
|
+
ele.trigger("mouseenter");
|
43
|
+
}
|
44
|
+
});
|
45
|
+
},
|
46
|
+
|
47
|
+
init: function() {
|
48
|
+
|
49
|
+
var $this = this;
|
50
|
+
|
51
|
+
if (!$tooltip) {
|
52
|
+
$tooltip = UI.$('<div class="uk-tooltip"></div>').appendTo("body");
|
53
|
+
}
|
54
|
+
|
55
|
+
this.on({
|
56
|
+
"focus" : function(e) { $this.show(); },
|
57
|
+
"blur" : function(e) { $this.hide(); },
|
58
|
+
"mouseenter": function(e) { $this.show(); },
|
59
|
+
"mouseleave": function(e) { $this.hide(); }
|
60
|
+
});
|
61
|
+
|
62
|
+
this.tip = typeof(this.options.src) === "function" ? this.options.src.call(this.element) : this.options.src;
|
63
|
+
|
64
|
+
// disable title attribute
|
65
|
+
this.element.attr("data-cached-title", this.element.attr("title")).attr("title", "");
|
66
|
+
},
|
67
|
+
|
68
|
+
show: function() {
|
69
|
+
|
70
|
+
if (tooltipdelay) clearTimeout(tooltipdelay);
|
71
|
+
if (checkdelay) clearTimeout(checkdelay);
|
72
|
+
if (!this.tip.length) return;
|
73
|
+
|
74
|
+
$tooltip.stop().css({"top": -2000, "visibility": "hidden"}).show();
|
75
|
+
$tooltip.html('<div class="uk-tooltip-inner">' + this.tip + '</div>');
|
76
|
+
|
77
|
+
var $this = this,
|
78
|
+
pos = UI.$.extend({}, this.element.offset(), {width: this.element[0].offsetWidth, height: this.element[0].offsetHeight}),
|
79
|
+
width = $tooltip[0].offsetWidth,
|
80
|
+
height = $tooltip[0].offsetHeight,
|
81
|
+
offset = typeof(this.options.offset) === "function" ? this.options.offset.call(this.element) : this.options.offset,
|
82
|
+
position = typeof(this.options.pos) === "function" ? this.options.pos.call(this.element) : this.options.pos,
|
83
|
+
tmppos = position.split("-"),
|
84
|
+
tcss = {
|
85
|
+
"display" : "none",
|
86
|
+
"visibility" : "visible",
|
87
|
+
"top" : (pos.top + pos.height + height),
|
88
|
+
"left" : pos.left
|
89
|
+
};
|
90
|
+
|
91
|
+
|
92
|
+
// prevent strange position
|
93
|
+
// when tooltip is in offcanvas etc.
|
94
|
+
if (UI.$html.css('position')=='fixed' || UI.$body.css('position')=='fixed'){
|
95
|
+
var bodyoffset = UI.$('body').offset(),
|
96
|
+
htmloffset = UI.$('html').offset(),
|
97
|
+
docoffset = {'top': (htmloffset.top + bodyoffset.top), 'left': (htmloffset.left + bodyoffset.left)};
|
98
|
+
|
99
|
+
pos.left -= docoffset.left;
|
100
|
+
pos.top -= docoffset.top;
|
101
|
+
}
|
102
|
+
|
103
|
+
|
104
|
+
if ((tmppos[0] == "left" || tmppos[0] == "right") && UI.langdirection == 'right') {
|
105
|
+
tmppos[0] = tmppos[0] == "left" ? "right" : "left";
|
106
|
+
}
|
107
|
+
|
108
|
+
var variants = {
|
109
|
+
"bottom" : {top: pos.top + pos.height + offset, left: pos.left + pos.width / 2 - width / 2},
|
110
|
+
"top" : {top: pos.top - height - offset, left: pos.left + pos.width / 2 - width / 2},
|
111
|
+
"left" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left - width - offset},
|
112
|
+
"right" : {top: pos.top + pos.height / 2 - height / 2, left: pos.left + pos.width + offset}
|
113
|
+
};
|
114
|
+
|
115
|
+
UI.$.extend(tcss, variants[tmppos[0]]);
|
116
|
+
|
117
|
+
if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width);
|
118
|
+
|
119
|
+
var boundary = this.checkBoundary(tcss.left, tcss.top, width, height);
|
120
|
+
|
121
|
+
if(boundary) {
|
122
|
+
|
123
|
+
switch(boundary) {
|
124
|
+
case "x":
|
125
|
+
|
126
|
+
if (tmppos.length == 2) {
|
127
|
+
position = tmppos[0]+"-"+(tcss.left < 0 ? "left": "right");
|
128
|
+
} else {
|
129
|
+
position = tcss.left < 0 ? "right": "left";
|
130
|
+
}
|
131
|
+
|
132
|
+
break;
|
133
|
+
|
134
|
+
case "y":
|
135
|
+
if (tmppos.length == 2) {
|
136
|
+
position = (tcss.top < 0 ? "bottom": "top")+"-"+tmppos[1];
|
137
|
+
} else {
|
138
|
+
position = (tcss.top < 0 ? "bottom": "top");
|
139
|
+
}
|
140
|
+
|
141
|
+
break;
|
142
|
+
|
143
|
+
case "xy":
|
144
|
+
if (tmppos.length == 2) {
|
145
|
+
position = (tcss.top < 0 ? "bottom": "top")+"-"+(tcss.left < 0 ? "left": "right");
|
146
|
+
} else {
|
147
|
+
position = tcss.left < 0 ? "right": "left";
|
148
|
+
}
|
149
|
+
|
150
|
+
break;
|
151
|
+
|
152
|
+
}
|
153
|
+
|
154
|
+
tmppos = position.split("-");
|
155
|
+
|
156
|
+
UI.$.extend(tcss, variants[tmppos[0]]);
|
157
|
+
|
158
|
+
if (tmppos.length == 2) tcss.left = (tmppos[1] == 'left') ? (pos.left) : ((pos.left + pos.width) - width);
|
159
|
+
}
|
160
|
+
|
161
|
+
|
162
|
+
tcss.left -= UI.$body.position().left;
|
163
|
+
|
164
|
+
tooltipdelay = setTimeout(function(){
|
165
|
+
|
166
|
+
$tooltip.css(tcss).attr("class", ["uk-tooltip", "uk-tooltip-"+position, $this.options.cls].join(' '));
|
167
|
+
|
168
|
+
if ($this.options.animation) {
|
169
|
+
$tooltip.css({opacity: 0, display: 'block'}).animate({opacity: 1}, parseInt($this.options.animation, 10) || 400);
|
170
|
+
} else {
|
171
|
+
$tooltip.show();
|
172
|
+
}
|
173
|
+
|
174
|
+
tooltipdelay = false;
|
175
|
+
|
176
|
+
// close tooltip if element was removed or hidden
|
177
|
+
checkdelay = setInterval(function(){
|
178
|
+
if(!$this.element.is(':visible')) $this.hide();
|
179
|
+
}, 150);
|
180
|
+
|
181
|
+
}, parseInt(this.options.delay, 10) || 0);
|
182
|
+
},
|
183
|
+
|
184
|
+
hide: function() {
|
185
|
+
if(this.element.is("input") && this.element[0]===document.activeElement) return;
|
186
|
+
|
187
|
+
if(tooltipdelay) clearTimeout(tooltipdelay);
|
188
|
+
if (checkdelay) clearTimeout(checkdelay);
|
189
|
+
|
190
|
+
$tooltip.stop();
|
191
|
+
|
192
|
+
if (this.options.animation) {
|
193
|
+
$tooltip.fadeOut(parseInt(this.options.animation, 10) || 400);
|
194
|
+
} else {
|
195
|
+
$tooltip.hide();
|
196
|
+
}
|
197
|
+
},
|
198
|
+
|
199
|
+
content: function() {
|
200
|
+
return this.tip;
|
201
|
+
},
|
202
|
+
|
203
|
+
checkBoundary: function(left, top, width, height) {
|
204
|
+
|
205
|
+
var axis = "";
|
206
|
+
|
207
|
+
if(left < 0 || ((left - UI.$win.scrollLeft())+width) > window.innerWidth) {
|
208
|
+
axis += "x";
|
209
|
+
}
|
210
|
+
|
211
|
+
if(top < 0 || ((top - UI.$win.scrollTop())+height) > window.innerHeight) {
|
212
|
+
axis += "y";
|
213
|
+
}
|
214
|
+
|
215
|
+
return axis;
|
216
|
+
}
|
217
|
+
});
|
218
|
+
|
219
|
+
return UI.tooltip;
|
220
|
+
});
|