materialize-sass 0.99.0 → 0.100.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.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +2 -2
  3. data/app/assets/javascripts/materialize.js +6015 -5060
  4. data/app/assets/javascripts/materialize/animation.js +4 -5
  5. data/app/assets/javascripts/materialize/buttons.js +24 -38
  6. data/app/assets/javascripts/materialize/cards.js +13 -21
  7. data/app/assets/javascripts/materialize/carousel.js +122 -110
  8. data/app/assets/javascripts/materialize/character_counter.js +14 -22
  9. data/app/assets/javascripts/materialize/chips.js +41 -44
  10. data/app/assets/javascripts/materialize/collapsible.js +41 -46
  11. data/app/assets/javascripts/materialize/date_picker/picker.date.js +965 -1167
  12. data/app/assets/javascripts/materialize/date_picker/picker.js +546 -634
  13. data/app/assets/javascripts/materialize/date_picker/picker.time.js +166 -212
  14. data/app/assets/javascripts/materialize/dropdown.js +53 -68
  15. data/app/assets/javascripts/materialize/extras/nouislider.js +3 -1
  16. data/app/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
  17. data/app/assets/javascripts/materialize/forms.js +156 -154
  18. data/app/assets/javascripts/materialize/global.js +34 -43
  19. data/app/assets/javascripts/materialize/hammer.min.js +424 -1
  20. data/app/assets/javascripts/materialize/initial.js +3 -3
  21. data/app/assets/javascripts/materialize/jquery.easing.1.4.js +120 -142
  22. data/app/assets/javascripts/materialize/jquery.hammer.js +9 -9
  23. data/app/assets/javascripts/materialize/materialbox.js +81 -107
  24. data/app/assets/javascripts/materialize/modal.js +373 -162
  25. data/app/assets/javascripts/materialize/parallax.js +11 -15
  26. data/app/assets/javascripts/materialize/pushpin.js +2 -5
  27. data/app/assets/javascripts/materialize/scrollFire.js +9 -11
  28. data/app/assets/javascripts/materialize/scrollspy.js +84 -92
  29. data/app/assets/javascripts/materialize/sideNav.js +128 -139
  30. data/app/assets/javascripts/materialize/slider.js +83 -112
  31. data/app/assets/javascripts/materialize/tabs.js +196 -196
  32. data/app/assets/javascripts/materialize/tapTarget.js +170 -173
  33. data/app/assets/javascripts/materialize/toasts.js +330 -112
  34. data/app/assets/javascripts/materialize/tooltip.js +134 -145
  35. data/app/assets/javascripts/materialize/transitions.js +43 -49
  36. data/app/assets/javascripts/materialize/velocity.min.js +623 -2
  37. data/app/assets/javascripts/materialize/waves.js +42 -47
  38. data/app/assets/stylesheets/materialize/components/_buttons.scss +1 -1
  39. data/app/assets/stylesheets/materialize/components/_carousel.scss +4 -5
  40. data/app/assets/stylesheets/materialize/components/_chips.scss +1 -0
  41. data/app/assets/stylesheets/materialize/components/_collapsible.scss +4 -7
  42. data/app/assets/stylesheets/materialize/components/_color.scss +1 -1
  43. data/app/assets/stylesheets/materialize/components/_global.scss +8 -14
  44. data/app/assets/stylesheets/materialize/components/_navbar.scss +0 -1
  45. data/app/assets/stylesheets/materialize/components/_tabs.scss +1 -7
  46. data/app/assets/stylesheets/materialize/components/_toast.scss +6 -12
  47. data/app/assets/stylesheets/materialize/components/_variables.scss +55 -43
  48. data/app/assets/stylesheets/materialize/components/date_picker/_default.scss +1 -0
  49. data/app/assets/stylesheets/materialize/components/forms/_checkboxes.scss +2 -12
  50. data/app/assets/stylesheets/materialize/components/forms/_file-input.scss +6 -0
  51. data/app/assets/stylesheets/materialize/components/forms/_input-fields.scss +67 -37
  52. data/app/assets/stylesheets/materialize/components/forms/_radio-buttons.scss +1 -3
  53. data/app/assets/stylesheets/materialize/components/forms/_select.scss +72 -11
  54. data/app/assets/stylesheets/materialize/components/forms/_switches.scss +2 -4
  55. data/app/assets/stylesheets/materialize/extras/nouislider.css +8 -1
  56. data/lib/materialize-sass/version.rb +1 -1
  57. metadata +2 -5
  58. data/app/assets/javascripts/materialize/init.js +0 -214
  59. data/app/assets/javascripts/materialize/jquery.timeago.min.js +0 -1
  60. data/app/assets/javascripts/materialize/prism.js +0 -8
