uikit-sass-rails 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/uikit/sass/rails/version.rb +1 -1
- data/uikit-sass-rails.gemspec +2 -2
- data/vendor/assets/javascripts/uikit.js +1 -0
- data/vendor/assets/javascripts/uikit/addons/autocomplete.js +5 -6
- data/vendor/assets/javascripts/uikit/addons/cover.js +90 -0
- data/vendor/assets/javascripts/uikit/addons/datepicker.js +19 -5
- data/vendor/assets/javascripts/uikit/addons/form-password.js +2 -2
- data/vendor/assets/javascripts/uikit/addons/form-select.js +3 -3
- data/vendor/assets/javascripts/uikit/addons/htmleditor.js +35 -14
- data/vendor/assets/javascripts/uikit/addons/nestable.js +9 -8
- data/vendor/assets/javascripts/uikit/addons/notify.js +5 -2
- data/vendor/assets/javascripts/uikit/addons/pagination.js +3 -3
- data/vendor/assets/javascripts/uikit/addons/search.js +2 -2
- data/vendor/assets/javascripts/uikit/addons/sortable.js +48 -28
- data/vendor/assets/javascripts/uikit/addons/sticky.js +148 -37
- data/vendor/assets/javascripts/uikit/addons/timepicker.js +11 -9
- data/vendor/assets/javascripts/uikit/addons/upload.js +20 -6
- data/vendor/assets/javascripts/uikit/uikit.js +309 -288
- data/vendor/assets/stylesheets/uikit/addons/uikit.addons.scss +175 -62
- data/vendor/assets/stylesheets/uikit/addons/uikit.almost-flat.addons.scss +175 -62
- data/vendor/assets/stylesheets/uikit/addons/uikit.gradient.addons.scss +175 -62
- data/vendor/assets/stylesheets/uikit/uikit.almost-flat.scss +389 -132
- data/vendor/assets/stylesheets/uikit/uikit.gradient.scss +389 -132
- data/vendor/assets/stylesheets/uikit/uikit.scss +389 -132
- metadata +6 -5
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! UIkit 2.
|
1
|
+
/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
2
|
|
3
3
|
(function(addon) {
|
4
4
|
|
@@ -80,7 +80,7 @@
|
|
80
80
|
});
|
81
81
|
|
82
82
|
// init code
|
83
|
-
|
83
|
+
UI.$doc.on("focus.search.uikit", "[data-uk-search]", function(e) {
|
84
84
|
var ele = $(this);
|
85
85
|
|
86
86
|
if (!ele.data("search")) {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! UIkit 2.
|
1
|
+
/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
2
|
|
3
3
|
/*
|
4
4
|
* Based on nativesortable - Copyright (c) Brian Grinstead - https://github.com/bgrins/nativesortable
|
@@ -27,7 +27,7 @@
|
|
27
27
|
return ('draggable' in div) || ('ondragstart' in div && 'ondrop' in div);
|
28
28
|
})(),
|
29
29
|
|
30
|
-
draggingPlaceholder, moving, clickedlink;
|
30
|
+
draggingPlaceholder, moving, dragging, clickedlink, delayIdle;
|
31
31
|
|
32
32
|
// disable native dragndrop support for now
|
33
33
|
supportsDragAndDrop = false;
|
@@ -38,6 +38,7 @@
|
|
38
38
|
|
39
39
|
warp : false,
|
40
40
|
animation : 150,
|
41
|
+
threshold : 10,
|
41
42
|
|
42
43
|
childClass : 'uk-sortable-item',
|
43
44
|
placeholderClass : 'uk-sortable-placeholder',
|
@@ -45,7 +46,6 @@
|
|
45
46
|
draggingClass : 'uk-sortable-dragged',
|
46
47
|
dragMovingClass : 'uk-sortable-moving',
|
47
48
|
dragCustomClass : '',
|
48
|
-
|
49
49
|
handleClass : false,
|
50
50
|
|
51
51
|
stop : function() {},
|
@@ -79,6 +79,7 @@
|
|
79
79
|
var handleDragStart = delegate(function(e) {
|
80
80
|
|
81
81
|
moving = false;
|
82
|
+
dragging = false;
|
82
83
|
|
83
84
|
var target = $(e.target), children = $this.element.children();
|
84
85
|
|
@@ -91,7 +92,7 @@
|
|
91
92
|
var handle = target.hasClass($this.options.handleClass) ? target : target.closest('.'+$this.options.handleClass, element);
|
92
93
|
|
93
94
|
if (!handle.length) {
|
94
|
-
e.preventDefault();
|
95
|
+
//e.preventDefault();
|
95
96
|
return;
|
96
97
|
}
|
97
98
|
}
|
@@ -109,25 +110,35 @@
|
|
109
110
|
|
110
111
|
var $current = $(currentlyDraggingElement), offset = $current.offset();
|
111
112
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
height : $current.height(),
|
118
|
-
padding : $current.css('padding')
|
119
|
-
}).data('mouse-offset', {
|
120
|
-
'left': offset.left - parseInt(e.pageX, 10),
|
121
|
-
'top' : offset.top - parseInt(e.pageY, 10)
|
122
|
-
}).append($current.html()).appendTo('body');
|
113
|
+
delayIdle = {
|
114
|
+
|
115
|
+
pos : { x:e.pageX, y:e.pageY },
|
116
|
+
threshold : $this.options.threshold,
|
117
|
+
'apply' : function() {
|
123
118
|
|
124
|
-
|
125
|
-
|
119
|
+
draggingPlaceholder = $('<div class="'+([$this.options.draggingClass, $this.options.dragCustomClass].join(' '))+'"></div>').css({
|
120
|
+
display : 'none',
|
121
|
+
top : offset.top,
|
122
|
+
left : offset.left,
|
123
|
+
width : $current.width(),
|
124
|
+
height : $current.height(),
|
125
|
+
padding : $current.css('padding')
|
126
|
+
}).data('mouse-offset', {
|
127
|
+
'left': offset.left - parseInt(e.pageX, 10),
|
128
|
+
'top' : offset.top - parseInt(e.pageY, 10)
|
129
|
+
}).append($current.html()).appendTo('body');
|
126
130
|
|
127
|
-
|
131
|
+
draggingPlaceholder.$current = $current;
|
132
|
+
draggingPlaceholder.$sortable = $this;
|
128
133
|
|
129
|
-
|
130
|
-
|
134
|
+
addFakeDragHandlers();
|
135
|
+
|
136
|
+
$this.options.start(this, currentlyDraggingElement);
|
137
|
+
$this.trigger('sortable-start', [$this, currentlyDraggingElement]);
|
138
|
+
|
139
|
+
delayIdle = false;
|
140
|
+
}
|
141
|
+
}
|
131
142
|
|
132
143
|
if (!supportsDragAndDrop) {
|
133
144
|
e.preventDefault();
|
@@ -185,6 +196,7 @@
|
|
185
196
|
|
186
197
|
var handleDrop = delegate(function(e) {
|
187
198
|
|
199
|
+
|
188
200
|
if (e.type === 'drop') {
|
189
201
|
|
190
202
|
if (e.stopPropagation) {
|
@@ -196,7 +208,7 @@
|
|
196
208
|
}
|
197
209
|
}
|
198
210
|
|
199
|
-
if (
|
211
|
+
if (!dragging) {
|
200
212
|
return;
|
201
213
|
}
|
202
214
|
|
@@ -339,6 +351,8 @@
|
|
339
351
|
|
340
352
|
moveElementNextTo: function(element, elementToMoveNextTo) {
|
341
353
|
|
354
|
+
dragging = true;
|
355
|
+
|
342
356
|
var $this = this,
|
343
357
|
list = $(element).parent().css('min-height', ''),
|
344
358
|
next = isBelow(element, elementToMoveNextTo) ? elementToMoveNextTo : elementToMoveNextTo.nextSibling,
|
@@ -347,7 +361,7 @@
|
|
347
361
|
|
348
362
|
if($this.options.warp || !$this.options.animation) {
|
349
363
|
elementToMoveNextTo.parentNode.insertBefore(element, next);
|
350
|
-
$
|
364
|
+
UI.Utils.checkDisplay($this.element);
|
351
365
|
return;
|
352
366
|
}
|
353
367
|
|
@@ -387,7 +401,7 @@
|
|
387
401
|
count--
|
388
402
|
if (!count) {
|
389
403
|
list.css('min-height', '');
|
390
|
-
|
404
|
+
UI.Utils.checkDisplay(ele);
|
391
405
|
}
|
392
406
|
});
|
393
407
|
}, 0);
|
@@ -447,9 +461,9 @@
|
|
447
461
|
}
|
448
462
|
|
449
463
|
// auto init
|
450
|
-
|
464
|
+
UI.ready(function(context) {
|
451
465
|
|
452
|
-
$("[data-uk-sortable]").each(function(){
|
466
|
+
$("[data-uk-sortable]", context).each(function(){
|
453
467
|
|
454
468
|
var ele = $(this);
|
455
469
|
|
@@ -459,7 +473,13 @@
|
|
459
473
|
});
|
460
474
|
});
|
461
475
|
|
462
|
-
|
476
|
+
UI.$doc.on('mousemove touchmove', function(e) {
|
477
|
+
|
478
|
+
if (delayIdle) {
|
479
|
+
if (Math.abs(e.pageX - delayIdle.pos.x) > delayIdle.threshold || Math.abs(e.pageY - delayIdle.pos.y) > delayIdle.threshold) {
|
480
|
+
delayIdle.apply();
|
481
|
+
}
|
482
|
+
}
|
463
483
|
|
464
484
|
if (draggingPlaceholder) {
|
465
485
|
|
@@ -481,13 +501,13 @@
|
|
481
501
|
}
|
482
502
|
});
|
483
503
|
|
484
|
-
|
504
|
+
UI.$doc.on('mouseup touchend', function() {
|
485
505
|
|
486
506
|
if(!moving && clickedlink) {
|
487
507
|
location.href = clickedlink.attr('href');
|
488
508
|
}
|
489
509
|
|
490
|
-
clickedlink = false;
|
510
|
+
delayIdle = clickedlink = false;
|
491
511
|
});
|
492
512
|
|
493
513
|
return UI.sortable;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! UIkit 2.
|
1
|
+
/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
2
|
|
3
3
|
(function(addon) {
|
4
4
|
|
@@ -25,32 +25,86 @@
|
|
25
25
|
defaults: {
|
26
26
|
top : 0,
|
27
27
|
bottom : 0,
|
28
|
+
animation : '',
|
29
|
+
clsinit : 'uk-sticky-init',
|
28
30
|
clsactive : 'uk-active',
|
29
|
-
|
30
|
-
|
31
|
+
getWidthFrom : '',
|
32
|
+
media : false,
|
33
|
+
target : false
|
31
34
|
},
|
32
35
|
|
33
36
|
init: function() {
|
34
37
|
|
35
38
|
var stickyId = this.element.attr('id') || ("s"+Math.ceil(Math.random()*10000)),
|
36
|
-
wrapper = $('<div></div>').
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
wrapper = $('<div class="uk-sticky-placeholder"></div>').css({
|
40
|
+
'height' : this.element.css('position') != 'absolute' ? this.element.outerHeight() : '',
|
41
|
+
'float' : this.element.css("float") != "none" ? this.element.css("float") : '',
|
42
|
+
'margin' : this.element.css("margin")
|
43
|
+
});
|
44
|
+
|
45
|
+
wrapper = this.element.css('margin', 0).wrap(wrapper).parent();
|
46
|
+
|
47
|
+
this.sticky = {
|
48
|
+
options : this.options,
|
49
|
+
element : this.element,
|
50
|
+
currentTop : null,
|
51
|
+
wrapper : wrapper,
|
52
|
+
init : false,
|
53
|
+
getWidthFrom : this.options.getWidthFrom || wrapper,
|
54
|
+
reset : function(force) {
|
55
|
+
|
56
|
+
var finalize = function() {
|
57
|
+
this.element.css({"position":"", "top":"", "width":"", "left":"", "margin":"0"});
|
58
|
+
this.element.removeClass([this.options.animation, 'uk-animation-reverse', this.options.clsactive].join(' '));
|
59
|
+
|
60
|
+
this.currentTop = null;
|
61
|
+
this.animate = false;
|
62
|
+
}.bind(this);
|
63
|
+
|
64
|
+
|
65
|
+
if (!force && this.options.animation && UI.support.animation) {
|
66
|
+
|
67
|
+
this.animate = true;
|
68
|
+
|
69
|
+
this.element.removeClass(this.options.animation).one(UI.support.animation.end, function(){
|
70
|
+
finalize();
|
71
|
+
}).width(); // force redraw
|
72
|
+
|
73
|
+
this.element.addClass(this.options.animation+' '+'uk-animation-reverse');
|
74
|
+
} else {
|
75
|
+
finalize();
|
76
|
+
}
|
77
|
+
},
|
78
|
+
check: function() {
|
79
|
+
|
80
|
+
if (this.options.media) {
|
81
|
+
|
82
|
+
switch(typeof(this.options.media)) {
|
83
|
+
case 'number':
|
84
|
+
if (window.innerWidth < this.options.media) {
|
85
|
+
return false;
|
86
|
+
}
|
87
|
+
break;
|
88
|
+
case 'string':
|
89
|
+
if (window.matchMedia && !window.matchMedia(this.options.media).matches) {
|
90
|
+
return false;
|
91
|
+
}
|
92
|
+
break;
|
93
|
+
}
|
94
|
+
}
|
95
|
+
|
96
|
+
var scrollTop = $win.scrollTop(),
|
97
|
+
documentHeight = $doc.height(),
|
98
|
+
dwh = documentHeight - $win.height(),
|
99
|
+
extra = (scrollTop > dwh) ? dwh - scrollTop : 0,
|
100
|
+
elementTop = this.wrapper.offset().top,
|
101
|
+
etse = elementTop - this.options.top - extra;
|
102
|
+
|
103
|
+
return (scrollTop >= etse);
|
104
|
+
}
|
105
|
+
};
|
44
106
|
|
45
|
-
sticked.push(
|
46
|
-
top: this.options.top,
|
47
|
-
bottom: this.options.bottom,
|
48
|
-
element: this.element,
|
49
|
-
currentTop: null,
|
50
|
-
wrapper: wrapper,
|
51
|
-
clsactive: this.options.clsactive,
|
52
|
-
getWidthFrom: this.options.getWidthFrom || wrapper
|
53
|
-
});
|
107
|
+
sticked.push(this.sticky);
|
54
108
|
},
|
55
109
|
|
56
110
|
update: function() {
|
@@ -65,33 +119,37 @@
|
|
65
119
|
var scrollTop = $win.scrollTop(),
|
66
120
|
documentHeight = $doc.height(),
|
67
121
|
dwh = documentHeight - $win.height(),
|
68
|
-
extra = (scrollTop > dwh) ? dwh - scrollTop : 0
|
122
|
+
extra = (scrollTop > dwh) ? dwh - scrollTop : 0,
|
123
|
+
cls, newTop;
|
124
|
+
|
125
|
+
if(scrollTop < 0) return;
|
126
|
+
|
69
127
|
|
70
128
|
for (var i = 0; i < sticked.length; i++) {
|
71
129
|
|
72
|
-
if (!sticked[i].element.is(":visible")) {
|
130
|
+
if (!sticked[i].element.is(":visible") || sticked[i].animate) {
|
73
131
|
continue;
|
74
132
|
}
|
75
133
|
|
76
|
-
var sticky
|
77
|
-
elementTop = sticky.wrapper.offset().top,
|
78
|
-
etse = elementTop - sticky.top - extra;
|
134
|
+
var sticky = sticked[i];
|
79
135
|
|
80
|
-
if (
|
136
|
+
if (!sticky.check()) {
|
81
137
|
|
82
138
|
if (sticky.currentTop !== null) {
|
83
|
-
sticky.
|
84
|
-
sticky.wrapper.removeClass(sticky.clsactive);
|
85
|
-
sticky.currentTop = null;
|
139
|
+
sticky.reset();
|
86
140
|
}
|
87
141
|
|
88
142
|
} else {
|
89
143
|
|
90
|
-
|
91
|
-
|
92
|
-
|
144
|
+
if (sticky.options.top < 0) {
|
145
|
+
newTop = 0;
|
146
|
+
} else {
|
147
|
+
newTop = documentHeight - sticky.element.outerHeight() - sticky.options.top - sticky.options.bottom - scrollTop - extra;
|
148
|
+
newTop = newTop < 0 ? newTop + sticky.options.top : sticky.options.top;
|
149
|
+
}
|
93
150
|
|
94
151
|
if (sticky.currentTop != newTop) {
|
152
|
+
|
95
153
|
sticky.element.css({
|
96
154
|
"position" : "fixed",
|
97
155
|
"top" : newTop,
|
@@ -99,23 +157,74 @@
|
|
99
157
|
"left" : sticky.wrapper.offset().left
|
100
158
|
});
|
101
159
|
|
102
|
-
|
160
|
+
if (!sticky.init) {
|
161
|
+
|
162
|
+
sticky.element.addClass(sticky.options.clsinit);
|
163
|
+
|
164
|
+
if (location.hash && scrollTop > 0 && sticky.options.target) {
|
165
|
+
|
166
|
+
var $target = $(location.hash);
|
167
|
+
|
168
|
+
if ($target.length) {
|
169
|
+
|
170
|
+
setTimeout((function($target, sticky){
|
171
|
+
|
172
|
+
return function() {
|
173
|
+
|
174
|
+
sticky.element.width(); // force redraw
|
175
|
+
|
176
|
+
var offset = $target.offset(),
|
177
|
+
maxoffset = offset.top + $target.outerHeight(),
|
178
|
+
stickyOffset = sticky.element.offset(),
|
179
|
+
stickyHeight = sticky.element.outerHeight(),
|
180
|
+
stickyMaxOffset = stickyOffset.top + stickyHeight;
|
181
|
+
|
182
|
+
if (stickyOffset.top < maxoffset && offset.top < stickyMaxOffset) {
|
183
|
+
scrollTop = offset.top - stickyHeight - sticky.options.target;
|
184
|
+
window.scrollTo(0, scrollTop);
|
185
|
+
}
|
186
|
+
};
|
187
|
+
|
188
|
+
})($target, sticky), 0);
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
|
193
|
+
sticky.element.addClass(sticky.options.clsactive);
|
194
|
+
sticky.element.css('margin', '');
|
195
|
+
|
196
|
+
if (sticky.options.animation && sticky.init) {
|
197
|
+
sticky.element.addClass(sticky.options.animation);
|
198
|
+
}
|
199
|
+
|
103
200
|
sticky.currentTop = newTop;
|
104
201
|
}
|
105
202
|
}
|
203
|
+
|
204
|
+
sticky.init = true;
|
106
205
|
}
|
107
206
|
|
108
207
|
}
|
109
208
|
|
110
209
|
// should be more efficient than using $win.scroll(scroller):
|
111
210
|
$doc.on('uk-scroll', scroller);
|
211
|
+
$win.on('resize orientationchange', UI.Utils.debounce(function() {
|
112
212
|
|
113
|
-
|
114
|
-
setTimeout(function(){
|
213
|
+
if (!sticked.length) return;
|
115
214
|
|
116
|
-
|
215
|
+
for (var i = 0; i < sticked.length; i++) {
|
216
|
+
sticked[i].reset(true);
|
217
|
+
}
|
218
|
+
|
219
|
+
scroller();
|
220
|
+
}, 100));
|
221
|
+
|
222
|
+
// init code
|
223
|
+
UI.ready(function(context) {
|
117
224
|
|
118
|
-
|
225
|
+
setTimeout(function(){
|
226
|
+
|
227
|
+
$("[data-uk-sticky]", context).each(function(){
|
119
228
|
|
120
229
|
var $ele = $(this);
|
121
230
|
|
@@ -123,6 +232,8 @@
|
|
123
232
|
UI.sticky($ele, UI.Utils.options($ele.attr('data-uk-sticky')));
|
124
233
|
}
|
125
234
|
});
|
235
|
+
|
236
|
+
scroller();
|
126
237
|
}, 0);
|
127
238
|
});
|
128
239
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
/*! UIkit 2.
|
1
|
+
/*! UIkit 2.9.0 | http://www.getuikit.com | (c) 2014 YOOtheme | MIT License */
|
2
2
|
|
3
3
|
(function(addon) {
|
4
4
|
|
@@ -67,18 +67,18 @@
|
|
67
67
|
this.element.wrap('<div class="uk-autocomplete"></div>');
|
68
68
|
|
69
69
|
this.autocomplete = UI.autocomplete(this.element.parent(), this.options);
|
70
|
-
this.autocomplete.dropdown.addClass('uk-dropdown-scrollable');
|
70
|
+
this.autocomplete.dropdown.addClass('uk-dropdown-small uk-dropdown-scrollable');
|
71
71
|
|
72
72
|
this.autocomplete.on('autocomplete-show', function() {
|
73
73
|
|
74
|
-
var selected = $this.autocomplete.dropdown.find('[data-value="'+$this.
|
74
|
+
var selected = $this.autocomplete.dropdown.find('[data-value="'+$this.autocomplete.input.val()+'"]');
|
75
75
|
|
76
76
|
setTimeout(function(){
|
77
77
|
$this.autocomplete.pick(selected, true);
|
78
78
|
}, 10);
|
79
79
|
});
|
80
80
|
|
81
|
-
this.
|
81
|
+
this.autocomplete.input.on('focus', function(){
|
82
82
|
|
83
83
|
$this.autocomplete.value = Math.random();
|
84
84
|
$this.autocomplete.triggercomplete();
|
@@ -92,7 +92,7 @@
|
|
92
92
|
|
93
93
|
checkTime: function() {
|
94
94
|
|
95
|
-
var arr, timeArray, meridian = 'AM', hour, minute, time = this.
|
95
|
+
var arr, timeArray, meridian = 'AM', hour, minute, time = this.autocomplete.input.val();
|
96
96
|
|
97
97
|
if (this.options.format == '12h') {
|
98
98
|
arr = time.split(' ');
|
@@ -140,7 +140,7 @@
|
|
140
140
|
minute = 0;
|
141
141
|
}
|
142
142
|
|
143
|
-
this.
|
143
|
+
this.autocomplete.input.val(this.formatTime(hour, minute, meridian));
|
144
144
|
},
|
145
145
|
|
146
146
|
formatTime: function(hour, minute, meridian) {
|
@@ -151,13 +151,15 @@
|
|
151
151
|
});
|
152
152
|
|
153
153
|
// init code
|
154
|
-
|
154
|
+
UI.$doc.on("focus.timepicker.uikit", "[data-uk-timepicker]", function(e) {
|
155
155
|
var ele = $(this);
|
156
156
|
|
157
157
|
if (!ele.data("timepicker")) {
|
158
158
|
var obj = UI.timepicker(ele, UI.Utils.options(ele.attr("data-uk-timepicker")));
|
159
159
|
|
160
|
-
|
160
|
+
setTimeout(function(){
|
161
|
+
obj.autocomplete.input.focus();
|
162
|
+
}, 20);
|
161
163
|
}
|
162
164
|
});
|
163
|
-
});
|
165
|
+
});
|