materialize-sass 1.0.0.alpha2 → 1.0.0.alpha3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +5 -5
  2. data/assets/javascripts/materialize-sprockets.js +1 -0
  3. data/assets/javascripts/materialize.js +1337 -1281
  4. data/assets/javascripts/materialize/autocomplete.js +27 -27
  5. data/assets/javascripts/materialize/buttons.js +58 -58
  6. data/assets/javascripts/materialize/carousel.js +47 -49
  7. data/assets/javascripts/materialize/cash.js +4 -4
  8. data/assets/javascripts/materialize/characterCounter.js +20 -20
  9. data/assets/javascripts/materialize/chips.js +42 -38
  10. data/assets/javascripts/materialize/collapsible.js +27 -27
  11. data/assets/javascripts/materialize/component.js +57 -0
  12. data/assets/javascripts/materialize/datepicker.js +59 -53
  13. data/assets/javascripts/materialize/dropdown.js +43 -43
  14. data/assets/javascripts/materialize/extras/nouislider.js +1 -1
  15. data/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
  16. data/assets/javascripts/materialize/forms.js +8 -2
  17. data/assets/javascripts/materialize/global.js +11 -13
  18. data/assets/javascripts/materialize/materialbox.js +72 -44
  19. data/assets/javascripts/materialize/modal.js +55 -38
  20. data/assets/javascripts/materialize/parallax.js +61 -24
  21. data/assets/javascripts/materialize/pushpin.js +37 -21
  22. data/assets/javascripts/materialize/range.js +19 -21
  23. data/assets/javascripts/materialize/scrollspy.js +23 -23
  24. data/assets/javascripts/materialize/select.js +42 -36
  25. data/assets/javascripts/materialize/sidenav.js +34 -34
  26. data/assets/javascripts/materialize/slider.js +37 -39
  27. data/assets/javascripts/materialize/tabs.js +42 -49
  28. data/assets/javascripts/materialize/tapTarget.js +39 -22
  29. data/assets/javascripts/materialize/timepicker.js +579 -579
  30. data/assets/javascripts/materialize/tooltip.js +34 -31
  31. data/assets/stylesheets/materialize/components/_cards.scss +0 -2
  32. data/assets/stylesheets/materialize/components/_global.scss +4 -14
  33. data/assets/stylesheets/materialize/components/_typography.scss +0 -1
  34. data/assets/stylesheets/materialize/components/_variables.scss +1 -1
  35. data/assets/stylesheets/materialize/components/forms/_checkboxes.scss +0 -10
  36. data/assets/stylesheets/materialize/extras/nouislider.css +1 -1
  37. data/lib/materialize-sass/version.rb +1 -1
  38. metadata +4 -3
@@ -1,7 +1,13 @@
1
1
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
2
 
3
+ var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
4
+
3
5
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
6
 
