materialize-sass 0.99.0 → 0.100.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +2 -2
- data/app/assets/javascripts/materialize.js +6015 -5060
- data/app/assets/javascripts/materialize/animation.js +4 -5
- data/app/assets/javascripts/materialize/buttons.js +24 -38
- data/app/assets/javascripts/materialize/cards.js +13 -21
- data/app/assets/javascripts/materialize/carousel.js +122 -110
- data/app/assets/javascripts/materialize/character_counter.js +14 -22
- data/app/assets/javascripts/materialize/chips.js +41 -44
- data/app/assets/javascripts/materialize/collapsible.js +41 -46
- data/app/assets/javascripts/materialize/date_picker/picker.date.js +965 -1167
- data/app/assets/javascripts/materialize/date_picker/picker.js +546 -634
- data/app/assets/javascripts/materialize/date_picker/picker.time.js +166 -212
- data/app/assets/javascripts/materialize/dropdown.js +53 -68
- data/app/assets/javascripts/materialize/extras/nouislider.js +3 -1
- data/app/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
- data/app/assets/javascripts/materialize/forms.js +156 -154
- data/app/assets/javascripts/materialize/global.js +34 -43
- data/app/assets/javascripts/materialize/hammer.min.js +424 -1
- data/app/assets/javascripts/materialize/initial.js +3 -3
- data/app/assets/javascripts/materialize/jquery.easing.1.4.js +120 -142
- data/app/assets/javascripts/materialize/jquery.hammer.js +9 -9
- data/app/assets/javascripts/materialize/materialbox.js +81 -107
- data/app/assets/javascripts/materialize/modal.js +373 -162
- data/app/assets/javascripts/materialize/parallax.js +11 -15
- data/app/assets/javascripts/materialize/pushpin.js +2 -5
- data/app/assets/javascripts/materialize/scrollFire.js +9 -11
- data/app/assets/javascripts/materialize/scrollspy.js +84 -92
- data/app/assets/javascripts/materialize/sideNav.js +128 -139
- data/app/assets/javascripts/materialize/slider.js +83 -112
- data/app/assets/javascripts/materialize/tabs.js +196 -196
- data/app/assets/javascripts/materialize/tapTarget.js +170 -173
- data/app/assets/javascripts/materialize/toasts.js +330 -112
- data/app/assets/javascripts/materialize/tooltip.js +134 -145
- data/app/assets/javascripts/materialize/transitions.js +43 -49
- data/app/assets/javascripts/materialize/velocity.min.js +623 -2
- data/app/assets/javascripts/materialize/waves.js +42 -47
- data/app/assets/stylesheets/materialize/components/_buttons.scss +1 -1
- data/app/assets/stylesheets/materialize/components/_carousel.scss +4 -5
- data/app/assets/stylesheets/materialize/components/_chips.scss +1 -0
- data/app/assets/stylesheets/materialize/components/_collapsible.scss +4 -7
- data/app/assets/stylesheets/materialize/components/_color.scss +1 -1
- data/app/assets/stylesheets/materialize/components/_global.scss +8 -14
- data/app/assets/stylesheets/materialize/components/_navbar.scss +0 -1
- data/app/assets/stylesheets/materialize/components/_tabs.scss +1 -7
- data/app/assets/stylesheets/materialize/components/_toast.scss +6 -12
- data/app/assets/stylesheets/materialize/components/_variables.scss +55 -43
- data/app/assets/stylesheets/materialize/components/date_picker/_default.scss +1 -0
- data/app/assets/stylesheets/materialize/components/forms/_checkboxes.scss +2 -12
- data/app/assets/stylesheets/materialize/components/forms/_file-input.scss +6 -0
- data/app/assets/stylesheets/materialize/components/forms/_input-fields.scss +67 -37
- data/app/assets/stylesheets/materialize/components/forms/_radio-buttons.scss +1 -3
- data/app/assets/stylesheets/materialize/components/forms/_select.scss +72 -11
- data/app/assets/stylesheets/materialize/components/forms/_switches.scss +2 -4
- data/app/assets/stylesheets/materialize/extras/nouislider.css +8 -1
- data/lib/materialize-sass/version.rb +1 -1
- metadata +2 -5
- data/app/assets/javascripts/materialize/init.js +0 -214
- data/app/assets/javascripts/materialize/jquery.timeago.min.js +0 -1
- data/app/assets/javascripts/materialize/prism.js +0 -8
@@ -1,87 +1,79 @@
|
|
1
1
|
(function ($) {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
2
|
+
$.fn.tooltip = function (options) {
|
3
|
+
var timeout = null,
|
4
|
+
margin = 5;
|
5
|
+
|
6
|
+
// Defaults
|
7
|
+
var defaults = {
|
8
|
+
delay: 350,
|
9
|
+
tooltip: '',
|
10
|
+
position: 'bottom',
|
11
|
+
html: false
|
12
|
+
};
|
13
|
+
|
14
|
+
// Remove tooltip from the activator
|
15
|
+
if (options === "remove") {
|
16
|
+
this.each(function () {
|
17
|
+
$('#' + $(this).attr('data-tooltip-id')).remove();
|
18
|
+
$(this).removeAttr('data-tooltip-id');
|
19
|
+
$(this).off('mouseenter.tooltip mouseleave.tooltip');
|
20
|
+
});
|
21
|
+
return false;
|
22
|
+
}
|
23
|
+
|
24
|
+
options = $.extend(defaults, options);
|
13
25
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
26
|
+
return this.each(function () {
|
27
|
+
var tooltipId = Materialize.guid();
|
28
|
+
var origin = $(this);
|
29
|
+
|
30
|
+
// Destroy old tooltip
|
31
|
+
if (origin.attr('data-tooltip-id')) {
|
32
|
+
$('#' + origin.attr('data-tooltip-id')).remove();
|
21
33
|
}
|
22
34
|
|
23
|
-
|
35
|
+
origin.attr('data-tooltip-id', tooltipId);
|
36
|
+
|
37
|
+
// Get attributes.
|
38
|
+
var allowHtml, tooltipDelay, tooltipPosition, tooltipText, tooltipEl, backdrop;
|
39
|
+
var setAttributes = function () {
|
40
|
+
allowHtml = origin.attr('data-html') ? origin.attr('data-html') === 'true' : options.html;
|
41
|
+
tooltipDelay = origin.attr('data-delay');
|
42
|
+
tooltipDelay = tooltipDelay === undefined || tooltipDelay === '' ? options.delay : tooltipDelay;
|
43
|
+
tooltipPosition = origin.attr('data-position');
|
44
|
+
tooltipPosition = tooltipPosition === undefined || tooltipPosition === '' ? options.position : tooltipPosition;
|
45
|
+
tooltipText = origin.attr('data-tooltip');
|
46
|
+
tooltipText = tooltipText === undefined || tooltipText === '' ? options.tooltip : tooltipText;
|
47
|
+
};
|
48
|
+
setAttributes();
|
24
49
|
|
25
|
-
|
26
|
-
var
|
27
|
-
var origin = $(this);
|
50
|
+
var renderTooltipEl = function () {
|
51
|
+
var tooltip = $('<div class="material-tooltip"></div>');
|
28
52
|
|
29
|
-
//
|
30
|
-
if (
|
31
|
-
|
53
|
+
// Create Text span
|
54
|
+
if (allowHtml) {
|
55
|
+
tooltipText = $('<span></span>').html(tooltipText);
|
56
|
+
} else {
|
57
|
+
tooltipText = $('<span></span>').text(tooltipText);
|
32
58
|
}
|
33
59
|
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
tooltipText = origin.attr('data-tooltip');
|
52
|
-
tooltipText = (tooltipText === undefined || tooltipText === '') ?
|
53
|
-
options.tooltip : tooltipText;
|
54
|
-
};
|
55
|
-
setAttributes();
|
56
|
-
|
57
|
-
var renderTooltipEl = function() {
|
58
|
-
var tooltip = $('<div class="material-tooltip"></div>');
|
59
|
-
|
60
|
-
// Create Text span
|
61
|
-
if (allowHtml) {
|
62
|
-
tooltipText = $('<span></span>').html(tooltipText);
|
63
|
-
} else{
|
64
|
-
tooltipText = $('<span></span>').text(tooltipText);
|
65
|
-
}
|
66
|
-
|
67
|
-
// Create tooltip
|
68
|
-
tooltip.append(tooltipText)
|
69
|
-
.appendTo($('body'))
|
70
|
-
.attr('id', tooltipId);
|
71
|
-
|
72
|
-
// Create backdrop
|
73
|
-
backdrop = $('<div class="backdrop"></div>');
|
74
|
-
backdrop.appendTo(tooltip);
|
75
|
-
return tooltip;
|
76
|
-
};
|
77
|
-
tooltipEl = renderTooltipEl();
|
78
|
-
|
79
|
-
// Destroy previously binded events
|
80
|
-
origin.off('mouseenter.tooltip mouseleave.tooltip');
|
81
|
-
// Mouse In
|
82
|
-
var started = false, timeoutRef;
|
83
|
-
origin.on({'mouseenter.tooltip': function(e) {
|
84
|
-
var showTooltip = function() {
|
60
|
+
// Create tooltip
|
61
|
+
tooltip.append(tooltipText).appendTo($('body')).attr('id', tooltipId);
|
62
|
+
|
63
|
+
// Create backdrop
|
64
|
+
backdrop = $('<div class="backdrop"></div>');
|
65
|
+
backdrop.appendTo(tooltip);
|
66
|
+
return tooltip;
|
67
|
+
};
|
68
|
+
tooltipEl = renderTooltipEl();
|
69
|
+
|
70
|
+
// Destroy previously binded events
|
71
|
+
origin.off('mouseenter.tooltip mouseleave.tooltip');
|
72
|
+
// Mouse In
|
73
|
+
var started = false,
|
74
|
+
timeoutRef;
|
75
|
+
origin.on({ 'mouseenter.tooltip': function (e) {
|
76
|
+
var showTooltip = function () {
|
85
77
|
setAttributes();
|
86
78
|
started = true;
|
87
79
|
tooltipEl.velocity('stop');
|
@@ -105,7 +97,7 @@
|
|
105
97
|
if (tooltipPosition === "top") {
|
106
98
|
// Top Position
|
107
99
|
targetTop = origin.offset().top - tooltipHeight - margin;
|
108
|
-
targetLeft = origin.offset().left + originWidth/2 - tooltipWidth/2;
|
100
|
+
targetLeft = origin.offset().left + originWidth / 2 - tooltipWidth / 2;
|
109
101
|
newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
|
110
102
|
tooltipVerticalMovement = '-10px';
|
111
103
|
backdrop.css({
|
@@ -114,57 +106,56 @@
|
|
114
106
|
borderRadius: '14px 14px 0 0',
|
115
107
|
transformOrigin: '50% 100%',
|
116
108
|
marginTop: tooltipHeight,
|
117
|
-
marginLeft:
|
109
|
+
marginLeft: tooltipWidth / 2 - backdropOffsetWidth / 2
|
118
110
|
});
|
119
111
|
}
|
120
112
|
// Left Position
|
121
113
|
else if (tooltipPosition === "left") {
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
}
|
114
|
+
targetTop = origin.offset().top + originHeight / 2 - tooltipHeight / 2;
|
115
|
+
targetLeft = origin.offset().left - tooltipWidth - margin;
|
116
|
+
newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
|
117
|
+
|
118
|
+
tooltipHorizontalMovement = '-10px';
|
119
|
+
backdrop.css({
|
120
|
+
top: '-7px',
|
121
|
+
right: 0,
|
122
|
+
width: '14px',
|
123
|
+
height: '14px',
|
124
|
+
borderRadius: '14px 0 0 14px',
|
125
|
+
transformOrigin: '95% 50%',
|
126
|
+
marginTop: tooltipHeight / 2,
|
127
|
+
marginLeft: tooltipWidth
|
128
|
+
});
|
129
|
+
}
|
130
|
+
// Right Position
|
131
|
+
else if (tooltipPosition === "right") {
|
132
|
+
targetTop = origin.offset().top + originHeight / 2 - tooltipHeight / 2;
|
133
|
+
targetLeft = origin.offset().left + originWidth + margin;
|
134
|
+
newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
|
135
|
+
|
136
|
+
tooltipHorizontalMovement = '+10px';
|
137
|
+
backdrop.css({
|
138
|
+
top: '-7px',
|
139
|
+
left: 0,
|
140
|
+
width: '14px',
|
141
|
+
height: '14px',
|
142
|
+
borderRadius: '0 14px 14px 0',
|
143
|
+
transformOrigin: '5% 50%',
|
144
|
+
marginTop: tooltipHeight / 2,
|
145
|
+
marginLeft: '0px'
|
146
|
+
});
|
147
|
+
} else {
|
148
|
+
// Bottom Position
|
149
|
+
targetTop = origin.offset().top + origin.outerHeight() + margin;
|
150
|
+
targetLeft = origin.offset().left + originWidth / 2 - tooltipWidth / 2;
|
151
|
+
newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
|
152
|
+
tooltipVerticalMovement = '+10px';
|
153
|
+
backdrop.css({
|
154
|
+
top: 0,
|
155
|
+
left: 0,
|
156
|
+
marginLeft: tooltipWidth / 2 - backdropOffsetWidth / 2
|
157
|
+
});
|
158
|
+
}
|
168
159
|
|
169
160
|
// Set tooptip css placement
|
170
161
|
tooltipEl.css({
|
@@ -177,43 +168,41 @@
|
|
177
168
|
scaleYFactor = Math.SQRT2 * tooltipHeight / parseInt(backdropOffsetHeight);
|
178
169
|
scaleFactor = Math.max(scaleXFactor, scaleYFactor);
|
179
170
|
|
180
|
-
tooltipEl.velocity({ translateY: tooltipVerticalMovement, translateX: tooltipHorizontalMovement}, { duration: 350, queue: false })
|
181
|
-
|
182
|
-
backdrop.css({ visibility: 'visible' })
|
183
|
-
.velocity({opacity:1},{duration: 55, delay: 0, queue: false})
|
184
|
-
.velocity({scaleX: scaleFactor, scaleY: scaleFactor}, {duration: 300, delay: 0, queue: false, easing: 'easeInOutQuad'});
|
171
|
+
tooltipEl.velocity({ translateY: tooltipVerticalMovement, translateX: tooltipHorizontalMovement }, { duration: 350, queue: false }).velocity({ opacity: 1 }, { duration: 300, delay: 50, queue: false });
|
172
|
+
backdrop.css({ visibility: 'visible' }).velocity({ opacity: 1 }, { duration: 55, delay: 0, queue: false }).velocity({ scaleX: scaleFactor, scaleY: scaleFactor }, { duration: 300, delay: 0, queue: false, easing: 'easeInOutQuad' });
|
185
173
|
};
|
186
174
|
|
187
175
|
timeoutRef = setTimeout(showTooltip, tooltipDelay); // End Interval
|
188
176
|
|
189
|
-
|
177
|
+
// Mouse Out
|
190
178
|
},
|
191
|
-
'mouseleave.tooltip': function(){
|
179
|
+
'mouseleave.tooltip': function () {
|
192
180
|
// Reset State
|
193
181
|
started = false;
|
194
182
|
clearTimeout(timeoutRef);
|
195
183
|
|
196
184
|
// Animate back
|
197
|
-
setTimeout(function() {
|
185
|
+
setTimeout(function () {
|
198
186
|
if (started !== true) {
|
199
187
|
tooltipEl.velocity({
|
200
|
-
opacity: 0, translateY: 0, translateX: 0}, { duration: 225, queue: false});
|
201
|
-
backdrop.velocity({opacity: 0, scaleX: 1, scaleY: 1}, {
|
202
|
-
duration:225,
|
188
|
+
opacity: 0, translateY: 0, translateX: 0 }, { duration: 225, queue: false });
|
189
|
+
backdrop.velocity({ opacity: 0, scaleX: 1, scaleY: 1 }, {
|
190
|
+
duration: 225,
|
203
191
|
queue: false,
|
204
|
-
complete: function(){
|
192
|
+
complete: function () {
|
205
193
|
backdrop.css({ visibility: 'hidden' });
|
206
194
|
tooltipEl.css({ visibility: 'hidden' });
|
207
|
-
started = false;
|
195
|
+
started = false;
|
196
|
+
}
|
208
197
|
});
|
209
198
|
}
|
210
|
-
},225);
|
199
|
+
}, 225);
|
211
200
|
}
|
212
|
-
|
201
|
+
});
|
213
202
|
});
|
214
203
|
};
|
215
204
|
|
216
|
-
var repositionWithinScreen = function(x, y, width, height) {
|
205
|
+
var repositionWithinScreen = function (x, y, width, height) {
|
217
206
|
var newX = x;
|
218
207
|
var newY = y;
|
219
208
|
|
@@ -229,10 +218,10 @@
|
|
229
218
|
newY -= newY + height - window.innerHeight;
|
230
219
|
}
|
231
220
|
|
232
|
-
return {x: newX, y: newY};
|
221
|
+
return { x: newX, y: newY };
|
233
222
|
};
|
234
223
|
|
235
|
-
$(document).on('ready turbolinks:load', function(){
|
236
|
-
|
237
|
-
|
238
|
-
}(
|
224
|
+
$(document).on('ready turbolinks:load', function () {
|
225
|
+
$('.tooltipped').tooltip();
|
226
|
+
});
|
227
|
+
})(jQuery);
|
@@ -1,36 +1,36 @@
|
|
1
1
|
(function ($) {
|
2
2
|
// Image transition function
|
3
|
-
Materialize.fadeInImage = function(selectorOrEl) {
|
3
|
+
Materialize.fadeInImage = function (selectorOrEl) {
|
4
4
|
var element;
|
5
|
-
if (typeof
|
5
|
+
if (typeof selectorOrEl === 'string') {
|
6
6
|
element = $(selectorOrEl);
|
7
|
-
} else if (typeof
|
7
|
+
} else if (typeof selectorOrEl === 'object') {
|
8
8
|
element = selectorOrEl;
|
9
9
|
} else {
|
10
10
|
return;
|
11
11
|
}
|
12
|
-
element.css({opacity: 0});
|
13
|
-
$(element).velocity({opacity: 1}, {
|
12
|
+
element.css({ opacity: 0 });
|
13
|
+
$(element).velocity({ opacity: 1 }, {
|
14
14
|
duration: 650,
|
15
15
|
queue: false,
|
16
16
|
easing: 'easeOutSine'
|
17
17
|
});
|
18
|
-
$(element).velocity({opacity: 1}, {
|
18
|
+
$(element).velocity({ opacity: 1 }, {
|
19
19
|
duration: 1300,
|
20
20
|
queue: false,
|
21
21
|
easing: 'swing',
|
22
|
-
step: function(now, fx) {
|
22
|
+
step: function (now, fx) {
|
23
23
|
fx.start = 100;
|
24
|
-
var grayscale_setting = now/100;
|
25
|
-
var brightness_setting = 150 - (100 - now)/1.75;
|
24
|
+
var grayscale_setting = now / 100;
|
25
|
+
var brightness_setting = 150 - (100 - now) / 1.75;
|
26
26
|
|
27
27
|
if (brightness_setting < 100) {
|
28
28
|
brightness_setting = 100;
|
29
29
|
}
|
30
30
|
if (now >= 0) {
|
31
31
|
$(this).css({
|
32
|
-
|
33
|
-
|
32
|
+
"-webkit-filter": "grayscale(" + grayscale_setting + ")" + "brightness(" + brightness_setting + "%)",
|
33
|
+
"filter": "grayscale(" + grayscale_setting + ")" + "brightness(" + brightness_setting + "%)"
|
34
34
|
});
|
35
35
|
}
|
36
36
|
}
|
@@ -38,30 +38,25 @@
|
|
38
38
|
};
|
39
39
|
|
40
40
|
// Horizontal staggered list
|
41
|
-
Materialize.showStaggeredList = function(selectorOrEl) {
|
41
|
+
Materialize.showStaggeredList = function (selectorOrEl) {
|
42
42
|
var element;
|
43
|
-
if (typeof
|
43
|
+
if (typeof selectorOrEl === 'string') {
|
44
44
|
element = $(selectorOrEl);
|
45
|
-
} else if (typeof
|
45
|
+
} else if (typeof selectorOrEl === 'object') {
|
46
46
|
element = selectorOrEl;
|
47
47
|
} else {
|
48
48
|
return;
|
49
49
|
}
|
50
50
|
var time = 0;
|
51
|
-
element.find('li').velocity(
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
element.find('li').each(function() {
|
56
|
-
$(this).velocity(
|
57
|
-
{ opacity: "1", translateX: "0"},
|
58
|
-
{ duration: 800, delay: time, easing: [60, 10] });
|
51
|
+
element.find('li').velocity({ translateX: "-100px" }, { duration: 0 });
|
52
|
+
|
53
|
+
element.find('li').each(function () {
|
54
|
+
$(this).velocity({ opacity: "1", translateX: "0" }, { duration: 800, delay: time, easing: [60, 10] });
|
59
55
|
time += 120;
|
60
56
|
});
|
61
57
|
};
|
62
58
|
|
63
|
-
|
64
|
-
$(document).on('ready turbolinks:load', function() {
|
59
|
+
$(document).on('ready turbolinks:load', function () {
|
65
60
|
// Hardcoded .staggered-list scrollFire
|
66
61
|
// var staggeredListOptions = [];
|
67
62
|
// $('ul.staggered-list').each(function (i) {
|
@@ -81,12 +76,11 @@
|
|
81
76
|
var swipeLeft = false;
|
82
77
|
var swipeRight = false;
|
83
78
|
|
84
|
-
|
85
79
|
// Dismissible Collections
|
86
|
-
$('.dismissable').each(function() {
|
80
|
+
$('.dismissable').each(function () {
|
87
81
|
$(this).hammer({
|
88
82
|
prevent_default: false
|
89
|
-
}).on('pan', function(e) {
|
83
|
+
}).on('pan', function (e) {
|
90
84
|
if (e.gesture.pointerType === "touch") {
|
91
85
|
var $this = $(this);
|
92
86
|
var direction = e.gesture.direction;
|
@@ -94,21 +88,21 @@
|
|
94
88
|
var velocityX = e.gesture.velocityX;
|
95
89
|
|
96
90
|
$this.velocity({ translateX: x
|
97
|
-
|
91
|
+
}, { duration: 50, queue: false, easing: 'easeOutQuad' });
|
98
92
|
|
99
93
|
// Swipe Left
|
100
|
-
if (direction === 4 && (x >
|
94
|
+
if (direction === 4 && (x > $this.innerWidth() / 2 || velocityX < -0.75)) {
|
101
95
|
swipeLeft = true;
|
102
96
|
}
|
103
97
|
|
104
98
|
// Swipe Right
|
105
|
-
if (direction === 2 && (x <
|
99
|
+
if (direction === 2 && (x < -1 * $this.innerWidth() / 2 || velocityX > 0.75)) {
|
106
100
|
swipeRight = true;
|
107
101
|
}
|
108
102
|
}
|
109
|
-
}).on('panend', function(e) {
|
103
|
+
}).on('panend', function (e) {
|
110
104
|
// Reset if collection is moved back into original position
|
111
|
-
if (Math.abs(e.gesture.deltaX) <
|
105
|
+
if (Math.abs(e.gesture.deltaX) < $(this).innerWidth() / 2) {
|
112
106
|
swipeRight = false;
|
113
107
|
swipeLeft = false;
|
114
108
|
}
|
@@ -117,32 +111,32 @@
|
|
117
111
|
var $this = $(this);
|
118
112
|
if (swipeLeft || swipeRight) {
|
119
113
|
var fullWidth;
|
120
|
-
if (swipeLeft) {
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
114
|
+
if (swipeLeft) {
|
115
|
+
fullWidth = $this.innerWidth();
|
116
|
+
} else {
|
117
|
+
fullWidth = -1 * $this.innerWidth();
|
118
|
+
}
|
119
|
+
|
120
|
+
$this.velocity({ translateX: fullWidth
|
121
|
+
}, { duration: 100, queue: false, easing: 'easeOutQuad', complete: function () {
|
126
122
|
$this.css('border', 'none');
|
127
|
-
$this.velocity({ height: 0, padding: 0
|
128
|
-
|
129
|
-
|
130
|
-
}
|
123
|
+
$this.velocity({ height: 0, padding: 0
|
124
|
+
}, { duration: 200, queue: false, easing: 'easeOutQuad', complete: function () {
|
125
|
+
$this.remove();
|
126
|
+
}
|
127
|
+
});
|
131
128
|
}
|
132
129
|
});
|
133
|
-
}
|
134
|
-
|
135
|
-
|
136
|
-
}, {duration: 100, queue: false, easing: 'easeOutQuad'});
|
130
|
+
} else {
|
131
|
+
$this.velocity({ translateX: 0
|
132
|
+
}, { duration: 100, queue: false, easing: 'easeOutQuad' });
|
137
133
|
}
|
138
134
|
swipeLeft = false;
|
139
135
|
swipeRight = false;
|
140
136
|
}
|
141
137
|
});
|
142
|
-
|
143
138
|
});
|
144
139
|
|
145
|
-
|
146
140
|
// time = 0
|
147
141
|
// // Vertical Staggered list
|
148
142
|
// $('ul.staggered-list.vertical li').velocity(
|
@@ -166,4 +160,4 @@
|
|
166
160
|
// { duration: 800, easing: [60, 10] });
|
167
161
|
// });
|
168
162
|
});
|
169
|
-
}(
|
163
|
+
})(jQuery);
|