@@ -1,87 +1,79 @@
1
1
  (function ($) {
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
- };
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
- // Remove tooltip from the activator
15
- if (options === "remove") {
16
- this.each(function() {
17
- $('#' + $(this).attr('data-tooltip-id')).remove();
18
- $(this).off('mouseenter.tooltip mouseleave.tooltip');
19
- });
20
- return false;
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
- options = $.extend(defaults, options);
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
- return this.each(function() {
26
- var tooltipId = Materialize.guid();
27
- var origin = $(this);
50
+ var renderTooltipEl = function () {
51
+ var tooltip = $('<div class="material-tooltip"></div>');
28
52
 
29
- // Destroy old tooltip
30
- if (origin.attr('data-tooltip-id')) {
31
- $('#' + origin.attr('data-tooltip-id')).remove();
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
- origin.attr('data-tooltip-id', tooltipId);
35
-
36
- // Get attributes.
37
- var allowHtml,
38
- tooltipDelay,
39
- tooltipPosition,
40
- tooltipText,
41
- tooltipEl,
42
- backdrop;
43
- var setAttributes = function() {
44
- allowHtml = origin.attr('data-html') ? origin.attr('data-html') === 'true' : options.html;
45
- tooltipDelay = origin.attr('data-delay');
46
- tooltipDelay = (tooltipDelay === undefined || tooltipDelay === '') ?
47
- options.delay : tooltipDelay;
48
- tooltipPosition = origin.attr('data-position');
49
- tooltipPosition = (tooltipPosition === undefined || tooltipPosition === '') ?
50
- options.position : tooltipPosition;
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: (tooltipWidth/2) - (backdropOffsetWidth/2)
109
+ marginLeft: tooltipWidth / 2 - backdropOffsetWidth / 2
118
110
  });
119
111
  }
120
112
  // Left Position
121
113
  else if (tooltipPosition === "left") {
122
- targetTop = origin.offset().top + originHeight/2 - tooltipHeight/2;
123
- targetLeft = origin.offset().left - tooltipWidth - margin;
124
- newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
125
-
126
- tooltipHorizontalMovement = '-10px';
127
- backdrop.css({
128
- top: '-7px',
129
- right: 0,
130
- width: '14px',
131
- height: '14px',
132
- borderRadius: '14px 0 0 14px',
133
- transformOrigin: '95% 50%',
134
- marginTop: tooltipHeight/2,
135
- marginLeft: tooltipWidth
136
- });
137
- }
138
- // Right Position
139
- else if (tooltipPosition === "right") {
140
- targetTop = origin.offset().top + originHeight/2 - tooltipHeight/2;
141
- targetLeft = origin.offset().left + originWidth + margin;
142
- newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
143
-
144
- tooltipHorizontalMovement = '+10px';
145
- backdrop.css({
146
- top: '-7px',
147
- left: 0,
148
- width: '14px',
149
- height: '14px',
150
- borderRadius: '0 14px 14px 0',
151
- transformOrigin: '5% 50%',
152
- marginTop: tooltipHeight/2,
153
- marginLeft: '0px'
154
- });
155
- }
156
- else {
157
- // Bottom Position
158
- targetTop = origin.offset().top + origin.outerHeight() + margin;
159
- targetLeft = origin.offset().left + originWidth/2 - tooltipWidth/2;
160
- newCoordinates = repositionWithinScreen(targetLeft, targetTop, tooltipWidth, tooltipHeight);
161
- tooltipVerticalMovement = '+10px';
162
- backdrop.css({
163
- top: 0,
164
- left: 0,
165
- marginLeft: (tooltipWidth/2) - (backdropOffsetWidth/2)
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
- .velocity({opacity: 1}, {duration: 300, delay: 50, queue: false});
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
- // Mouse Out
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
- $('.tooltipped').tooltip();
237
- });
238
- }( jQuery ));
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(selectorOrEl) === 'string') {
5
+ if (typeof selectorOrEl === 'string') {
6
6
  element = $(selectorOrEl);
7
- } else if (typeof(selectorOrEl) === 'object') {
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
- "-webkit-filter": "grayscale("+grayscale_setting+")" + "brightness("+brightness_setting+"%)",
33
- "filter": "grayscale("+grayscale_setting+")" + "brightness("+brightness_setting+"%)"
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(selectorOrEl) === 'string') {
43
+ if (typeof selectorOrEl === 'string') {
44
44
  element = $(selectorOrEl);
45
- } else if (typeof(selectorOrEl) === 'object') {
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
- { translateX: "-100px"},
53
- { duration: 0 });
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
- }, {duration: 50, queue: false, easing: 'easeOutQuad'});
91
+ }, { duration: 50, queue: false, easing: 'easeOutQuad' });
98
92
 
99
93
  // Swipe Left
100
- if (direction === 4 && (x > ($this.innerWidth() / 2) || velocityX < -0.75)) {
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 < (-1 * $this.innerWidth() / 2) || velocityX > 0.75)) {
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) < ($(this).innerWidth() / 2)) {
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) { fullWidth = $this.innerWidth(); }
121
- else { fullWidth = -1 * $this.innerWidth(); }
122
-
123
- $this.velocity({ translateX: fullWidth,
124
- }, {duration: 100, queue: false, easing: 'easeOutQuad', complete:
125
- function() {
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
- }, {duration: 200, queue: false, easing: 'easeOutQuad', complete:
129
- function() { $this.remove(); }
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
- else {
135
- $this.velocity({ translateX: 0,
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
- }( jQuery ));
163
+ })(jQuery);