7
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
8
+
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
10
+
5
11
  (function ($) {
6
12
  'use strict';
7
13
 
@@ -21,7 +27,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
21
27
  *
22
28
  */
23
29
 
24
- var Autocomplete = function () {
30
+ var Autocomplete = function (_Component) {
31
+ _inherits(Autocomplete, _Component);
32
+
25
33
  /**
26
34
  * Construct Autocomplete instance
27
35
  * @constructor
@@ -31,14 +39,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
31
39
  function Autocomplete(el, options) {
32
40
  _classCallCheck(this, Autocomplete);
33
41
 
34
- // If exists, destroy and reinitialize
35
- if (!!el.M_Autocomplete) {
36
- el.M_Autocomplete.destroy();
37
- }
42
+ var _this = _possibleConstructorReturn(this, (Autocomplete.__proto__ || Object.getPrototypeOf(Autocomplete)).call(this, Autocomplete, el, options));
38
43
 
39
- this.el = el;
40
- this.$el = $(el);
41
- this.el.M_Autocomplete = this;
44
+ _this.el.M_Autocomplete = _this;
42
45
 
43
46
  /**
44
47
  * Options for the autocomplete
@@ -52,18 +55,19 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
52
55
  * @prop {Boolean} noWrap
53
56
  * @prop {Function} onCycleTo
54
57
  */
55
- this.options = $.extend({}, Autocomplete.defaults, options);
58
+ _this.options = $.extend({}, Autocomplete.defaults, options);
56
59
 
57
60
  // Setup
58
- this.isOpen = false;
59
- this.count = 0;
60
- this.activeIndex = -1;
61
- this.oldVal;
62
- this.$inputField = this.$el.closest('.input-field');
63
- this.$active = $();
64
- this._setupDropdown();
65
-
66
- this._setupEventHandlers();
61
+ _this.isOpen = false;
62
+ _this.count = 0;
63
+ _this.activeIndex = -1;
64
+ _this.oldVal;
65
+ _this.$inputField = _this.$el.closest('.input-field');
66
+ _this.$active = $();
67
+ _this._setupDropdown();
68
+
69
+ _this._setupEventHandlers();
70
+ return _this;
67
71
  }
68
72
 
69
73
  _createClass(Autocomplete, [{
@@ -314,7 +318,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
314
318
  }, {
315
319
  key: '_renderDropdown',
316
320
  value: function _renderDropdown(data, val) {
317
- var _this = this;
321
+ var _this2 = this;
318
322
 
319
323
  this._removeAutocomplete();
320
324
 
@@ -340,7 +344,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
340
344
 
341
345
  // Sort
342
346
  var sortFunctionBound = function (a, b) {
343
- return _this.options.sortFunction(a.key.toLowerCase(), b.key.toLowerCase(), val.toLowerCase());
347
+ return _this2.options.sortFunction(a.key.toLowerCase(), b.key.toLowerCase(), val.toLowerCase());
344
348
  };
345
349
  matchingData.sort(sortFunctionBound);
346
350
 
@@ -376,12 +380,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
376
380
  }
377
381
  }], [{
378
382
  key: 'init',
379
- value: function init($els, options) {
380
- var arr = [];
381
- $els.each(function () {
382
- arr.push(new Autocomplete(this, options));
383
- });
384
- return arr;
383
+ value: function init(els, options) {
384
+ return _get(Autocomplete.__proto__ || Object.getPrototypeOf(Autocomplete), 'init', this).call(this, this, els, options);
385
385
  }
386
386
 
387
387
  /**
@@ -402,7 +402,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
402
402
  }]);
403
403
 
404
404
  return Autocomplete;
405
- }();
405
+ }(Component);
406
406
 
407
407
  /**
408
408
  * @static
@@ -1,7 +1,13 @@
1
1
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
2
 
3
+ var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
4
+
3
5
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
6
 
7
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
8
+
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
10
+
5
11
  (function ($, anim) {
6
12
  'use strict';
7
13
 
@@ -18,7 +24,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
18
24
  *
19
25
  */
20
26
 
21
- var FloatingActionButton = function () {
27
+ var FloatingActionButton = function (_Component) {
28
+ _inherits(FloatingActionButton, _Component);
29
+
22
30
  /**
23
31
  * Construct FloatingActionButton instance
24
32
  * @constructor
@@ -28,14 +36,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
28
36
  function FloatingActionButton(el, options) {
29
37
  _classCallCheck(this, FloatingActionButton);
30
38
 
31
- // If exists, destroy and reinitialize
32
- if (!!el.M_FloatingActionButton) {
33
- el.M_FloatingActionButton.destroy();
34
- }
39
+ var _this = _possibleConstructorReturn(this, (FloatingActionButton.__proto__ || Object.getPrototypeOf(FloatingActionButton)).call(this, FloatingActionButton, el, options));
35
40
 
36
- this.el = el;
37
- this.$el = $(el);
38
- this.el.M_FloatingActionButton = this;
41
+ _this.el.M_FloatingActionButton = _this;
39
42
 
40
43
  /**
41
44
  * Options for the fab
@@ -44,29 +47,30 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
44
47
  * @prop {Boolean} [hoverEnabled=true] - Enable hover vs click
45
48
  * @prop {Boolean} [toolbarEnabled=false] - Enable toolbar transition
46
49
  */
47
- this.options = $.extend({}, FloatingActionButton.defaults, options);
48
-
49
- this.isOpen = false;
50
- this.$anchor = this.$el.children('a').first();
51
- this.$menu = this.$el.children('ul').first();
52
- this.$floatingBtns = this.$el.find('ul .btn-floating');
53
- this.$floatingBtnsReverse = this.$el.find('ul .btn-floating').reverse();
54
- this.offsetY = 0;
55
- this.offsetX = 0;
56
- if (this.options.direction === 'top') {
57
- this.$el.addClass('direction-top');
58
- this.offsetY = 40;
59
- } else if (this.options.direction === 'right') {
60
- this.$el.addClass('direction-right');
61
- this.offsetX = -40;
62
- } else if (this.options.direction === 'bottom') {
63
- this.$el.addClass('direction-bottom');
64
- this.offsetY = -40;
50
+ _this.options = $.extend({}, FloatingActionButton.defaults, options);
51
+
52
+ _this.isOpen = false;
53
+ _this.$anchor = _this.$el.children('a').first();
54
+ _this.$menu = _this.$el.children('ul').first();
55
+ _this.$floatingBtns = _this.$el.find('ul .btn-floating');
56
+ _this.$floatingBtnsReverse = _this.$el.find('ul .btn-floating').reverse();
57
+ _this.offsetY = 0;
58
+ _this.offsetX = 0;
59
+ if (_this.options.direction === 'top') {
60
+ _this.$el.addClass('direction-top');
61
+ _this.offsetY = 40;
62
+ } else if (_this.options.direction === 'right') {
63
+ _this.$el.addClass('direction-right');
64
+ _this.offsetX = -40;
65
+ } else if (_this.options.direction === 'bottom') {
66
+ _this.$el.addClass('direction-bottom');
67
+ _this.offsetY = -40;
65
68
  } else {
66
- this.$el.addClass('direction-left');
67
- this.offsetX = 40;
69
+ _this.$el.addClass('direction-left');
70
+ _this.offsetX = 40;
68
71
  }
69
- this._setupEventHandlers();
72
+ _this._setupEventHandlers();
73
+ return _this;
70
74
  }
71
75
 
72
76
  _createClass(FloatingActionButton, [{
@@ -189,7 +193,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
189
193
  }, {
190
194
  key: '_animateInFAB',
191
195
  value: function _animateInFAB() {
192
- var _this = this;
196
+ var _this2 = this;
193
197
 
194
198
  this.$el.addClass('active');
195
199
 
@@ -199,8 +203,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
199
203
  targets: el,
200
204
  opacity: 1,
201
205
  scale: [.4, 1],
202
- translateY: [_this.offsetY, 0],
203
- translateX: [_this.offsetX, 0],
206
+ translateY: [_this2.offsetY, 0],
207
+ translateX: [_this2.offsetX, 0],
204
208
  duration: 275,
205
209
  delay: time,
206
210
  easing: 'easeInOutQuad'
@@ -216,7 +220,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
216
220
  }, {
217
221
  key: '_animateOutFAB',
218
222
  value: function _animateOutFAB() {
219
- var _this2 = this;
223
+ var _this3 = this;
220
224
 
221
225
  this.$floatingBtnsReverse.each(function (el) {
222
226
  anim.remove(el);
@@ -224,12 +228,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
224
228
  targets: el,
225
229
  opacity: 0,
226
230
  scale: .4,
227
- translateY: _this2.offsetY,
228
- translateX: _this2.offsetX,
231
+ translateY: _this3.offsetY,
232
+ translateX: _this3.offsetX,
229
233
  duration: 175,
230
234
  easing: 'easeOutQuad',
231
235
  complete: function () {
232
- _this2.$el.removeClass('active');
236
+ _this3.$el.removeClass('active');
233
237
  }
234
238
  });
235
239
  });
@@ -242,7 +246,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
242
246
  }, {
243
247
  key: '_animateInToolbar',
244
248
  value: function _animateInToolbar() {
245
- var _this3 = this;
249
+ var _this4 = this;
246
250
 
247
251
  var scaleFactor = void 0;
248
252
  var windowWidth = window.innerWidth;
@@ -278,18 +282,18 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
278
282
  });
279
283
 
280
284
  setTimeout(function () {
281
- _this3.$el.css({
285
+ _this4.$el.css({
282
286
  transform: '',
283
287
  transition: 'transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s'
284
288
  });
285
- _this3.$anchor.css({
289
+ _this4.$anchor.css({
286
290
  overflow: 'visible',
287
291
  transform: '',
288
292
  transition: 'transform .2s'
289
293
  });
290
294
 
291
295
  setTimeout(function () {
292
- _this3.$el.css({
296
+ _this4.$el.css({
293
297
  overflow: 'hidden',
294
298
  'background-color': fabColor
295
299
  });
@@ -297,14 +301,14 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
297
301
  transform: 'scale(' + scaleFactor + ')',
298
302
  transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
299
303
  });
300
- _this3.$menu.children('li').children('a').css({
304
+ _this4.$menu.children('li').children('a').css({
301
305
  opacity: 1
302
306
  });
303
307
 
304
308
  // Scroll to close.
305
- _this3._handleDocumentClickBound = _this3._handleDocumentClick.bind(_this3);
306
- window.addEventListener('scroll', _this3._handleCloseBound, true);
307
- document.body.addEventListener('click', _this3._handleDocumentClickBound, true);
309
+ _this4._handleDocumentClickBound = _this4._handleDocumentClick.bind(_this4);
310
+ window.addEventListener('scroll', _this4._handleCloseBound, true);
311
+ document.body.addEventListener('click', _this4._handleDocumentClickBound, true);
308
312
  }, 100);
309
313
  }, 0);
310
314
  }
@@ -316,7 +320,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
316
320
  }, {
317
321
  key: '_animateOutToolbar',
318
322
  value: function _animateOutToolbar() {
319
- var _this4 = this;
323
+ var _this5 = this;
320
324
 
321
325
  var windowWidth = window.innerWidth;
322
326
  var windowHeight = window.innerHeight;
@@ -347,26 +351,26 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
347
351
  backdrop.remove();
348
352
 
349
353
  // Set initial state.
350
- _this4.$el.css({
354
+ _this5.$el.css({
351
355
  'text-align': '',
352
356
  width: '',
353
357
  bottom: '',
354
358
  left: '',
355
359
  overflow: '',
356
360
  'background-color': '',
357
- transform: 'translate3d(' + -_this4.offsetX + 'px,0,0)'
361
+ transform: 'translate3d(' + -_this5.offsetX + 'px,0,0)'
358
362
  });
359
- _this4.$anchor.css({
363
+ _this5.$anchor.css({
360
364
  overflow: '',
361
- transform: 'translate3d(0,' + _this4.offsetY + 'px,0)'
365
+ transform: 'translate3d(0,' + _this5.offsetY + 'px,0)'
362
366
  });
363
367
 
364
368
  setTimeout(function () {
365
- _this4.$el.css({
369
+ _this5.$el.css({
366
370
  transform: 'translate3d(0,0,0)',
367
371
  transition: 'transform .2s'
368
372
  });
369
- _this4.$anchor.css({
373
+ _this5.$anchor.css({
370
374
  transform: 'translate3d(0,0,0)',
371
375
  transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
372
376
  });
@@ -375,12 +379,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
375
379
  }
376
380
  }], [{
377
381
  key: 'init',
378
- value: function init($els, options) {
379
- var arr = [];
380
- $els.each(function () {
381
- arr.push(new FloatingActionButton(this, options));
382
- });
383
- return arr;
382
+ value: function init(els, options) {
383
+ return _get(FloatingActionButton.__proto__ || Object.getPrototypeOf(FloatingActionButton), 'init', this).call(this, this, els, options);
384
384
  }
385
385
 
386
386
  /**
@@ -401,7 +401,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
401
401
  }]);
402
402
 
403
403
  return FloatingActionButton;
404
- }();
404
+ }(Component);
405
405
 
406
406
  M.FloatingActionButton = FloatingActionButton;
407
407
 
@@ -1,7 +1,13 @@
1
1
  var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
2
2
 
3
+ var _get = function get(object, property, receiver) { if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { return get(parent, property, receiver); } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } };
4
+
3
5
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
6
 
7
+ function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
8
+
9
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
10
+
5
11
  (function ($) {
6
12
  'use strict';
7
13
 
@@ -21,7 +27,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
21
27
  *
22
28
  */
23
29
 
24
- var Carousel = function () {
30
+ var Carousel = function (_Component) {
31
+ _inherits(Carousel, _Component);
32
+
25
33
  /**
26
34
  * Construct Carousel instance
27
35
  * @constructor
@@ -29,18 +37,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
29
37
  * @param {Object} options
30
38
  */
31
39
  function Carousel(el, options) {
32
- var _this = this;
33
-
34
40
  _classCallCheck(this, Carousel);
35
41
 
36
- // If exists, destroy and reinitialize
37
- if (!!el.M_Carousel) {
38
- el.M_Carousel.destroy();
39
- }
42
+ var _this = _possibleConstructorReturn(this, (Carousel.__proto__ || Object.getPrototypeOf(Carousel)).call(this, Carousel, el, options));
40
43
 
41
- this.el = el;
42
- this.$el = $(el);
43
- this.el.M_Carousel = this;
44
+ _this.el.M_Carousel = _this;
44
45
 
45
46
  /**
46
47
  * Options for the carousel
@@ -54,36 +55,36 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
54
55
  * @prop {Boolean} noWrap
55
56
  * @prop {Function} onCycleTo
56
57
  */
57
- this.options = $.extend({}, Carousel.defaults, options);
58
+ _this.options = $.extend({}, Carousel.defaults, options);
58
59
 
59
60
  // Setup
60
- this.hasMultipleSlides = this.$el.find('.carousel-item').length > 1;
61
- this.showIndicators = this.options.indicators && this.hasMultipleSlides;
62
- this.noWrap = this.options.noWrap || !this.hasMultipleSlides;
63
- this.pressed = false;
64
- this.dragged = false;
65
- this.offset = this.target = 0;
66
- this.images = [];
67
- this.itemWidth = this.$el.find('.carousel-item').first().innerWidth();
68
- this.itemHeight = this.$el.find('.carousel-item').first().innerHeight();
69
- this.dim = this.itemWidth * 2 + this.options.padding || 1; // Make sure dim is non zero for divisions.
70
- this._autoScrollBound = this._autoScroll.bind(this);
71
- this._trackBound = this._track.bind(this);
61
+ _this.hasMultipleSlides = _this.$el.find('.carousel-item').length > 1;
62
+ _this.showIndicators = _this.options.indicators && _this.hasMultipleSlides;
63
+ _this.noWrap = _this.options.noWrap || !_this.hasMultipleSlides;
64
+ _this.pressed = false;
65
+ _this.dragged = false;
66
+ _this.offset = _this.target = 0;
67
+ _this.images = [];
68
+ _this.itemWidth = _this.$el.find('.carousel-item').first().innerWidth();
69
+ _this.itemHeight = _this.$el.find('.carousel-item').first().innerHeight();
70
+ _this.dim = _this.itemWidth * 2 + _this.options.padding || 1; // Make sure dim is non zero for divisions.
71
+ _this._autoScrollBound = _this._autoScroll.bind(_this);
72
+ _this._trackBound = _this._track.bind(_this);
72
73
 
73
74
  // Full Width carousel setup
74
- if (this.options.fullWidth) {
75
- this.options.dist = 0;
76
- this._setCarouselHeight();
75
+ if (_this.options.fullWidth) {
76
+ _this.options.dist = 0;
77
+ _this._setCarouselHeight();
77
78
 
78
79
  // Offset fixed items when indicators.
79
- if (this.showIndicators) {
80
- this.$el.find('.carousel-fixed-item').addClass('with-indicators');
80
+ if (_this.showIndicators) {
81
+ _this.$el.find('.carousel-fixed-item').addClass('with-indicators');
81
82
  }
82
83
  }
83
84
 
84
85
  // Iterate through slides
85
- this.$indicators = $('<ul class="indicators"></ul>');
86
- this.$el.find('.carousel-item').each(function (el, i) {
86
+ _this.$indicators = $('<ul class="indicators"></ul>');
87
+ _this.$el.find('.carousel-item').each(function (el, i) {
87
88
  _this.images.push(el);
88
89
  if (_this.showIndicators) {
89
90
  var $indicator = $('<li class="indicator-item"></li>');
@@ -96,13 +97,13 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
96
97
  _this.$indicators.append($indicator);
97
98
  }
98
99
  });
99
- if (this.showIndicators) {
100
- this.$el.append(this.$indicators);
100
+ if (_this.showIndicators) {
101
+ _this.$el.append(_this.$indicators);
101
102
  }
102
- this.count = this.images.length;
103
+ _this.count = _this.images.length;
103
104
 
104
105
  // Setup cross browser string
105
- this.xform = 'transform';
106
+ _this.xform = 'transform';
106
107
  ['webkit', 'Moz', 'O', 'ms'].every(function (prefix) {
107
108
  var e = prefix + 'Transform';
108
109
  if (typeof document.body.style[e] !== 'undefined') {
@@ -112,8 +113,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
112
113
  return true;
113
114
  });
114
115
 
115
- this._setupEventHandlers();
116
- this._scroll(this.offset);
116
+ _this._setupEventHandlers();
117
+ _this._scroll(_this.offset);
118
+ return _this;
117
119
  }
118
120
 
119
121
  _createClass(Carousel, [{
@@ -699,9 +701,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
699
701
  if (index > this.count || index < 0) {
700
702
  if (this.noWrap) {
701
703
  return;
702
- } else {
703
- index = this._wrap(index);
704
704
  }
705
+
706
+ index = this._wrap(index);
705
707
  }
706
708
  this._cycleTo(index);
707
709
  }
@@ -722,9 +724,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
722
724
  if (index > this.count || index < 0) {
723
725
  if (this.noWrap) {
724
726
  return;
725
- } else {
726
- index = this._wrap(index);
727
727
  }
728
+
729
+ index = this._wrap(index);
728
730
  }
729
731
 
730
732
  this._cycleTo(index);
@@ -746,21 +748,17 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
746
748
  if (n > this.count || n < 0) {
747
749
  if (this.noWrap) {
748
750
  return;
749
- } else {
750
- n = this._wrap(n);
751
751
  }
752
+
753
+ n = this._wrap(n);
752
754
  }
753
755
 
754
756
  this._cycleTo(n, callback);
755
757
  }
756
758
  }], [{
757
759
  key: 'init',
758
- value: function init($els, options) {
759
- var arr = [];
760
- $els.each(function () {
761
- arr.push(new Carousel(this, options));
762
- });
763
- return arr;
760
+ value: function init(els, options) {
761
+ return _get(Carousel.__proto__ || Object.getPrototypeOf(Carousel), 'init', this).call(this, this, els, options);
764
762
  }
765
763
 
766
764
  /**
@@ -781,7 +779,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
781
779
  }]);
782
780
 
783
781
  return Carousel;
784
- }();
782
+ }(Component);
785
783
 
786
784
  M.Carousel = Carousel;
787
785