materialize-sass 1.0.0.rc1 → 1.0.0.rc2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d2f028d178b727d59bf1b30ffe7f4aaa9cf28c083b4d5a65e4271f2cd39bba78
4
- data.tar.gz: 15a84af3a0bc12ca766d90141cc77e35c935a6caaf4b8f35b1076c3b0db7d2af
3
+ metadata.gz: df937f4701001a6343da5404f13305e3c5991515d733573e8c19110f47da1f19
4
+ data.tar.gz: 5400216bad459a90d99e76401e9bf2aae3d45538946883a40629d8369142ad6c
5
5
  SHA512:
6
- metadata.gz: 9bfad0988ccca8ca7701937f35fe38b391241662cd07b14cb6072762dd5f4b3ba37ee95d27228301dfe0f493017fc843a583c6313d3c4aaccabd81f93a1f8eee
7
- data.tar.gz: 29b7c9502085cb82b4a1fe7d52348be6a3080de98374c1480fbdffa90161c21b1ee9f0145a4e5a63c899b4918cc1b8f3785b3fe646ce9cc75e9a9fd0471d80e4
6
+ metadata.gz: 97cefac389c7d0c4de37e24962e2d2b12616e1835847c95558a764014e7f5eaa951896e5e636a7e1330dcff812c87f99aad5faaa4c4f68dc989f85ccda584f4b
7
+ data.tar.gz: '0515880d93dc6026470fb0eb75c40d1ad740e3c642c93b05a29308a3636c74a7d4e2f29c358d4a79ac25943c6935718caea0c613e5973071f6b139e3c951daaa'
data/README.md CHANGED
@@ -7,7 +7,7 @@ example: http://materialize.labs.my/
7
7
  source: https://github.com/mkhairi/materialize-rails
8
8
 
9
9
  # Notices
10
- This master branch now v1.0.0.rc1
10
+ This master branch now v1.0.0.rc2
11
11
 
12
12
  Documentation for previous releases (v0.100.*) are available [this branch.](https://github.com/mkhairi/materialize-sass/tree/v0.100)
13
13
 
@@ -16,7 +16,7 @@ Documentation for previous releases (v0.100.*) are available [this branch.](http
16
16
  In your Gemfile you need to add the `materialize-sass` gem:
17
17
 
18
18
  ```ruby
19
- gem 'materialize-sass', '~> 1.0.0.rc1'
19
+ gem 'materialize-sass', '~> 1.0.0.rc2'
20
20
  ```
21
21
 
22
22
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Materialize v1.0.0-rc.1 (http://materializecss.com)
2
+ * Materialize v1.0.0-rc.2 (http://materializecss.com)
3
3
  * Copyright 2014-2017 Materialize
4
4
  * MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
5
5
  */
@@ -1982,7 +1982,12 @@ $jscomp.polyfill = function (e, r, p, m) {
1982
1982
  }, {
1983
1983
  key: "_removeEventHandlers",
1984
1984
  value: function _removeEventHandlers() {
1985
+ var _this5 = this;
1986
+
1985
1987
  this.el.removeEventListener('click', this._handleCollapsibleClickBound);
1988
+ this.$headers.each(function (header) {
1989
+ header.removeEventListener('keydown', _this5._handleCollapsibleKeydownBound);
1990
+ });
1986
1991
  }
1987
1992
 
1988
1993
  /**
@@ -2032,7 +2037,7 @@ $jscomp.polyfill = function (e, r, p, m) {
2032
2037
  }, {
2033
2038
  key: "_animateIn",
2034
2039
  value: function _animateIn(index) {
2035
- var _this5 = this;
2040
+ var _this6 = this;
2036
2041
 
2037
2042
  var $collapsibleLi = this.$el.children('li').eq(index);
2038
2043
  if ($collapsibleLi.length) {
@@ -2071,8 +2076,8 @@ $jscomp.polyfill = function (e, r, p, m) {
2071
2076
  });
2072
2077
 
2073
2078
  // onOpenEnd callback
2074
- if (typeof _this5.options.onOpenEnd === 'function') {
2075
- _this5.options.onOpenEnd.call(_this5, $collapsibleLi[0]);
2079
+ if (typeof _this6.options.onOpenEnd === 'function') {
2080
+ _this6.options.onOpenEnd.call(_this6, $collapsibleLi[0]);
2076
2081
  }
2077
2082
  }
2078
2083
  });
@@ -2087,7 +2092,7 @@ $jscomp.polyfill = function (e, r, p, m) {
2087
2092
  }, {
2088
2093
  key: "_animateOut",
2089
2094
  value: function _animateOut(index) {
2090
- var _this6 = this;
2095
+ var _this7 = this;
2091
2096
 
2092
2097
  var $collapsibleLi = this.$el.children('li').eq(index);
2093
2098
  if ($collapsibleLi.length) {
@@ -2110,8 +2115,8 @@ $jscomp.polyfill = function (e, r, p, m) {
2110
2115
  });
2111
2116
 
2112
2117
  // onCloseEnd callback
2113
- if (typeof _this6.options.onCloseEnd === 'function') {
2114
- _this6.options.onCloseEnd.call(_this6, $collapsibleLi[0]);
2118
+ if (typeof _this7.options.onCloseEnd === 'function') {
2119
+ _this7.options.onCloseEnd.call(_this7, $collapsibleLi[0]);
2115
2120
  }
2116
2121
  }
2117
2122
  });
@@ -2126,7 +2131,7 @@ $jscomp.polyfill = function (e, r, p, m) {
2126
2131
  }, {
2127
2132
  key: "open",
2128
2133
  value: function open(index) {
2129
- var _this7 = this;
2134
+ var _this8 = this;
2130
2135
 
2131
2136
  var $collapsibleLi = this.$el.children('li').eq(index);
2132
2137
  if ($collapsibleLi.length && !$collapsibleLi[0].classList.contains('active')) {
@@ -2141,7 +2146,7 @@ $jscomp.polyfill = function (e, r, p, m) {
2141
2146
  var $activeLis = this.$el.children('li.active');
2142
2147
  $activeLis.each(function (el) {
2143
2148
  var index = $collapsibleLis.index($(el));
2144
- _this7.close(index);
2149
+ _this8.close(index);
2145
2150
  });
2146
2151
  }
2147
2152
 
@@ -2233,14 +2238,14 @@ $jscomp.polyfill = function (e, r, p, m) {
2233
2238
  function Dropdown(el, options) {
2234
2239
  _classCallCheck(this, Dropdown);
2235
2240
 
2236
- var _this8 = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, Dropdown, el, options));
2241
+ var _this9 = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, Dropdown, el, options));
2237
2242
 
2238
- _this8.el.M_Dropdown = _this8;
2239
- Dropdown._dropdowns.push(_this8);
2243
+ _this9.el.M_Dropdown = _this9;
2244
+ Dropdown._dropdowns.push(_this9);
2240
2245
 
2241
- _this8.id = M.getIdFromTrigger(el);
2242
- _this8.dropdownEl = document.getElementById(_this8.id);
2243
- _this8.$dropdownEl = $(_this8.dropdownEl);
2246
+ _this9.id = M.getIdFromTrigger(el);
2247
+ _this9.dropdownEl = document.getElementById(_this9.id);
2248
+ _this9.$dropdownEl = $(_this9.dropdownEl);
2244
2249
 
2245
2250
  /**
2246
2251
  * Options for the dropdown
@@ -2259,45 +2264,45 @@ $jscomp.polyfill = function (e, r, p, m) {
2259
2264
  * @prop {Function} onCloseStart - Function called when dropdown starts closing
2260
2265
  * @prop {Function} onCloseEnd - Function called when dropdown finishes closing
2261
2266
  */
2262
- _this8.options = $.extend({}, Dropdown.defaults, options);
2267
+ _this9.options = $.extend({}, Dropdown.defaults, options);
2263
2268
 
2264
2269
  /**
2265
2270
  * Describes open/close state of dropdown
2266
2271
  * @type {Boolean}
2267
2272
  */
2268
- _this8.isOpen = false;
2273
+ _this9.isOpen = false;
2269
2274
 
2270
2275
  /**
2271
2276
  * Describes if dropdown content is scrollable
2272
2277
  * @type {Boolean}
2273
2278
  */
2274
- _this8.isScrollable = false;
2279
+ _this9.isScrollable = false;
2275
2280
 
2276
2281
  /**
2277
2282
  * Describes if touch moving on dropdown content
2278
2283
  * @type {Boolean}
2279
2284
  */
2280
- _this8.isTouchMoving = false;
2285
+ _this9.isTouchMoving = false;
2281
2286
 
2282
- _this8.focusedIndex = -1;
2283
- _this8.filterQuery = [];
2287
+ _this9.focusedIndex = -1;
2288
+ _this9.filterQuery = [];
2284
2289
 
2285
2290
  // Move dropdown-content after dropdown-trigger
2286
- if (!!_this8.options.container) {
2287
- $(_this8.options.container).append(_this8.dropdownEl);
2291
+ if (!!_this9.options.container) {
2292
+ $(_this9.options.container).append(_this9.dropdownEl);
2288
2293
  } else {
2289
- _this8.$el.after(_this8.dropdownEl);
2290
- }
2291
-
2292
- _this8._makeDropdownFocusable();
2293
- _this8._resetFilterQueryBound = _this8._resetFilterQuery.bind(_this8);
2294
- _this8._handleDocumentClickBound = _this8._handleDocumentClick.bind(_this8);
2295
- _this8._handleDocumentTouchmoveBound = _this8._handleDocumentTouchmove.bind(_this8);
2296
- _this8._handleDropdownClickBound = _this8._handleDropdownClick.bind(_this8);
2297
- _this8._handleDropdownKeydownBound = _this8._handleDropdownKeydown.bind(_this8);
2298
- _this8._handleTriggerKeydownBound = _this8._handleTriggerKeydown.bind(_this8);
2299
- _this8._setupEventHandlers();
2300
- return _this8;
2294
+ _this9.$el.after(_this9.dropdownEl);
2295
+ }
2296
+
2297
+ _this9._makeDropdownFocusable();
2298
+ _this9._resetFilterQueryBound = _this9._resetFilterQuery.bind(_this9);
2299
+ _this9._handleDocumentClickBound = _this9._handleDocumentClick.bind(_this9);
2300
+ _this9._handleDocumentTouchmoveBound = _this9._handleDocumentTouchmove.bind(_this9);
2301
+ _this9._handleDropdownClickBound = _this9._handleDropdownClick.bind(_this9);
2302
+ _this9._handleDropdownKeydownBound = _this9._handleDropdownKeydown.bind(_this9);
2303
+ _this9._handleTriggerKeydownBound = _this9._handleTriggerKeydown.bind(_this9);
2304
+ _this9._setupEventHandlers();
2305
+ return _this9;
2301
2306
  }
2302
2307
 
2303
2308
  _createClass(Dropdown, [{
@@ -2409,17 +2414,17 @@ $jscomp.polyfill = function (e, r, p, m) {
2409
2414
  }, {
2410
2415
  key: "_handleDocumentClick",
2411
2416
  value: function _handleDocumentClick(e) {
2412
- var _this9 = this;
2417
+ var _this10 = this;
2413
2418
 
2414
2419
  var $target = $(e.target);
2415
2420
  if (this.options.closeOnClick && $target.closest('.dropdown-content').length && !this.isTouchMoving) {
2416
2421
  // isTouchMoving to check if scrolling on mobile.
2417
2422
  setTimeout(function () {
2418
- _this9.close();
2423
+ _this10.close();
2419
2424
  }, 0);
2420
2425
  } else if ($target.closest('.dropdown-trigger').length || !$target.closest('.dropdown-content').length) {
2421
2426
  setTimeout(function () {
2422
- _this9.close();
2427
+ _this10.close();
2423
2428
  }, 0);
2424
2429
  }
2425
2430
  this.isTouchMoving = false;
@@ -2593,7 +2598,8 @@ $jscomp.polyfill = function (e, r, p, m) {
2593
2598
  };
2594
2599
 
2595
2600
  // Countainer here will be closest ancestor with overflow: hidden
2596
- var closestOverflowParent = this.dropdownEl.offsetParent;
2601
+ var closestOverflowParent = !!this.dropdownEl.offsetParent ? this.dropdownEl.offsetParent : this.dropdownEl.parentNode;
2602
+
2597
2603
  var alignments = M.checkPossibleAlignments(this.el, closestOverflowParent, dropdownBounds, this.options.coverTrigger ? 0 : triggerBRect.height);
2598
2604
 
2599
2605
  var verticalAlignment = 'top';
@@ -2661,7 +2667,7 @@ $jscomp.polyfill = function (e, r, p, m) {
2661
2667
  }, {
2662
2668
  key: "_animateIn",
2663
2669
  value: function _animateIn() {
2664
- var _this10 = this;
2670
+ var _this11 = this;
2665
2671
 
2666
2672
  anim.remove(this.dropdownEl);
2667
2673
  anim({
@@ -2675,14 +2681,14 @@ $jscomp.polyfill = function (e, r, p, m) {
2675
2681
  duration: this.options.inDuration,
2676
2682
  easing: 'easeOutQuint',
2677
2683
  complete: function (anim) {
2678
- if (_this10.options.autoFocus) {
2679
- _this10.dropdownEl.focus();
2684
+ if (_this11.options.autoFocus) {
2685
+ _this11.dropdownEl.focus();
2680
2686
  }
2681
2687
 
2682
2688
  // onOpenEnd callback
2683
- if (typeof _this10.options.onOpenEnd === 'function') {
2689
+ if (typeof _this11.options.onOpenEnd === 'function') {
2684
2690
  var elem = anim.animatables[0].target;
2685
- _this10.options.onOpenEnd.call(elem, _this10.el);
2691
+ _this11.options.onOpenEnd.call(elem, _this11.el);
2686
2692
  }
2687
2693
  }
2688
2694
  });
@@ -2695,7 +2701,7 @@ $jscomp.polyfill = function (e, r, p, m) {
2695
2701
  }, {
2696
2702
  key: "_animateOut",
2697
2703
  value: function _animateOut() {
2698
- var _this11 = this;
2704
+ var _this12 = this;
2699
2705
 
2700
2706
  anim.remove(this.dropdownEl);
2701
2707
  anim({
@@ -2709,12 +2715,12 @@ $jscomp.polyfill = function (e, r, p, m) {
2709
2715
  duration: this.options.outDuration,
2710
2716
  easing: 'easeOutQuint',
2711
2717
  complete: function (anim) {
2712
- _this11._resetDropdownStyles();
2718
+ _this12._resetDropdownStyles();
2713
2719
 
2714
2720
  // onCloseEnd callback
2715
- if (typeof _this11.options.onCloseEnd === 'function') {
2721
+ if (typeof _this12.options.onCloseEnd === 'function') {
2716
2722
  var elem = anim.animatables[0].target;
2717
- _this11.options.onCloseEnd.call(_this11, _this11.el);
2723
+ _this12.options.onCloseEnd.call(_this12, _this12.el);
2718
2724
  }
2719
2725
  }
2720
2726
  });
@@ -2883,9 +2889,9 @@ $jscomp.polyfill = function (e, r, p, m) {
2883
2889
  function Modal(el, options) {
2884
2890
  _classCallCheck(this, Modal);
2885
2891
 
2886
- var _this12 = _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, Modal, el, options));
2892
+ var _this13 = _possibleConstructorReturn(this, (Modal.__proto__ || Object.getPrototypeOf(Modal)).call(this, Modal, el, options));
2887
2893
 
2888
- _this12.el.M_Modal = _this12;
2894
+ _this13.el.M_Modal = _this13;
2889
2895
 
2890
2896
  /**
2891
2897
  * Options for the modal
@@ -2901,23 +2907,23 @@ $jscomp.polyfill = function (e, r, p, m) {
2901
2907
  * @prop {String} [startingTop='4%'] - startingTop
2902
2908
  * @prop {String} [endingTop='10%'] - endingTop
2903
2909
  */
2904
- _this12.options = $.extend({}, Modal.defaults, options);
2910
+ _this13.options = $.extend({}, Modal.defaults, options);
2905
2911
 
2906
2912
  /**
2907
2913
  * Describes open/close state of modal
2908
2914
  * @type {Boolean}
2909
2915
  */
2910
- _this12.isOpen = false;
2916
+ _this13.isOpen = false;
2911
2917
 
2912
- _this12.id = _this12.$el.attr('id');
2913
- _this12._openingTrigger = undefined;
2914
- _this12.$overlay = $('<div class="modal-overlay"></div>');
2915
- _this12.el.tabIndex = 0;
2916
- _this12._nthModalOpened = 0;
2918
+ _this13.id = _this13.$el.attr('id');
2919
+ _this13._openingTrigger = undefined;
2920
+ _this13.$overlay = $('<div class="modal-overlay"></div>');
2921
+ _this13.el.tabIndex = 0;
2922
+ _this13._nthModalOpened = 0;
2917
2923
 
2918
2924
  Modal._count++;
2919
- _this12._setupEventHandlers();
2920
- return _this12;
2925
+ _this13._setupEventHandlers();
2926
+ return _this13;
2921
2927
  }
2922
2928
 
2923
2929
  _createClass(Modal, [{
@@ -3046,7 +3052,7 @@ $jscomp.polyfill = function (e, r, p, m) {
3046
3052
  }, {
3047
3053
  key: "_animateIn",
3048
3054
  value: function _animateIn() {
3049
- var _this13 = this;
3055
+ var _this14 = this;
3050
3056
 
3051
3057
  // Set initial styles
3052
3058
  $.extend(this.el.style, {
@@ -3073,8 +3079,8 @@ $jscomp.polyfill = function (e, r, p, m) {
3073
3079
  easing: 'easeOutCubic',
3074
3080
  // Handle modal onOpenEnd callback
3075
3081
  complete: function () {
3076
- if (typeof _this13.options.onOpenEnd === 'function') {
3077
- _this13.options.onOpenEnd.call(_this13, _this13.el, _this13._openingTrigger);
3082
+ if (typeof _this14.options.onOpenEnd === 'function') {
3083
+ _this14.options.onOpenEnd.call(_this14, _this14.el, _this14._openingTrigger);
3078
3084
  }
3079
3085
  }
3080
3086
  };
@@ -3106,7 +3112,7 @@ $jscomp.polyfill = function (e, r, p, m) {
3106
3112
  }, {
3107
3113
  key: "_animateOut",
3108
3114
  value: function _animateOut() {
3109
- var _this14 = this;
3115
+ var _this15 = this;
3110
3116
 
3111
3117
  // Animate overlay
3112
3118
  anim({
@@ -3123,12 +3129,12 @@ $jscomp.polyfill = function (e, r, p, m) {
3123
3129
  easing: 'easeOutCubic',
3124
3130
  // Handle modal ready callback
3125
3131
  complete: function () {
3126
- _this14.el.style.display = 'none';
3127
- _this14.$overlay.remove();
3132
+ _this15.el.style.display = 'none';
3133
+ _this15.$overlay.remove();
3128
3134
 
3129
3135
  // Call onCloseEnd callback
3130
- if (typeof _this14.options.onCloseEnd === 'function') {
3131
- _this14.options.onCloseEnd.call(_this14, _this14.el);
3136
+ if (typeof _this15.options.onCloseEnd === 'function') {
3137
+ _this15.options.onCloseEnd.call(_this15, _this15.el);
3132
3138
  }
3133
3139
  }
3134
3140
  };
@@ -3317,9 +3323,9 @@ $jscomp.polyfill = function (e, r, p, m) {
3317
3323
  function Materialbox(el, options) {
3318
3324
  _classCallCheck(this, Materialbox);
3319
3325
 
3320
- var _this15 = _possibleConstructorReturn(this, (Materialbox.__proto__ || Object.getPrototypeOf(Materialbox)).call(this, Materialbox, el, options));
3326
+ var _this16 = _possibleConstructorReturn(this, (Materialbox.__proto__ || Object.getPrototypeOf(Materialbox)).call(this, Materialbox, el, options));
3321
3327
 
3322
- _this15.el.M_Materialbox = _this15;
3328
+ _this16.el.M_Materialbox = _this16;
3323
3329
 
3324
3330
  /**
3325
3331
  * Options for the modal
@@ -3331,22 +3337,22 @@ $jscomp.polyfill = function (e, r, p, m) {
3331
3337
  * @prop {Function} onCloseStart - Callback function called before materialbox is closed
3332
3338
  * @prop {Function} onCloseEnd - Callback function called after materialbox is closed
3333
3339
  */
3334
- _this15.options = $.extend({}, Materialbox.defaults, options);
3340
+ _this16.options = $.extend({}, Materialbox.defaults, options);
3335
3341
 
3336
- _this15.overlayActive = false;
3337
- _this15.doneAnimating = true;
3338
- _this15.placeholder = $('<div></div>').addClass('material-placeholder');
3339
- _this15.originalWidth = 0;
3340
- _this15.originalHeight = 0;
3341
- _this15.originInlineStyles = _this15.$el.attr('style');
3342
- _this15.caption = _this15.el.getAttribute('data-caption') || '';
3342
+ _this16.overlayActive = false;
3343
+ _this16.doneAnimating = true;
3344
+ _this16.placeholder = $('<div></div>').addClass('material-placeholder');
3345
+ _this16.originalWidth = 0;
3346
+ _this16.originalHeight = 0;
3347
+ _this16.originInlineStyles = _this16.$el.attr('style');
3348
+ _this16.caption = _this16.el.getAttribute('data-caption') || '';
3343
3349
 
3344
3350
  // Wrap
3345
- _this15.$el.before(_this15.placeholder);
3346
- _this15.placeholder.append(_this15.$el);
3351
+ _this16.$el.before(_this16.placeholder);
3352
+ _this16.placeholder.append(_this16.$el);
3347
3353
 
3348
- _this15._setupEventHandlers();
3349
- return _this15;
3354
+ _this16._setupEventHandlers();
3355
+ return _this16;
3350
3356
  }
3351
3357
 
3352
3358
  _createClass(Materialbox, [{
@@ -3359,6 +3365,11 @@ $jscomp.polyfill = function (e, r, p, m) {
3359
3365
  value: function destroy() {
3360
3366
  this._removeEventHandlers();
3361
3367
  this.el.M_Materialbox = undefined;
3368
+
3369
+ // Unwrap image
3370
+ $(this.placeholder).after(this.el).remove();
3371
+
3372
+ this.$el.removeAttr('style');
3362
3373
  }
3363
3374
 
3364
3375
  /**
@@ -3466,7 +3477,7 @@ $jscomp.polyfill = function (e, r, p, m) {
3466
3477
  }, {
3467
3478
  key: "_animateImageIn",
3468
3479
  value: function _animateImageIn() {
3469
- var _this16 = this;
3480
+ var _this17 = this;
3470
3481
 
3471
3482
  var animOptions = {
3472
3483
  targets: this.el,
@@ -3477,11 +3488,11 @@ $jscomp.polyfill = function (e, r, p, m) {
3477
3488
  duration: this.options.inDuration,
3478
3489
  easing: 'easeOutQuad',
3479
3490
  complete: function () {
3480
- _this16.doneAnimating = true;
3491
+ _this17.doneAnimating = true;
3481
3492
 
3482
3493
  // onOpenEnd callback
3483
- if (typeof _this16.options.onOpenEnd === 'function') {
3484
- _this16.options.onOpenEnd.call(_this16, _this16.el);
3494
+ if (typeof _this17.options.onOpenEnd === 'function') {
3495
+ _this17.options.onOpenEnd.call(_this17, _this17.el);
3485
3496
  }
3486
3497
  }
3487
3498
  };
@@ -3506,7 +3517,7 @@ $jscomp.polyfill = function (e, r, p, m) {
3506
3517
  }, {
3507
3518
  key: "_animateImageOut",
3508
3519
  value: function _animateImageOut() {
3509
- var _this17 = this;
3520
+ var _this18 = this;
3510
3521
 
3511
3522
  var animOptions = {
3512
3523
  targets: this.el,
@@ -3517,7 +3528,7 @@ $jscomp.polyfill = function (e, r, p, m) {
3517
3528
  duration: this.options.outDuration,
3518
3529
  easing: 'easeOutQuad',
3519
3530
  complete: function () {
3520
- _this17.placeholder.css({
3531
+ _this18.placeholder.css({
3521
3532
  height: '',
3522
3533
  width: '',
3523
3534
  position: '',
@@ -3526,28 +3537,28 @@ $jscomp.polyfill = function (e, r, p, m) {
3526
3537
  });
3527
3538
 
3528
3539
  // Revert to width or height attribute
3529
- if (_this17.attrWidth) {
3530
- _this17.$el.attr('width', _this17.attrWidth);
3540
+ if (_this18.attrWidth) {
3541
+ _this18.$el.attr('width', _this18.attrWidth);
3531
3542
  }
3532
- if (_this17.attrHeight) {
3533
- _this17.$el.attr('height', _this17.attrHeight);
3543
+ if (_this18.attrHeight) {
3544
+ _this18.$el.attr('height', _this18.attrHeight);
3534
3545
  }
3535
3546
 
3536
- _this17.$el.removeAttr('style');
3537
- _this17.$el.attr('style', _this17.originInlineStyles);
3547
+ _this18.$el.removeAttr('style');
3548
+ _this18.originInlineStyles && _this18.$el.attr('style', _this18.originInlineStyles);
3538
3549
 
3539
3550
  // Remove class
3540
- _this17.$el.removeClass('active');
3541
- _this17.doneAnimating = true;
3551
+ _this18.$el.removeClass('active');
3552
+ _this18.doneAnimating = true;
3542
3553
 
3543
3554
  // Remove overflow overrides on ancestors
3544
- if (_this17.ancestorsChanged.length) {
3545
- _this17.ancestorsChanged.css('overflow', '');
3555
+ if (_this18.ancestorsChanged.length) {
3556
+ _this18.ancestorsChanged.css('overflow', '');
3546
3557
  }
3547
3558
 
3548
3559
  // onCloseEnd callback
3549
- if (typeof _this17.options.onCloseEnd === 'function') {
3550
- _this17.options.onCloseEnd.call(_this17, _this17.el);
3560
+ if (typeof _this18.options.onCloseEnd === 'function') {
3561
+ _this18.options.onCloseEnd.call(_this18, _this18.el);
3551
3562
  }
3552
3563
  }
3553
3564
  };
@@ -3574,7 +3585,7 @@ $jscomp.polyfill = function (e, r, p, m) {
3574
3585
  }, {
3575
3586
  key: "open",
3576
3587
  value: function open() {
3577
- var _this18 = this;
3588
+ var _this19 = this;
3578
3589
 
3579
3590
  this._updateVars();
3580
3591
  this.originalWidth = this.el.getBoundingClientRect().width;
@@ -3624,8 +3635,8 @@ $jscomp.polyfill = function (e, r, p, m) {
3624
3635
  this.$overlay = $('<div id="materialbox-overlay"></div>').css({
3625
3636
  opacity: 0
3626
3637
  }).one('click', function () {
3627
- if (_this18.doneAnimating) {
3628
- _this18.close();
3638
+ if (_this19.doneAnimating) {
3639
+ _this19.close();
3629
3640
  }
3630
3641
  });
3631
3642
 
@@ -3706,7 +3717,7 @@ $jscomp.polyfill = function (e, r, p, m) {
3706
3717
  }, {
3707
3718
  key: "close",
3708
3719
  value: function close() {
3709
- var _this19 = this;
3720
+ var _this20 = this;
3710
3721
 
3711
3722
  this._updateVars();
3712
3723
  this.doneAnimating = false;
@@ -3734,8 +3745,8 @@ $jscomp.polyfill = function (e, r, p, m) {
3734
3745
  duration: this.options.outDuration,
3735
3746
  easing: 'easeOutQuad',
3736
3747
  complete: function () {
3737
- _this19.overlayActive = false;
3738
- _this19.$overlay.remove();
3748
+ _this20.overlayActive = false;
3749
+ _this20.$overlay.remove();
3739
3750
  }
3740
3751
  });
3741
3752
 
@@ -3749,7 +3760,7 @@ $jscomp.polyfill = function (e, r, p, m) {
3749
3760
  duration: this.options.outDuration,
3750
3761
  easing: 'easeOutQuad',
3751
3762
  complete: function () {
3752
- _this19.$photoCaption.remove();
3763
+ _this20.$photoCaption.remove();
3753
3764
  }
3754
3765
  });
3755
3766
  }
@@ -3799,30 +3810,30 @@ $jscomp.polyfill = function (e, r, p, m) {
3799
3810
  function Parallax(el, options) {
3800
3811
  _classCallCheck(this, Parallax);
3801
3812
 
3802
- var _this20 = _possibleConstructorReturn(this, (Parallax.__proto__ || Object.getPrototypeOf(Parallax)).call(this, Parallax, el, options));
3813
+ var _this21 = _possibleConstructorReturn(this, (Parallax.__proto__ || Object.getPrototypeOf(Parallax)).call(this, Parallax, el, options));
3803
3814
 
3804
- _this20.el.M_Parallax = _this20;
3815
+ _this21.el.M_Parallax = _this21;
3805
3816
 
3806
3817
  /**
3807
3818
  * Options for the Parallax
3808
3819
  * @member Parallax#options
3809
3820
  * @prop {Number} responsiveThreshold
3810
3821
  */
3811
- _this20.options = $.extend({}, Parallax.defaults, options);
3812
- _this20._enabled = window.innerWidth > _this20.options.responsiveThreshold;
3822
+ _this21.options = $.extend({}, Parallax.defaults, options);
3823
+ _this21._enabled = window.innerWidth > _this21.options.responsiveThreshold;
3813
3824
 
3814
- _this20.$img = _this20.$el.find('img').first();
3815
- _this20.$img.each(function () {
3825
+ _this21.$img = _this21.$el.find('img').first();
3826
+ _this21.$img.each(function () {
3816
3827
  var el = this;
3817
3828
  if (el.complete) $(el).trigger('load');
3818
3829
  });
3819
3830
 
3820
- _this20._updateParallax();
3821
- _this20._setupEventHandlers();
3822
- _this20._setupStyles();
3831
+ _this21._updateParallax();
3832
+ _this21._setupEventHandlers();
3833
+ _this21._setupStyles();
3823
3834
 
3824
- Parallax._parallaxes.push(_this20);
3825
- return _this20;
3835
+ Parallax._parallaxes.push(_this21);
3836
+ return _this21;
3826
3837
  }
3827
3838
 
3828
3839
  _createClass(Parallax, [{
@@ -3976,9 +3987,9 @@ $jscomp.polyfill = function (e, r, p, m) {
3976
3987
  function Tabs(el, options) {
3977
3988
  _classCallCheck(this, Tabs);
3978
3989
 
3979
- var _this21 = _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, Tabs, el, options));
3990
+ var _this22 = _possibleConstructorReturn(this, (Tabs.__proto__ || Object.getPrototypeOf(Tabs)).call(this, Tabs, el, options));
3980
3991
 
3981
- _this21.el.M_Tabs = _this21;
3992
+ _this22.el.M_Tabs = _this22;
3982
3993
 
3983
3994
  /**
3984
3995
  * Options for the Tabs
@@ -3988,23 +3999,26 @@ $jscomp.polyfill = function (e, r, p, m) {
3988
3999
  * @prop {Boolean} swipeable
3989
4000
  * @prop {Number} responsiveThreshold
3990
4001
  */
3991
- _this21.options = $.extend({}, Tabs.defaults, options);
4002
+ _this22.options = $.extend({}, Tabs.defaults, options);
3992
4003
 
3993
4004
  // Setup
3994
- _this21.$tabLinks = _this21.$el.children('li.tab').children('a');
3995
- _this21.index = 0;
3996
- _this21._setTabsAndTabWidth();
3997
- _this21._setupActiveTabLink();
3998
- _this21._createIndicator();
3999
-
4000
- if (_this21.options.swipeable) {
4001
- _this21._setupSwipeableTabs();
4005
+ _this22.$tabLinks = _this22.$el.children('li.tab').children('a');
4006
+ _this22.index = 0;
4007
+ _this22._setupActiveTabLink();
4008
+
4009
+ // Setup tabs content
4010
+ if (_this22.options.swipeable) {
4011
+ _this22._setupSwipeableTabs();
4002
4012
  } else {
4003
- _this21._setupNormalTabs();
4013
+ _this22._setupNormalTabs();
4004
4014
  }
4005
4015
 
4006
- _this21._setupEventHandlers();
4007
- return _this21;
4016
+ // Setup tabs indicator after content to ensure accurate widths
4017
+ _this22._setTabsAndTabWidth();
4018
+ _this22._createIndicator();
4019
+
4020
+ _this22._setupEventHandlers();
4021
+ return _this22;
4008
4022
  }
4009
4023
 
4010
4024
  _createClass(Tabs, [{
@@ -4075,7 +4089,7 @@ $jscomp.polyfill = function (e, r, p, m) {
4075
4089
  }, {
4076
4090
  key: "_handleTabClick",
4077
4091
  value: function _handleTabClick(e) {
4078
- var _this22 = this;
4092
+ var _this23 = this;
4079
4093
 
4080
4094
  var tab = $(e.target).closest('li.tab');
4081
4095
  var tabLink = $(e.target).closest('a');
@@ -4095,8 +4109,6 @@ $jscomp.polyfill = function (e, r, p, m) {
4095
4109
  return;
4096
4110
  }
4097
4111
 
4098
- this._setTabsAndTabWidth();
4099
-
4100
4112
  // Make the old tab inactive.
4101
4113
  this.$activeTabLink.removeClass('active');
4102
4114
  var $oldContent = this.$content;
@@ -4115,8 +4127,8 @@ $jscomp.polyfill = function (e, r, p, m) {
4115
4127
  if (this.options.swipeable) {
4116
4128
  if (this._tabsCarousel) {
4117
4129
  this._tabsCarousel.set(this.index, function () {
4118
- if (typeof _this22.options.onShow === 'function') {
4119
- _this22.options.onShow.call(_this22, _this22.$content[0]);
4130
+ if (typeof _this23.options.onShow === 'function') {
4131
+ _this23.options.onShow.call(_this23, _this23.$content[0]);
4120
4132
  }
4121
4133
  });
4122
4134
  }
@@ -4135,6 +4147,9 @@ $jscomp.polyfill = function (e, r, p, m) {
4135
4147
  }
4136
4148
  }
4137
4149
 
4150
+ // Update widths after content is swapped (scrollbar bugfix)
4151
+ this._setTabsAndTabWidth();
4152
+
4138
4153
  // Update indicator
4139
4154
  this._animateIndicator(prevIndex);
4140
4155
 
@@ -4149,7 +4164,7 @@ $jscomp.polyfill = function (e, r, p, m) {
4149
4164
  }, {
4150
4165
  key: "_createIndicator",
4151
4166
  value: function _createIndicator() {
4152
- var _this23 = this;
4167
+ var _this24 = this;
4153
4168
 
4154
4169
  var indicator = document.createElement('li');
4155
4170
  indicator.classList.add('indicator');
@@ -4158,8 +4173,8 @@ $jscomp.polyfill = function (e, r, p, m) {
4158
4173
  this._indicator = indicator;
4159
4174
 
4160
4175
  setTimeout(function () {
4161
- _this23._indicator.style.left = _this23._calcLeftPos(_this23.$activeTabLink) + 'px';
4162
- _this23._indicator.style.right = _this23._calcRightPos(_this23.$activeTabLink) + 'px';
4176
+ _this24._indicator.style.left = _this24._calcLeftPos(_this24.$activeTabLink) + 'px';
4177
+ _this24._indicator.style.right = _this24._calcRightPos(_this24.$activeTabLink) + 'px';
4163
4178
  }, 0);
4164
4179
  }
4165
4180
 
@@ -4199,7 +4214,7 @@ $jscomp.polyfill = function (e, r, p, m) {
4199
4214
  }, {
4200
4215
  key: "_setupSwipeableTabs",
4201
4216
  value: function _setupSwipeableTabs() {
4202
- var _this24 = this;
4217
+ var _this25 = this;
4203
4218
 
4204
4219
  // Change swipeable according to responsive threshold
4205
4220
  if (window.innerWidth > this.options.responsiveThreshold) {
@@ -4225,14 +4240,14 @@ $jscomp.polyfill = function (e, r, p, m) {
4225
4240
  fullWidth: true,
4226
4241
  noWrap: true,
4227
4242
  onCycleTo: function (item) {
4228
- var prevIndex = _this24.index;
4229
- _this24.index = $(item).index();
4230
- _this24.$activeTabLink.removeClass('active');
4231
- _this24.$activeTabLink = _this24.$tabLinks.eq(_this24.index);
4232
- _this24.$activeTabLink.addClass('active');
4233
- _this24._animateIndicator(prevIndex);
4234
- if (typeof _this24.options.onShow === 'function') {
4235
- _this24.options.onShow.call(_this24, _this24.$content[0]);
4243
+ var prevIndex = _this25.index;
4244
+ _this25.index = $(item).index();
4245
+ _this25.$activeTabLink.removeClass('active');
4246
+ _this25.$activeTabLink = _this25.$tabLinks.eq(_this25.index);
4247
+ _this25.$activeTabLink.addClass('active');
4248
+ _this25._animateIndicator(prevIndex);
4249
+ if (typeof _this25.options.onShow === 'function') {
4250
+ _this25.options.onShow.call(_this25, _this25.$content[0]);
4236
4251
  }
4237
4252
  }
4238
4253
  });
@@ -4327,6 +4342,7 @@ $jscomp.polyfill = function (e, r, p, m) {
4327
4342
  }, {
4328
4343
  key: "updateTabIndicator",
4329
4344
  value: function updateTabIndicator() {
4345
+ this._setTabsAndTabWidth();
4330
4346
  this._animateIndicator(this.index);
4331
4347
  }
4332
4348
 
@@ -4441,17 +4457,17 @@ $jscomp.polyfill = function (e, r, p, m) {
4441
4457
  function Tooltip(el, options) {
4442
4458
  _classCallCheck(this, Tooltip);
4443
4459
 
4444
- var _this25 = _possibleConstructorReturn(this, (Tooltip.__proto__ || Object.getPrototypeOf(Tooltip)).call(this, Tooltip, el, options));
4460
+ var _this26 = _possibleConstructorReturn(this, (Tooltip.__proto__ || Object.getPrototypeOf(Tooltip)).call(this, Tooltip, el, options));
4445
4461
 
4446
- _this25.el.M_Tooltip = _this25;
4447
- _this25.options = $.extend({}, Tooltip.defaults, options);
4462
+ _this26.el.M_Tooltip = _this26;
4463
+ _this26.options = $.extend({}, Tooltip.defaults, options);
4448
4464
 
4449
- _this25.isOpen = false;
4450
- _this25.isHovered = false;
4451
- _this25.isFocused = false;
4452
- _this25._appendTooltipEl();
4453
- _this25._setupEventHandlers();
4454
- return _this25;
4465
+ _this26.isOpen = false;
4466
+ _this26.isHovered = false;
4467
+ _this26.isFocused = false;
4468
+ _this26._appendTooltipEl();
4469
+ _this26._setupEventHandlers();
4470
+ return _this26;
4455
4471
  }
4456
4472
 
4457
4473
  _createClass(Tooltip, [{
@@ -4506,15 +4522,16 @@ $jscomp.polyfill = function (e, r, p, m) {
4506
4522
  }
4507
4523
  }, {
4508
4524
  key: "open",
4509
- value: function open() {
4525
+ value: function open(isManual) {
4510
4526
  if (this.isOpen) {
4511
4527
  return;
4512
4528
  }
4529
+ isManual = isManual === undefined ? true : undefined; // Default value true
4513
4530
  this.isOpen = true;
4514
4531
  // Update tooltip content with HTML attribute options
4515
4532
  this.options = $.extend({}, this.options, this._getAttributeOptions());
4516
4533
  this._updateTooltipContent();
4517
- this._setEnterDelayTimeout();
4534
+ this._setEnterDelayTimeout(isManual);
4518
4535
  }
4519
4536
  }, {
4520
4537
  key: "close",
@@ -4536,16 +4553,16 @@ $jscomp.polyfill = function (e, r, p, m) {
4536
4553
  }, {
4537
4554
  key: "_setExitDelayTimeout",
4538
4555
  value: function _setExitDelayTimeout() {
4539
- var _this26 = this;
4556
+ var _this27 = this;
4540
4557
 
4541
4558
  clearTimeout(this._exitDelayTimeout);
4542
4559
 
4543
4560
  this._exitDelayTimeout = setTimeout(function () {
4544
- if (_this26.isHovered || _this26.isFocused) {
4561
+ if (_this27.isHovered || _this27.isFocused) {
4545
4562
  return;
4546
4563
  }
4547
4564
 
4548
- _this26._animateOut();
4565
+ _this27._animateOut();
4549
4566
  }, this.options.exitDelay);
4550
4567
  }
4551
4568
 
@@ -4555,17 +4572,17 @@ $jscomp.polyfill = function (e, r, p, m) {
4555
4572
 
4556
4573
  }, {
4557
4574
  key: "_setEnterDelayTimeout",
4558
- value: function _setEnterDelayTimeout() {
4559
- var _this27 = this;
4575
+ value: function _setEnterDelayTimeout(isManual) {
4576
+ var _this28 = this;
4560
4577
 
4561
4578
  clearTimeout(this._enterDelayTimeout);
4562
4579
 
4563
4580
  this._enterDelayTimeout = setTimeout(function () {
4564
- if (!_this27.isHovered && !_this27.isFocused) {
4581
+ if (!_this28.isHovered && !_this28.isFocused && !isManual) {
4565
4582
  return;
4566
4583
  }
4567
4584
 
4568
- _this27._animateIn();
4585
+ _this28._animateIn();
4569
4586
  }, this.options.enterDelay);
4570
4587
  }
4571
4588
  }, {
@@ -4679,7 +4696,7 @@ $jscomp.polyfill = function (e, r, p, m) {
4679
4696
  value: function _handleMouseEnter() {
4680
4697
  this.isHovered = true;
4681
4698
  this.isFocused = false; // Allows close of tooltip when opened by focus.
4682
- this.open();
4699
+ this.open(false);
4683
4700
  }
4684
4701
  }, {
4685
4702
  key: "_handleMouseLeave",
@@ -4693,7 +4710,7 @@ $jscomp.polyfill = function (e, r, p, m) {
4693
4710
  value: function _handleFocus() {
4694
4711
  if (M.tabPressed) {
4695
4712
  this.isFocused = true;
4696
- this.open();
4713
+ this.open(false);
4697
4714
  }
4698
4715
  }
4699
4716
  }, {
@@ -5191,18 +5208,18 @@ $jscomp.polyfill = function (e, r, p, m) {
5191
5208
  }, {
5192
5209
  key: "_setTimer",
5193
5210
  value: function _setTimer() {
5194
- var _this28 = this;
5211
+ var _this29 = this;
5195
5212
 
5196
5213
  if (this.timeRemaining !== Infinity) {
5197
5214
  this.counterInterval = setInterval(function () {
5198
5215
  // If toast is not being dragged, decrease its time remaining
5199
- if (!_this28.panning) {
5200
- _this28.timeRemaining -= 20;
5216
+ if (!_this29.panning) {
5217
+ _this29.timeRemaining -= 20;
5201
5218
  }
5202
5219
 
5203
5220
  // Animate toast out
5204
- if (_this28.timeRemaining <= 0) {
5205
- _this28.dismiss();
5221
+ if (_this29.timeRemaining <= 0) {
5222
+ _this29.dismiss();
5206
5223
  }
5207
5224
  }, 20);
5208
5225
  }
@@ -5215,7 +5232,7 @@ $jscomp.polyfill = function (e, r, p, m) {
5215
5232
  }, {
5216
5233
  key: "dismiss",
5217
5234
  value: function dismiss() {
5218
- var _this29 = this;
5235
+ var _this30 = this;
5219
5236
 
5220
5237
  window.clearInterval(this.counterInterval);
5221
5238
  var activationDistance = this.el.offsetWidth * this.options.activationPercent;
@@ -5234,12 +5251,12 @@ $jscomp.polyfill = function (e, r, p, m) {
5234
5251
  easing: 'easeOutExpo',
5235
5252
  complete: function () {
5236
5253
  // Call the optional callback
5237
- if (typeof _this29.options.completeCallback === 'function') {
5238
- _this29.options.completeCallback();
5254
+ if (typeof _this30.options.completeCallback === 'function') {
5255
+ _this30.options.completeCallback();
5239
5256
  }
5240
5257
  // Remove toast from DOM
5241
- _this29.$el.remove();
5242
- Toast._toasts.splice(Toast._toasts.indexOf(_this29), 1);
5258
+ _this30.$el.remove();
5259
+ Toast._toasts.splice(Toast._toasts.indexOf(_this30), 1);
5243
5260
  if (Toast._toasts.length === 0) {
5244
5261
  Toast._removeContainer();
5245
5262
  }
@@ -5465,10 +5482,10 @@ $jscomp.polyfill = function (e, r, p, m) {
5465
5482
  function Sidenav(el, options) {
5466
5483
  _classCallCheck(this, Sidenav);
5467
5484
 
5468
- var _this30 = _possibleConstructorReturn(this, (Sidenav.__proto__ || Object.getPrototypeOf(Sidenav)).call(this, Sidenav, el, options));
5485
+ var _this31 = _possibleConstructorReturn(this, (Sidenav.__proto__ || Object.getPrototypeOf(Sidenav)).call(this, Sidenav, el, options));
5469
5486
 
5470
- _this30.el.M_Sidenav = _this30;
5471
- _this30.id = _this30.$el.attr('id');
5487
+ _this31.el.M_Sidenav = _this31;
5488
+ _this31.id = _this31.$el.attr('id');
5472
5489
 
5473
5490
  /**
5474
5491
  * Options for the Sidenav
@@ -5482,38 +5499,38 @@ $jscomp.polyfill = function (e, r, p, m) {
5482
5499
  * @prop {Function} onCloseStart - Function called when sidenav starts exiting
5483
5500
  * @prop {Function} onCloseEnd - Function called when sidenav finishes exiting
5484
5501
  */
5485
- _this30.options = $.extend({}, Sidenav.defaults, options);
5502
+ _this31.options = $.extend({}, Sidenav.defaults, options);
5486
5503
 
5487
5504
  /**
5488
5505
  * Describes open/close state of Sidenav
5489
5506
  * @type {Boolean}
5490
5507
  */
5491
- _this30.isOpen = false;
5508
+ _this31.isOpen = false;
5492
5509
 
5493
5510
  /**
5494
5511
  * Describes if Sidenav is fixed
5495
5512
  * @type {Boolean}
5496
5513
  */
5497
- _this30.isFixed = _this30.el.classList.contains('sidenav-fixed');
5514
+ _this31.isFixed = _this31.el.classList.contains('sidenav-fixed');
5498
5515
 
5499
5516
  /**
5500
5517
  * Describes if Sidenav is being draggeed
5501
5518
  * @type {Boolean}
5502
5519
  */
5503
- _this30.isDragged = false;
5520
+ _this31.isDragged = false;
5504
5521
 
5505
5522
  // Window size variables for window resize checks
5506
- _this30.lastWindowWidth = window.innerWidth;
5507
- _this30.lastWindowHeight = window.innerHeight;
5523
+ _this31.lastWindowWidth = window.innerWidth;
5524
+ _this31.lastWindowHeight = window.innerHeight;
5508
5525
 
5509
- _this30._createOverlay();
5510
- _this30._createDragTarget();
5511
- _this30._setupEventHandlers();
5512
- _this30._setupClasses();
5513
- _this30._setupFixed();
5526
+ _this31._createOverlay();
5527
+ _this31._createDragTarget();
5528
+ _this31._setupEventHandlers();
5529
+ _this31._setupClasses();
5530
+ _this31._setupFixed();
5514
5531
 
5515
- Sidenav._sidenavs.push(_this30);
5516
- return _this30;
5532
+ Sidenav._sidenavs.push(_this31);
5533
+ return _this31;
5517
5534
  }
5518
5535
 
5519
5536
  _createClass(Sidenav, [{
@@ -5525,6 +5542,7 @@ $jscomp.polyfill = function (e, r, p, m) {
5525
5542
  */
5526
5543
  value: function destroy() {
5527
5544
  this._removeEventHandlers();
5545
+ this._enableBodyScrolling();
5528
5546
  this._overlay.parentNode.removeChild(this._overlay);
5529
5547
  this.dragTarget.parentNode.removeChild(this.dragTarget);
5530
5548
  this.el.M_Sidenav = undefined;
@@ -5949,7 +5967,7 @@ $jscomp.polyfill = function (e, r, p, m) {
5949
5967
  }, {
5950
5968
  key: "_animateSidenavIn",
5951
5969
  value: function _animateSidenavIn() {
5952
- var _this31 = this;
5970
+ var _this32 = this;
5953
5971
 
5954
5972
  var slideOutPercent = this.options.edge === 'left' ? -1 : 1;
5955
5973
  if (this.isDragged) {
@@ -5964,8 +5982,8 @@ $jscomp.polyfill = function (e, r, p, m) {
5964
5982
  easing: 'easeOutQuad',
5965
5983
  complete: function () {
5966
5984
  // Run onOpenEnd callback
5967
- if (typeof _this31.options.onOpenEnd === 'function') {
5968
- _this31.options.onOpenEnd.call(_this31, _this31.el);
5985
+ if (typeof _this32.options.onOpenEnd === 'function') {
5986
+ _this32.options.onOpenEnd.call(_this32, _this32.el);
5969
5987
  }
5970
5988
  }
5971
5989
  });
@@ -5999,7 +6017,7 @@ $jscomp.polyfill = function (e, r, p, m) {
5999
6017
  }, {
6000
6018
  key: "_animateSidenavOut",
6001
6019
  value: function _animateSidenavOut() {
6002
- var _this32 = this;
6020
+ var _this33 = this;
6003
6021
 
6004
6022
  var endPercent = this.options.edge === 'left' ? -1 : 1;
6005
6023
  var slideOutPercent = 0;
@@ -6015,8 +6033,8 @@ $jscomp.polyfill = function (e, r, p, m) {
6015
6033
  easing: 'easeOutQuad',
6016
6034
  complete: function () {
6017
6035
  // Run onOpenEnd callback
6018
- if (typeof _this32.options.onCloseEnd === 'function') {
6019
- _this32.options.onCloseEnd.call(_this32, _this32.el);
6036
+ if (typeof _this33.options.onCloseEnd === 'function') {
6037
+ _this33.options.onCloseEnd.call(_this33, _this33.el);
6020
6038
  }
6021
6039
  }
6022
6040
  });
@@ -6024,7 +6042,7 @@ $jscomp.polyfill = function (e, r, p, m) {
6024
6042
  }, {
6025
6043
  key: "_animateOverlayOut",
6026
6044
  value: function _animateOverlayOut() {
6027
- var _this33 = this;
6045
+ var _this34 = this;
6028
6046
 
6029
6047
  anim.remove(this._overlay);
6030
6048
  anim({
@@ -6033,7 +6051,7 @@ $jscomp.polyfill = function (e, r, p, m) {
6033
6051
  duration: this.options.outDuration,
6034
6052
  easing: 'easeOutQuad',
6035
6053
  complete: function () {
6036
- $(_this33._overlay).css('display', 'none');
6054
+ $(_this34._overlay).css('display', 'none');
6037
6055
  }
6038
6056
  });
6039
6057
  }
@@ -6107,9 +6125,9 @@ $jscomp.polyfill = function (e, r, p, m) {
6107
6125
  function ScrollSpy(el, options) {
6108
6126
  _classCallCheck(this, ScrollSpy);
6109
6127
 
6110
- var _this34 = _possibleConstructorReturn(this, (ScrollSpy.__proto__ || Object.getPrototypeOf(ScrollSpy)).call(this, ScrollSpy, el, options));
6128
+ var _this35 = _possibleConstructorReturn(this, (ScrollSpy.__proto__ || Object.getPrototypeOf(ScrollSpy)).call(this, ScrollSpy, el, options));
6111
6129
 
6112
- _this34.el.M_ScrollSpy = _this34;
6130
+ _this35.el.M_ScrollSpy = _this35;
6113
6131
 
6114
6132
  /**
6115
6133
  * Options for the modal
@@ -6119,17 +6137,17 @@ $jscomp.polyfill = function (e, r, p, m) {
6119
6137
  * @prop {String} [activeClass='active'] - Class applied to active elements
6120
6138
  * @prop {Function} [getActiveElement] - Used to find active element
6121
6139
  */
6122
- _this34.options = $.extend({}, ScrollSpy.defaults, options);
6140
+ _this35.options = $.extend({}, ScrollSpy.defaults, options);
6123
6141
 
6124
6142
  // setup
6125
- ScrollSpy._elements.push(_this34);
6143
+ ScrollSpy._elements.push(_this35);
6126
6144
  ScrollSpy._count++;
6127
6145
  ScrollSpy._increment++;
6128
- _this34.tickId = -1;
6129
- _this34.id = ScrollSpy._increment;
6130
- _this34._setupEventHandlers();
6131
- _this34._handleWindowScroll();
6132
- return _this34;
6146
+ _this35.tickId = -1;
6147
+ _this35.id = ScrollSpy._increment;
6148
+ _this35._setupEventHandlers();
6149
+ _this35._handleWindowScroll();
6150
+ return _this35;
6133
6151
  }
6134
6152
 
6135
6153
  _createClass(ScrollSpy, [{
@@ -6282,7 +6300,7 @@ $jscomp.polyfill = function (e, r, p, m) {
6282
6300
  }, {
6283
6301
  key: "_exit",
6284
6302
  value: function _exit() {
6285
- var _this35 = this;
6303
+ var _this36 = this;
6286
6304
 
6287
6305
  ScrollSpy._visibleElements = ScrollSpy._visibleElements.filter(function (value) {
6288
6306
  return value.height() != 0;
@@ -6292,7 +6310,7 @@ $jscomp.polyfill = function (e, r, p, m) {
6292
6310
  $(this.options.getActiveElement(ScrollSpy._visibleElements[0].attr('id'))).removeClass(this.options.activeClass);
6293
6311
 
6294
6312
  ScrollSpy._visibleElements = ScrollSpy._visibleElements.filter(function (el) {
6295
- return el.attr('id') != _this35.$el.attr('id');
6313
+ return el.attr('id') != _this36.$el.attr('id');
6296
6314
  });
6297
6315
  if (ScrollSpy._visibleElements[0]) {
6298
6316
  // Check if empty
@@ -6427,9 +6445,9 @@ $jscomp.polyfill = function (e, r, p, m) {
6427
6445
  function Autocomplete(el, options) {
6428
6446
  _classCallCheck(this, Autocomplete);
6429
6447
 
6430
- var _this36 = _possibleConstructorReturn(this, (Autocomplete.__proto__ || Object.getPrototypeOf(Autocomplete)).call(this, Autocomplete, el, options));
6448
+ var _this37 = _possibleConstructorReturn(this, (Autocomplete.__proto__ || Object.getPrototypeOf(Autocomplete)).call(this, Autocomplete, el, options));
6431
6449
 
6432
- _this36.el.M_Autocomplete = _this36;
6450
+ _this37.el.M_Autocomplete = _this37;
6433
6451
 
6434
6452
  /**
6435
6453
  * Options for the autocomplete
@@ -6443,20 +6461,20 @@ $jscomp.polyfill = function (e, r, p, m) {
6443
6461
  * @prop {Boolean} noWrap
6444
6462
  * @prop {Function} onCycleTo
6445
6463
  */
6446
- _this36.options = $.extend({}, Autocomplete.defaults, options);
6464
+ _this37.options = $.extend({}, Autocomplete.defaults, options);
6447
6465
 
6448
6466
  // Setup
6449
- _this36.isOpen = false;
6450
- _this36.count = 0;
6451
- _this36.activeIndex = -1;
6452
- _this36.oldVal;
6453
- _this36.$inputField = _this36.$el.closest('.input-field');
6454
- _this36.$active = $();
6455
- _this36._mousedown = false;
6456
- _this36._setupDropdown();
6457
-
6458
- _this36._setupEventHandlers();
6459
- return _this36;
6467
+ _this37.isOpen = false;
6468
+ _this37.count = 0;
6469
+ _this37.activeIndex = -1;
6470
+ _this37.oldVal;
6471
+ _this37.$inputField = _this37.$el.closest('.input-field');
6472
+ _this37.$active = $();
6473
+ _this37._mousedown = false;
6474
+ _this37._setupDropdown();
6475
+
6476
+ _this37._setupEventHandlers();
6477
+ return _this37;
6460
6478
  }
6461
6479
 
6462
6480
  _createClass(Autocomplete, [{
@@ -6528,7 +6546,7 @@ $jscomp.polyfill = function (e, r, p, m) {
6528
6546
  }, {
6529
6547
  key: "_setupDropdown",
6530
6548
  value: function _setupDropdown() {
6531
- var _this37 = this;
6549
+ var _this38 = this;
6532
6550
 
6533
6551
  this.container = document.createElement('ul');
6534
6552
  this.container.id = "autocomplete-options-" + M.guid();
@@ -6541,7 +6559,7 @@ $jscomp.polyfill = function (e, r, p, m) {
6541
6559
  closeOnClick: false,
6542
6560
  coverTrigger: false,
6543
6561
  onItemClick: function (itemEl) {
6544
- _this37.selectOption($(itemEl));
6562
+ _this38.selectOption($(itemEl));
6545
6563
  }
6546
6564
  });
6547
6565
 
@@ -6594,7 +6612,7 @@ $jscomp.polyfill = function (e, r, p, m) {
6594
6612
 
6595
6613
  // Check if the input isn't empty
6596
6614
  // Check if focus triggered by tab
6597
- if (this.oldVal !== val && M.tabPressed) {
6615
+ if (this.oldVal !== val && (M.tabPressed || e.type !== 'focus')) {
6598
6616
  this.open();
6599
6617
  }
6600
6618
 
@@ -6753,7 +6771,7 @@ $jscomp.polyfill = function (e, r, p, m) {
6753
6771
  }, {
6754
6772
  key: "_renderDropdown",
6755
6773
  value: function _renderDropdown(data, val) {
6756
- var _this38 = this;
6774
+ var _this39 = this;
6757
6775
 
6758
6776
  this._resetAutocomplete();
6759
6777
 
@@ -6780,7 +6798,7 @@ $jscomp.polyfill = function (e, r, p, m) {
6780
6798
  // Sort
6781
6799
  if (this.options.sortFunction) {
6782
6800
  var sortFunctionBound = function (a, b) {
6783
- return _this38.options.sortFunction(a.key.toLowerCase(), b.key.toLowerCase(), val.toLowerCase());
6801
+ return _this39.options.sortFunction(a.key.toLowerCase(), b.key.toLowerCase(), val.toLowerCase());
6784
6802
  };
6785
6803
  matchingData.sort(sortFunctionBound);
6786
6804
  }
@@ -7053,8 +7071,7 @@ $jscomp.polyfill = function (e, r, p, m) {
7053
7071
  formReset.find('select').each(function () {
7054
7072
  // check if initialized
7055
7073
  if (this.M_FormSelect) {
7056
- var reset_text = $(this).find('option[selected]').text();
7057
- $(this).siblings('input.select-dropdown')[0].value = reset_text;
7074
+ $(this).trigger('change');
7058
7075
  }
7059
7076
  });
7060
7077
  }, 0);
@@ -7162,9 +7179,9 @@ $jscomp.polyfill = function (e, r, p, m) {
7162
7179
  function Slider(el, options) {
7163
7180
  _classCallCheck(this, Slider);
7164
7181
 
7165
- var _this39 = _possibleConstructorReturn(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).call(this, Slider, el, options));
7182
+ var _this40 = _possibleConstructorReturn(this, (Slider.__proto__ || Object.getPrototypeOf(Slider)).call(this, Slider, el, options));
7166
7183
 
7167
- _this39.el.M_Slider = _this39;
7184
+ _this40.el.M_Slider = _this40;
7168
7185
 
7169
7186
  /**
7170
7187
  * Options for the modal
@@ -7174,27 +7191,27 @@ $jscomp.polyfill = function (e, r, p, m) {
7174
7191
  * @prop {Number} [duration=500] - Length in ms of slide transition
7175
7192
  * @prop {Number} [interval=6000] - Length in ms of slide interval
7176
7193
  */
7177
- _this39.options = $.extend({}, Slider.defaults, options);
7194
+ _this40.options = $.extend({}, Slider.defaults, options);
7178
7195
 
7179
7196
  // setup
7180
- _this39.$slider = _this39.$el.find('.slides');
7181
- _this39.$slides = _this39.$slider.children('li');
7182
- _this39.activeIndex = _this39.$slides.filter(function (item) {
7197
+ _this40.$slider = _this40.$el.find('.slides');
7198
+ _this40.$slides = _this40.$slider.children('li');
7199
+ _this40.activeIndex = _this40.$slides.filter(function (item) {
7183
7200
  return $(item).hasClass('active');
7184
7201
  }).first().index();
7185
- if (_this39.activeIndex != -1) {
7186
- _this39.$active = _this39.$slides.eq(_this39.activeIndex);
7202
+ if (_this40.activeIndex != -1) {
7203
+ _this40.$active = _this40.$slides.eq(_this40.activeIndex);
7187
7204
  }
7188
7205
 
7189
- _this39._setSliderHeight();
7206
+ _this40._setSliderHeight();
7190
7207
 
7191
7208
  // Set initial positions of captions
7192
- _this39.$slides.find('.caption').each(function (el) {
7193
- _this39._animateCaptionIn(el, 0);
7209
+ _this40.$slides.find('.caption').each(function (el) {
7210
+ _this40._animateCaptionIn(el, 0);
7194
7211
  });
7195
7212
 
7196
7213
  // Move img src into background-image
7197
- _this39.$slides.find('img').each(function (el) {
7214
+ _this40.$slides.find('img').each(function (el) {
7198
7215
  var placeholderBase64 = 'data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==';
7199
7216
  if ($(el).attr('src') !== placeholderBase64) {
7200
7217
  $(el).css('background-image', 'url("' + $(el).attr('src') + '")');
@@ -7202,46 +7219,46 @@ $jscomp.polyfill = function (e, r, p, m) {
7202
7219
  }
7203
7220
  });
7204
7221
 
7205
- _this39._setupIndicators();
7222
+ _this40._setupIndicators();
7206
7223
 
7207
7224
  // Show active slide
7208
- if (_this39.$active) {
7209
- _this39.$active.css('display', 'block');
7225
+ if (_this40.$active) {
7226
+ _this40.$active.css('display', 'block');
7210
7227
  } else {
7211
- _this39.$slides.first().addClass('active');
7228
+ _this40.$slides.first().addClass('active');
7212
7229
  anim({
7213
- targets: _this39.$slides.first()[0],
7230
+ targets: _this40.$slides.first()[0],
7214
7231
  opacity: 1,
7215
- duration: _this39.options.duration,
7232
+ duration: _this40.options.duration,
7216
7233
  easing: 'easeOutQuad'
7217
7234
  });
7218
7235
 
7219
- _this39.activeIndex = 0;
7220
- _this39.$active = _this39.$slides.eq(_this39.activeIndex);
7236
+ _this40.activeIndex = 0;
7237
+ _this40.$active = _this40.$slides.eq(_this40.activeIndex);
7221
7238
 
7222
7239
  // Update indicators
7223
- if (_this39.options.indicators) {
7224
- _this39.$indicators.eq(_this39.activeIndex).addClass('active');
7240
+ if (_this40.options.indicators) {
7241
+ _this40.$indicators.eq(_this40.activeIndex).addClass('active');
7225
7242
  }
7226
7243
  }
7227
7244
 
7228
7245
  // Adjust height to current slide
7229
- _this39.$active.find('img').each(function (el) {
7246
+ _this40.$active.find('img').each(function (el) {
7230
7247
  anim({
7231
- targets: _this39.$active.find('.caption')[0],
7248
+ targets: _this40.$active.find('.caption')[0],
7232
7249
  opacity: 1,
7233
7250
  translateX: 0,
7234
7251
  translateY: 0,
7235
- duration: _this39.options.duration,
7252
+ duration: _this40.options.duration,
7236
7253
  easing: 'easeOutQuad'
7237
7254
  });
7238
7255
  });
7239
7256
 
7240
- _this39._setupEventHandlers();
7257
+ _this40._setupEventHandlers();
7241
7258
 
7242
7259
  // auto scroll
7243
- _this39.start();
7244
- return _this39;
7260
+ _this40.start();
7261
+ return _this40;
7245
7262
  }
7246
7263
 
7247
7264
  _createClass(Slider, [{
@@ -7265,14 +7282,14 @@ $jscomp.polyfill = function (e, r, p, m) {
7265
7282
  }, {
7266
7283
  key: "_setupEventHandlers",
7267
7284
  value: function _setupEventHandlers() {
7268
- var _this40 = this;
7285
+ var _this41 = this;
7269
7286
 
7270
7287
  this._handleIntervalBound = this._handleInterval.bind(this);
7271
7288
  this._handleIndicatorClickBound = this._handleIndicatorClick.bind(this);
7272
7289
 
7273
7290
  if (this.options.indicators) {
7274
7291
  this.$indicators.each(function (el) {
7275
- el.addEventListener('click', _this40._handleIndicatorClickBound);
7292
+ el.addEventListener('click', _this41._handleIndicatorClickBound);
7276
7293
  });
7277
7294
  }
7278
7295
  }
@@ -7284,11 +7301,11 @@ $jscomp.polyfill = function (e, r, p, m) {
7284
7301
  }, {
7285
7302
  key: "_removeEventHandlers",
7286
7303
  value: function _removeEventHandlers() {
7287
- var _this41 = this;
7304
+ var _this42 = this;
7288
7305
 
7289
7306
  if (this.options.indicators) {
7290
7307
  this.$indicators.each(function (el) {
7291
- el.removeEventListener('click', _this41._handleIndicatorClickBound);
7308
+ el.removeEventListener('click', _this42._handleIndicatorClickBound);
7292
7309
  });
7293
7310
  }
7294
7311
  }
@@ -7373,13 +7390,13 @@ $jscomp.polyfill = function (e, r, p, m) {
7373
7390
  }, {
7374
7391
  key: "_setupIndicators",
7375
7392
  value: function _setupIndicators() {
7376
- var _this42 = this;
7393
+ var _this43 = this;
7377
7394
 
7378
7395
  if (this.options.indicators) {
7379
7396
  this.$indicators = $('<ul class="indicators"></ul>');
7380
7397
  this.$slides.each(function (el, index) {
7381
7398
  var $indicator = $('<li class="indicator-item"></li>');
7382
- _this42.$indicators.append($indicator[0]);
7399
+ _this43.$indicators.append($indicator[0]);
7383
7400
  });
7384
7401
  this.$el.append(this.$indicators[0]);
7385
7402
  this.$indicators = this.$indicators.children('li.indicator-item');
@@ -7404,7 +7421,7 @@ $jscomp.polyfill = function (e, r, p, m) {
7404
7421
  }, {
7405
7422
  key: "set",
7406
7423
  value: function set(index) {
7407
- var _this43 = this;
7424
+ var _this44 = this;
7408
7425
 
7409
7426
  // Wrap around indices.
7410
7427
  if (index >= this.$slides.length) index = 0;else if (index < 0) index = this.$slides.length - 1;
@@ -7421,7 +7438,7 @@ $jscomp.polyfill = function (e, r, p, m) {
7421
7438
  duration: this.options.duration,
7422
7439
  easing: 'easeOutQuad',
7423
7440
  complete: function () {
7424
- _this43.$slides.not('.active').each(function (el) {
7441
+ _this44.$slides.not('.active').each(function (el) {
7425
7442
  anim({
7426
7443
  targets: el,
7427
7444
  opacity: 0,
@@ -7620,9 +7637,9 @@ $jscomp.polyfill = function (e, r, p, m) {
7620
7637
  function Chips(el, options) {
7621
7638
  _classCallCheck(this, Chips);
7622
7639
 
7623
- var _this44 = _possibleConstructorReturn(this, (Chips.__proto__ || Object.getPrototypeOf(Chips)).call(this, Chips, el, options));
7640
+ var _this45 = _possibleConstructorReturn(this, (Chips.__proto__ || Object.getPrototypeOf(Chips)).call(this, Chips, el, options));
7624
7641
 
7625
- _this44.el.M_Chips = _this44;
7642
+ _this45.el.M_Chips = _this45;
7626
7643
 
7627
7644
  /**
7628
7645
  * Options for the modal
@@ -7632,34 +7649,34 @@ $jscomp.polyfill = function (e, r, p, m) {
7632
7649
  * @prop {String} secondaryPlaceholder
7633
7650
  * @prop {Object} autocompleteOptions
7634
7651
  */
7635
- _this44.options = $.extend({}, Chips.defaults, options);
7652
+ _this45.options = $.extend({}, Chips.defaults, options);
7636
7653
 
7637
- _this44.$el.addClass('chips input-field');
7638
- _this44.chipsData = [];
7639
- _this44.$chips = $();
7640
- _this44._setupInput();
7641
- _this44.hasAutocomplete = Object.keys(_this44.options.autocompleteOptions).length > 0;
7654
+ _this45.$el.addClass('chips input-field');
7655
+ _this45.chipsData = [];
7656
+ _this45.$chips = $();
7657
+ _this45._setupInput();
7658
+ _this45.hasAutocomplete = Object.keys(_this45.options.autocompleteOptions).length > 0;
7642
7659
 
7643
7660
  // Set input id
7644
- if (!_this44.$input.attr('id')) {
7645
- _this44.$input.attr('id', M.guid());
7661
+ if (!_this45.$input.attr('id')) {
7662
+ _this45.$input.attr('id', M.guid());
7646
7663
  }
7647
7664
 
7648
7665
  // Render initial chips
7649
- if (_this44.options.data.length) {
7650
- _this44.chipsData = _this44.options.data;
7651
- _this44._renderChips(_this44.chipsData);
7666
+ if (_this45.options.data.length) {
7667
+ _this45.chipsData = _this45.options.data;
7668
+ _this45._renderChips(_this45.chipsData);
7652
7669
  }
7653
7670
 
7654
7671
  // Setup autocomplete if needed
7655
- if (_this44.hasAutocomplete) {
7656
- _this44._setupAutocomplete();
7672
+ if (_this45.hasAutocomplete) {
7673
+ _this45._setupAutocomplete();
7657
7674
  }
7658
7675
 
7659
- _this44._setPlaceholder();
7660
- _this44._setupLabel();
7661
- _this44._setupEventHandlers();
7662
- return _this44;
7676
+ _this45._setPlaceholder();
7677
+ _this45._setupLabel();
7678
+ _this45._setupEventHandlers();
7679
+ return _this45;
7663
7680
  }
7664
7681
 
7665
7682
  _createClass(Chips, [{
@@ -7862,14 +7879,14 @@ $jscomp.polyfill = function (e, r, p, m) {
7862
7879
  }, {
7863
7880
  key: "_setupAutocomplete",
7864
7881
  value: function _setupAutocomplete() {
7865
- var _this45 = this;
7882
+ var _this46 = this;
7866
7883
 
7867
7884
  this.options.autocompleteOptions.onAutocomplete = function (val) {
7868
- _this45.addChip({
7885
+ _this46.addChip({
7869
7886
  tag: val
7870
7887
  });
7871
- _this45.$input[0].value = '';
7872
- _this45.$input[0].focus();
7888
+ _this46.$input[0].value = '';
7889
+ _this46.$input[0].focus();
7873
7890
  };
7874
7891
 
7875
7892
  this.autocomplete = M.Autocomplete.init(this.$input[0], this.options.autocompleteOptions);
@@ -8164,21 +8181,21 @@ $jscomp.polyfill = function (e, r, p, m) {
8164
8181
  function Pushpin(el, options) {
8165
8182
  _classCallCheck(this, Pushpin);
8166
8183
 
8167
- var _this46 = _possibleConstructorReturn(this, (Pushpin.__proto__ || Object.getPrototypeOf(Pushpin)).call(this, Pushpin, el, options));
8184
+ var _this47 = _possibleConstructorReturn(this, (Pushpin.__proto__ || Object.getPrototypeOf(Pushpin)).call(this, Pushpin, el, options));
8168
8185
 
8169
- _this46.el.M_Pushpin = _this46;
8186
+ _this47.el.M_Pushpin = _this47;
8170
8187
 
8171
8188
  /**
8172
8189
  * Options for the modal
8173
8190
  * @member Pushpin#options
8174
8191
  */
8175
- _this46.options = $.extend({}, Pushpin.defaults, options);
8192
+ _this47.options = $.extend({}, Pushpin.defaults, options);
8176
8193
 
8177
- _this46.originalOffset = _this46.el.offsetTop;
8178
- Pushpin._pushpins.push(_this46);
8179
- _this46._setupEventHandlers();
8180
- _this46._updatePosition();
8181
- return _this46;
8194
+ _this47.originalOffset = _this47.el.offsetTop;
8195
+ Pushpin._pushpins.push(_this47);
8196
+ _this47._setupEventHandlers();
8197
+ _this47._updatePosition();
8198
+ return _this47;
8182
8199
  }
8183
8200
 
8184
8201
  _createClass(Pushpin, [{
@@ -8214,7 +8231,6 @@ $jscomp.polyfill = function (e, r, p, m) {
8214
8231
 
8215
8232
  if (this.options.top <= scrolled && this.options.bottom >= scrolled && !this.el.classList.contains('pinned')) {
8216
8233
  this._removePinClasses();
8217
-
8218
8234
  this.el.style.top = this.options.offset + "px";
8219
8235
  this.el.classList.add('pinned');
8220
8236
 
@@ -8251,7 +8267,10 @@ $jscomp.polyfill = function (e, r, p, m) {
8251
8267
  }, {
8252
8268
  key: "_removePinClasses",
8253
8269
  value: function _removePinClasses() {
8254
- this.el.classList.remove('pin-top', 'pinned', 'pin-bottom');
8270
+ // IE 11 bug (can't remove multiple classes in one line)
8271
+ this.el.classList.remove('pin-top');
8272
+ this.el.classList.remove('pinned');
8273
+ this.el.classList.remove('pin-bottom');
8255
8274
  }
8256
8275
  }], [{
8257
8276
  key: "init",
@@ -8329,9 +8348,9 @@ $jscomp.polyfill = function (e, r, p, m) {
8329
8348
  function FloatingActionButton(el, options) {
8330
8349
  _classCallCheck(this, FloatingActionButton);
8331
8350
 
8332
- var _this47 = _possibleConstructorReturn(this, (FloatingActionButton.__proto__ || Object.getPrototypeOf(FloatingActionButton)).call(this, FloatingActionButton, el, options));
8351
+ var _this48 = _possibleConstructorReturn(this, (FloatingActionButton.__proto__ || Object.getPrototypeOf(FloatingActionButton)).call(this, FloatingActionButton, el, options));
8333
8352
 
8334
- _this47.el.M_FloatingActionButton = _this47;
8353
+ _this48.el.M_FloatingActionButton = _this48;
8335
8354
 
8336
8355
  /**
8337
8356
  * Options for the fab
@@ -8340,28 +8359,28 @@ $jscomp.polyfill = function (e, r, p, m) {
8340
8359
  * @prop {Boolean} [hoverEnabled=true] - Enable hover vs click
8341
8360
  * @prop {Boolean} [toolbarEnabled=false] - Enable toolbar transition
8342
8361
  */
8343
- _this47.options = $.extend({}, FloatingActionButton.defaults, options);
8344
-
8345
- _this47.isOpen = false;
8346
- _this47.$anchor = _this47.$el.children('a').first();
8347
- _this47.$menu = _this47.$el.children('ul').first();
8348
- _this47.$floatingBtns = _this47.$el.find('ul .btn-floating');
8349
- _this47.$floatingBtnsReverse = _this47.$el.find('ul .btn-floating').reverse();
8350
- _this47.offsetY = 0;
8351
- _this47.offsetX = 0;
8352
-
8353
- _this47.$el.addClass("direction-" + _this47.options.direction);
8354
- if (_this47.options.direction === 'top') {
8355
- _this47.offsetY = 40;
8356
- } else if (_this47.options.direction === 'right') {
8357
- _this47.offsetX = -40;
8358
- } else if (_this47.options.direction === 'bottom') {
8359
- _this47.offsetY = -40;
8362
+ _this48.options = $.extend({}, FloatingActionButton.defaults, options);
8363
+
8364
+ _this48.isOpen = false;
8365
+ _this48.$anchor = _this48.$el.children('a').first();
8366
+ _this48.$menu = _this48.$el.children('ul').first();
8367
+ _this48.$floatingBtns = _this48.$el.find('ul .btn-floating');
8368
+ _this48.$floatingBtnsReverse = _this48.$el.find('ul .btn-floating').reverse();
8369
+ _this48.offsetY = 0;
8370
+ _this48.offsetX = 0;
8371
+
8372
+ _this48.$el.addClass("direction-" + _this48.options.direction);
8373
+ if (_this48.options.direction === 'top') {
8374
+ _this48.offsetY = 40;
8375
+ } else if (_this48.options.direction === 'right') {
8376
+ _this48.offsetX = -40;
8377
+ } else if (_this48.options.direction === 'bottom') {
8378
+ _this48.offsetY = -40;
8360
8379
  } else {
8361
- _this47.offsetX = 40;
8380
+ _this48.offsetX = 40;
8362
8381
  }
8363
- _this47._setupEventHandlers();
8364
- return _this47;
8382
+ _this48._setupEventHandlers();
8383
+ return _this48;
8365
8384
  }
8366
8385
 
8367
8386
  _createClass(FloatingActionButton, [{
@@ -8484,7 +8503,7 @@ $jscomp.polyfill = function (e, r, p, m) {
8484
8503
  }, {
8485
8504
  key: "_animateInFAB",
8486
8505
  value: function _animateInFAB() {
8487
- var _this48 = this;
8506
+ var _this49 = this;
8488
8507
 
8489
8508
  this.$el.addClass('active');
8490
8509
 
@@ -8494,8 +8513,8 @@ $jscomp.polyfill = function (e, r, p, m) {
8494
8513
  targets: el,
8495
8514
  opacity: 1,
8496
8515
  scale: [0.4, 1],
8497
- translateY: [_this48.offsetY, 0],
8498
- translateX: [_this48.offsetX, 0],
8516
+ translateY: [_this49.offsetY, 0],
8517
+ translateX: [_this49.offsetX, 0],
8499
8518
  duration: 275,
8500
8519
  delay: time,
8501
8520
  easing: 'easeInOutQuad'
@@ -8511,7 +8530,7 @@ $jscomp.polyfill = function (e, r, p, m) {
8511
8530
  }, {
8512
8531
  key: "_animateOutFAB",
8513
8532
  value: function _animateOutFAB() {
8514
- var _this49 = this;
8533
+ var _this50 = this;
8515
8534
 
8516
8535
  this.$floatingBtnsReverse.each(function (el) {
8517
8536
  anim.remove(el);
@@ -8519,12 +8538,12 @@ $jscomp.polyfill = function (e, r, p, m) {
8519
8538
  targets: el,
8520
8539
  opacity: 0,
8521
8540
  scale: 0.4,
8522
- translateY: _this49.offsetY,
8523
- translateX: _this49.offsetX,
8541
+ translateY: _this50.offsetY,
8542
+ translateX: _this50.offsetX,
8524
8543
  duration: 175,
8525
8544
  easing: 'easeOutQuad',
8526
8545
  complete: function () {
8527
- _this49.$el.removeClass('active');
8546
+ _this50.$el.removeClass('active');
8528
8547
  }
8529
8548
  });
8530
8549
  });
@@ -8537,7 +8556,7 @@ $jscomp.polyfill = function (e, r, p, m) {
8537
8556
  }, {
8538
8557
  key: "_animateInToolbar",
8539
8558
  value: function _animateInToolbar() {
8540
- var _this50 = this;
8559
+ var _this51 = this;
8541
8560
 
8542
8561
  var scaleFactor = void 0;
8543
8562
  var windowWidth = window.innerWidth;
@@ -8573,18 +8592,18 @@ $jscomp.polyfill = function (e, r, p, m) {
8573
8592
  });
8574
8593
 
8575
8594
  setTimeout(function () {
8576
- _this50.$el.css({
8595
+ _this51.$el.css({
8577
8596
  transform: '',
8578
8597
  transition: 'transform .2s cubic-bezier(0.550, 0.085, 0.680, 0.530), background-color 0s linear .2s'
8579
8598
  });
8580
- _this50.$anchor.css({
8599
+ _this51.$anchor.css({
8581
8600
  overflow: 'visible',
8582
8601
  transform: '',
8583
8602
  transition: 'transform .2s'
8584
8603
  });
8585
8604
 
8586
8605
  setTimeout(function () {
8587
- _this50.$el.css({
8606
+ _this51.$el.css({
8588
8607
  overflow: 'hidden',
8589
8608
  'background-color': fabColor
8590
8609
  });
@@ -8592,14 +8611,14 @@ $jscomp.polyfill = function (e, r, p, m) {
8592
8611
  transform: 'scale(' + scaleFactor + ')',
8593
8612
  transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
8594
8613
  });
8595
- _this50.$menu.children('li').children('a').css({
8614
+ _this51.$menu.children('li').children('a').css({
8596
8615
  opacity: 1
8597
8616
  });
8598
8617
 
8599
8618
  // Scroll to close.
8600
- _this50._handleDocumentClickBound = _this50._handleDocumentClick.bind(_this50);
8601
- window.addEventListener('scroll', _this50._handleCloseBound, true);
8602
- document.body.addEventListener('click', _this50._handleDocumentClickBound, true);
8619
+ _this51._handleDocumentClickBound = _this51._handleDocumentClick.bind(_this51);
8620
+ window.addEventListener('scroll', _this51._handleCloseBound, true);
8621
+ document.body.addEventListener('click', _this51._handleDocumentClickBound, true);
8603
8622
  }, 100);
8604
8623
  }, 0);
8605
8624
  }
@@ -8611,7 +8630,7 @@ $jscomp.polyfill = function (e, r, p, m) {
8611
8630
  }, {
8612
8631
  key: "_animateOutToolbar",
8613
8632
  value: function _animateOutToolbar() {
8614
- var _this51 = this;
8633
+ var _this52 = this;
8615
8634
 
8616
8635
  var windowWidth = window.innerWidth;
8617
8636
  var windowHeight = window.innerHeight;
@@ -8642,26 +8661,26 @@ $jscomp.polyfill = function (e, r, p, m) {
8642
8661
  backdrop.remove();
8643
8662
 
8644
8663
  // Set initial state.
8645
- _this51.$el.css({
8664
+ _this52.$el.css({
8646
8665
  'text-align': '',
8647
8666
  width: '',
8648
8667
  bottom: '',
8649
8668
  left: '',
8650
8669
  overflow: '',
8651
8670
  'background-color': '',
8652
- transform: 'translate3d(' + -_this51.offsetX + 'px,0,0)'
8671
+ transform: 'translate3d(' + -_this52.offsetX + 'px,0,0)'
8653
8672
  });
8654
- _this51.$anchor.css({
8673
+ _this52.$anchor.css({
8655
8674
  overflow: '',
8656
- transform: 'translate3d(0,' + _this51.offsetY + 'px,0)'
8675
+ transform: 'translate3d(0,' + _this52.offsetY + 'px,0)'
8657
8676
  });
8658
8677
 
8659
8678
  setTimeout(function () {
8660
- _this51.$el.css({
8679
+ _this52.$el.css({
8661
8680
  transform: 'translate3d(0,0,0)',
8662
8681
  transition: 'transform .2s'
8663
8682
  });
8664
- _this51.$anchor.css({
8683
+ _this52.$anchor.css({
8665
8684
  transform: 'translate3d(0,0,0)',
8666
8685
  transition: 'transform .2s cubic-bezier(0.550, 0.055, 0.675, 0.190)'
8667
8686
  });
@@ -8798,51 +8817,51 @@ $jscomp.polyfill = function (e, r, p, m) {
8798
8817
  function Datepicker(el, options) {
8799
8818
  _classCallCheck(this, Datepicker);
8800
8819
 
8801
- var _this52 = _possibleConstructorReturn(this, (Datepicker.__proto__ || Object.getPrototypeOf(Datepicker)).call(this, Datepicker, el, options));
8820
+ var _this53 = _possibleConstructorReturn(this, (Datepicker.__proto__ || Object.getPrototypeOf(Datepicker)).call(this, Datepicker, el, options));
8802
8821
 
8803
- _this52.el.M_Datepicker = _this52;
8822
+ _this53.el.M_Datepicker = _this53;
8804
8823
 
8805
- _this52.options = $.extend({}, Datepicker.defaults, options);
8824
+ _this53.options = $.extend({}, Datepicker.defaults, options);
8806
8825
 
8807
8826
  // make sure i18n defaults are not lost when only few i18n option properties are passed
8808
8827
  if (!!options && options.hasOwnProperty('i18n') && typeof options.i18n === 'object') {
8809
- _this52.options.i18n = $.extend({}, Datepicker.defaults.i18n, options.i18n);
8828
+ _this53.options.i18n = $.extend({}, Datepicker.defaults.i18n, options.i18n);
8810
8829
  }
8811
8830
 
8812
8831
  // Remove time component from minDate and maxDate options
8813
- if (_this52.options.minDate) _this52.options.minDate.setHours(0, 0, 0, 0);
8814
- if (_this52.options.maxDate) _this52.options.maxDate.setHours(0, 0, 0, 0);
8832
+ if (_this53.options.minDate) _this53.options.minDate.setHours(0, 0, 0, 0);
8833
+ if (_this53.options.maxDate) _this53.options.maxDate.setHours(0, 0, 0, 0);
8815
8834
 
8816
- _this52.id = M.guid();
8835
+ _this53.id = M.guid();
8817
8836
 
8818
- _this52._setupVariables();
8819
- _this52._insertHTMLIntoDOM();
8820
- _this52._setupModal();
8837
+ _this53._setupVariables();
8838
+ _this53._insertHTMLIntoDOM();
8839
+ _this53._setupModal();
8821
8840
 
8822
- _this52._setupEventHandlers();
8841
+ _this53._setupEventHandlers();
8823
8842
 
8824
- if (!_this52.options.defaultDate) {
8825
- _this52.options.defaultDate = new Date(Date.parse(_this52.el.value));
8843
+ if (!_this53.options.defaultDate) {
8844
+ _this53.options.defaultDate = new Date(Date.parse(_this53.el.value));
8826
8845
  }
8827
8846
 
8828
- var defDate = _this52.options.defaultDate;
8847
+ var defDate = _this53.options.defaultDate;
8829
8848
  if (Datepicker._isDate(defDate)) {
8830
- if (_this52.options.setDefaultDate) {
8831
- _this52.setDate(defDate, true);
8832
- _this52.setInputValue();
8849
+ if (_this53.options.setDefaultDate) {
8850
+ _this53.setDate(defDate, true);
8851
+ _this53.setInputValue();
8833
8852
  } else {
8834
- _this52.gotoDate(defDate);
8853
+ _this53.gotoDate(defDate);
8835
8854
  }
8836
8855
  } else {
8837
- _this52.gotoDate(new Date());
8856
+ _this53.gotoDate(new Date());
8838
8857
  }
8839
8858
 
8840
8859
  /**
8841
8860
  * Describes open/close state of datepicker
8842
8861
  * @type {Boolean}
8843
8862
  */
8844
- _this52.isOpen = false;
8845
- return _this52;
8863
+ _this53.isOpen = false;
8864
+ return _this53;
8846
8865
  }
8847
8866
 
8848
8867
  _createClass(Datepicker, [{
@@ -8891,19 +8910,19 @@ $jscomp.polyfill = function (e, r, p, m) {
8891
8910
  }, {
8892
8911
  key: "_setupModal",
8893
8912
  value: function _setupModal() {
8894
- var _this53 = this;
8913
+ var _this54 = this;
8895
8914
 
8896
8915
  this.modalEl.id = 'modal-' + this.id;
8897
8916
  this.modal = M.Modal.init(this.modalEl, {
8898
8917
  onCloseEnd: function () {
8899
- _this53.isOpen = false;
8918
+ _this54.isOpen = false;
8900
8919
  }
8901
8920
  });
8902
8921
  }
8903
8922
  }, {
8904
8923
  key: "toString",
8905
8924
  value: function toString(format) {
8906
- var _this54 = this;
8925
+ var _this55 = this;
8907
8926
 
8908
8927
  format = format || this.options.format;
8909
8928
  if (!Datepicker._isDate(this.date)) {
@@ -8912,8 +8931,8 @@ $jscomp.polyfill = function (e, r, p, m) {
8912
8931
 
8913
8932
  var formatArray = format.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);
8914
8933
  var formattedDate = formatArray.map(function (label) {
8915
- if (_this54.formats[label]) {
8916
- return _this54.formats[label]();
8934
+ if (_this55.formats[label]) {
8935
+ return _this55.formats[label]();
8917
8936
  }
8918
8937
 
8919
8938
  return label;
@@ -9334,7 +9353,7 @@ $jscomp.polyfill = function (e, r, p, m) {
9334
9353
  }, {
9335
9354
  key: "_setupVariables",
9336
9355
  value: function _setupVariables() {
9337
- var _this55 = this;
9356
+ var _this56 = this;
9338
9357
 
9339
9358
  this.$modalEl = $(Datepicker._template);
9340
9359
  this.modalEl = this.$modalEl[0];
@@ -9351,36 +9370,36 @@ $jscomp.polyfill = function (e, r, p, m) {
9351
9370
 
9352
9371
  this.formats = {
9353
9372
  d: function () {
9354
- return _this55.date.getDate();
9373
+ return _this56.date.getDate();
9355
9374
  },
9356
9375
  dd: function () {
9357
- var d = _this55.date.getDate();
9376
+ var d = _this56.date.getDate();
9358
9377
  return (d < 10 ? '0' : '') + d;
9359
9378
  },
9360
9379
  ddd: function () {
9361
- return _this55.options.i18n.weekdaysShort[_this55.date.getDay()];
9380
+ return _this56.options.i18n.weekdaysShort[_this56.date.getDay()];
9362
9381
  },
9363
9382
  dddd: function () {
9364
- return _this55.options.i18n.weekdays[_this55.date.getDay()];
9383
+ return _this56.options.i18n.weekdays[_this56.date.getDay()];
9365
9384
  },
9366
9385
  m: function () {
9367
- return _this55.date.getMonth() + 1;
9386
+ return _this56.date.getMonth() + 1;
9368
9387
  },
9369
9388
  mm: function () {
9370
- var m = _this55.date.getMonth() + 1;
9389
+ var m = _this56.date.getMonth() + 1;
9371
9390
  return (m < 10 ? '0' : '') + m;
9372
9391
  },
9373
9392
  mmm: function () {
9374
- return _this55.options.i18n.monthsShort[_this55.date.getMonth()];
9393
+ return _this56.options.i18n.monthsShort[_this56.date.getMonth()];
9375
9394
  },
9376
9395
  mmmm: function () {
9377
- return _this55.options.i18n.months[_this55.date.getMonth()];
9396
+ return _this56.options.i18n.months[_this56.date.getMonth()];
9378
9397
  },
9379
9398
  yy: function () {
9380
- return ('' + _this55.date.getFullYear()).slice(2);
9399
+ return ('' + _this56.date.getFullYear()).slice(2);
9381
9400
  },
9382
9401
  yyyy: function () {
9383
- return _this55.date.getFullYear();
9402
+ return _this56.date.getFullYear();
9384
9403
  }
9385
9404
  };
9386
9405
  }
@@ -9669,21 +9688,21 @@ $jscomp.polyfill = function (e, r, p, m) {
9669
9688
  function Timepicker(el, options) {
9670
9689
  _classCallCheck(this, Timepicker);
9671
9690
 
9672
- var _this56 = _possibleConstructorReturn(this, (Timepicker.__proto__ || Object.getPrototypeOf(Timepicker)).call(this, Timepicker, el, options));
9691
+ var _this57 = _possibleConstructorReturn(this, (Timepicker.__proto__ || Object.getPrototypeOf(Timepicker)).call(this, Timepicker, el, options));
9673
9692
 
9674
- _this56.el.M_Timepicker = _this56;
9693
+ _this57.el.M_Timepicker = _this57;
9675
9694
 
9676
- _this56.options = $.extend({}, Timepicker.defaults, options);
9695
+ _this57.options = $.extend({}, Timepicker.defaults, options);
9677
9696
 
9678
- _this56.id = M.guid();
9679
- _this56._insertHTMLIntoDOM();
9680
- _this56._setupModal();
9681
- _this56._setupVariables();
9682
- _this56._setupEventHandlers();
9697
+ _this57.id = M.guid();
9698
+ _this57._insertHTMLIntoDOM();
9699
+ _this57._setupModal();
9700
+ _this57._setupVariables();
9701
+ _this57._setupEventHandlers();
9683
9702
 
9684
- _this56._clockSetup();
9685
- _this56._pickerSetup();
9686
- return _this56;
9703
+ _this57._clockSetup();
9704
+ _this57._pickerSetup();
9705
+ return _this57;
9687
9706
  }
9688
9707
 
9689
9708
  _createClass(Timepicker, [{
@@ -9778,7 +9797,7 @@ $jscomp.polyfill = function (e, r, p, m) {
9778
9797
  }, {
9779
9798
  key: "_handleDocumentClickEnd",
9780
9799
  value: function _handleDocumentClickEnd(e) {
9781
- var _this57 = this;
9800
+ var _this58 = this;
9782
9801
 
9783
9802
  e.preventDefault();
9784
9803
  document.removeEventListener('mouseup', this._handleDocumentClickEndBound);
@@ -9795,7 +9814,7 @@ $jscomp.polyfill = function (e, r, p, m) {
9795
9814
  } else if (this.options.autoClose) {
9796
9815
  $(this.minutesView).addClass('timepicker-dial-out');
9797
9816
  setTimeout(function () {
9798
- _this57.done();
9817
+ _this58.done();
9799
9818
  }, this.options.duration / 2);
9800
9819
  }
9801
9820
 
@@ -9825,17 +9844,17 @@ $jscomp.polyfill = function (e, r, p, m) {
9825
9844
  }, {
9826
9845
  key: "_setupModal",
9827
9846
  value: function _setupModal() {
9828
- var _this58 = this;
9847
+ var _this59 = this;
9829
9848
 
9830
9849
  this.modal = M.Modal.init(this.modalEl, {
9831
9850
  onOpenStart: this.options.onOpenStart,
9832
9851
  onOpenEnd: this.options.onOpenEnd,
9833
9852
  onCloseStart: this.options.onCloseStart,
9834
9853
  onCloseEnd: function () {
9835
- if (typeof _this58.options.onCloseEnd === 'function') {
9836
- _this58.options.onCloseEnd.call(_this58);
9854
+ if (typeof _this59.options.onCloseEnd === 'function') {
9855
+ _this59.options.onCloseEnd.call(_this59);
9837
9856
  }
9838
- _this58.isOpen = false;
9857
+ _this59.isOpen = false;
9839
9858
  }
9840
9859
  });
9841
9860
  }
@@ -10064,7 +10083,7 @@ $jscomp.polyfill = function (e, r, p, m) {
10064
10083
  }, {
10065
10084
  key: "setHand",
10066
10085
  value: function setHand(x, y, roundBy5) {
10067
- var _this59 = this;
10086
+ var _this60 = this;
10068
10087
 
10069
10088
  var radian = Math.atan2(x, -y),
10070
10089
  isHours = this.currentView === 'hours',
@@ -10119,7 +10138,7 @@ $jscomp.polyfill = function (e, r, p, m) {
10119
10138
  if (!this.vibrateTimer) {
10120
10139
  navigator[this.vibrate](10);
10121
10140
  this.vibrateTimer = setTimeout(function () {
10122
- _this59.vibrateTimer = null;
10141
+ _this60.vibrateTimer = null;
10123
10142
  }, 100);
10124
10143
  }
10125
10144
  }
@@ -10284,20 +10303,20 @@ $jscomp.polyfill = function (e, r, p, m) {
10284
10303
  function CharacterCounter(el, options) {
10285
10304
  _classCallCheck(this, CharacterCounter);
10286
10305
 
10287
- var _this60 = _possibleConstructorReturn(this, (CharacterCounter.__proto__ || Object.getPrototypeOf(CharacterCounter)).call(this, CharacterCounter, el, options));
10306
+ var _this61 = _possibleConstructorReturn(this, (CharacterCounter.__proto__ || Object.getPrototypeOf(CharacterCounter)).call(this, CharacterCounter, el, options));
10288
10307
 
10289
- _this60.el.M_CharacterCounter = _this60;
10308
+ _this61.el.M_CharacterCounter = _this61;
10290
10309
 
10291
10310
  /**
10292
10311
  * Options for the character counter
10293
10312
  */
10294
- _this60.options = $.extend({}, CharacterCounter.defaults, options);
10313
+ _this61.options = $.extend({}, CharacterCounter.defaults, options);
10295
10314
 
10296
- _this60.isInvalid = false;
10297
- _this60.isValidLength = false;
10298
- _this60._setupCounter();
10299
- _this60._setupEventHandlers();
10300
- return _this60;
10315
+ _this61.isInvalid = false;
10316
+ _this61.isValidLength = false;
10317
+ _this61._setupCounter();
10318
+ _this61._setupEventHandlers();
10319
+ return _this61;
10301
10320
  }
10302
10321
 
10303
10322
  _createClass(CharacterCounter, [{
@@ -10464,9 +10483,9 @@ $jscomp.polyfill = function (e, r, p, m) {
10464
10483
  function Carousel(el, options) {
10465
10484
  _classCallCheck(this, Carousel);
10466
10485
 
10467
- var _this61 = _possibleConstructorReturn(this, (Carousel.__proto__ || Object.getPrototypeOf(Carousel)).call(this, Carousel, el, options));
10486
+ var _this62 = _possibleConstructorReturn(this, (Carousel.__proto__ || Object.getPrototypeOf(Carousel)).call(this, Carousel, el, options));
10468
10487
 
10469
- _this61.el.M_Carousel = _this61;
10488
+ _this62.el.M_Carousel = _this62;
10470
10489
 
10471
10490
  /**
10472
10491
  * Options for the carousel
@@ -10481,38 +10500,38 @@ $jscomp.polyfill = function (e, r, p, m) {
10481
10500
  * @prop {Boolean} noWrap
10482
10501
  * @prop {Function} onCycleTo
10483
10502
  */
10484
- _this61.options = $.extend({}, Carousel.defaults, options);
10503
+ _this62.options = $.extend({}, Carousel.defaults, options);
10485
10504
 
10486
10505
  // Setup
10487
- _this61.hasMultipleSlides = _this61.$el.find('.carousel-item').length > 1;
10488
- _this61.showIndicators = _this61.options.indicators && _this61.hasMultipleSlides;
10489
- _this61.noWrap = _this61.options.noWrap || !_this61.hasMultipleSlides;
10490
- _this61.pressed = false;
10491
- _this61.dragged = false;
10492
- _this61.offset = _this61.target = 0;
10493
- _this61.images = [];
10494
- _this61.itemWidth = _this61.$el.find('.carousel-item').first().innerWidth();
10495
- _this61.itemHeight = _this61.$el.find('.carousel-item').first().innerHeight();
10496
- _this61.dim = _this61.itemWidth * 2 + _this61.options.padding || 1; // Make sure dim is non zero for divisions.
10497
- _this61._autoScrollBound = _this61._autoScroll.bind(_this61);
10498
- _this61._trackBound = _this61._track.bind(_this61);
10506
+ _this62.hasMultipleSlides = _this62.$el.find('.carousel-item').length > 1;
10507
+ _this62.showIndicators = _this62.options.indicators && _this62.hasMultipleSlides;
10508
+ _this62.noWrap = _this62.options.noWrap || !_this62.hasMultipleSlides;
10509
+ _this62.pressed = false;
10510
+ _this62.dragged = false;
10511
+ _this62.offset = _this62.target = 0;
10512
+ _this62.images = [];
10513
+ _this62.itemWidth = _this62.$el.find('.carousel-item').first().innerWidth();
10514
+ _this62.itemHeight = _this62.$el.find('.carousel-item').first().innerHeight();
10515
+ _this62.dim = _this62.itemWidth * 2 + _this62.options.padding || 1; // Make sure dim is non zero for divisions.
10516
+ _this62._autoScrollBound = _this62._autoScroll.bind(_this62);
10517
+ _this62._trackBound = _this62._track.bind(_this62);
10499
10518
 
10500
10519
  // Full Width carousel setup
10501
- if (_this61.options.fullWidth) {
10502
- _this61.options.dist = 0;
10503
- _this61._setCarouselHeight();
10520
+ if (_this62.options.fullWidth) {
10521
+ _this62.options.dist = 0;
10522
+ _this62._setCarouselHeight();
10504
10523
 
10505
10524
  // Offset fixed items when indicators.
10506
- if (_this61.showIndicators) {
10507
- _this61.$el.find('.carousel-fixed-item').addClass('with-indicators');
10525
+ if (_this62.showIndicators) {
10526
+ _this62.$el.find('.carousel-fixed-item').addClass('with-indicators');
10508
10527
  }
10509
10528
  }
10510
10529
 
10511
10530
  // Iterate through slides
10512
- _this61.$indicators = $('<ul class="indicators"></ul>');
10513
- _this61.$el.find('.carousel-item').each(function (el, i) {
10514
- _this61.images.push(el);
10515
- if (_this61.showIndicators) {
10531
+ _this62.$indicators = $('<ul class="indicators"></ul>');
10532
+ _this62.$el.find('.carousel-item').each(function (el, i) {
10533
+ _this62.images.push(el);
10534
+ if (_this62.showIndicators) {
10516
10535
  var $indicator = $('<li class="indicator-item"></li>');
10517
10536
 
10518
10537
  // Add active to first by default.
@@ -10520,31 +10539,31 @@ $jscomp.polyfill = function (e, r, p, m) {
10520
10539
  $indicator[0].classList.add('active');
10521
10540
  }
10522
10541
 
10523
- _this61.$indicators.append($indicator);
10542
+ _this62.$indicators.append($indicator);
10524
10543
  }
10525
10544
  });
10526
- if (_this61.showIndicators) {
10527
- _this61.$el.append(_this61.$indicators);
10545
+ if (_this62.showIndicators) {
10546
+ _this62.$el.append(_this62.$indicators);
10528
10547
  }
10529
- _this61.count = _this61.images.length;
10548
+ _this62.count = _this62.images.length;
10530
10549
 
10531
10550
  // Cap numVisible at count
10532
- _this61.options.numVisible = Math.min(_this61.count, _this61.options.numVisible);
10551
+ _this62.options.numVisible = Math.min(_this62.count, _this62.options.numVisible);
10533
10552
 
10534
10553
  // Setup cross browser string
10535
- _this61.xform = 'transform';
10554
+ _this62.xform = 'transform';
10536
10555
  ['webkit', 'Moz', 'O', 'ms'].every(function (prefix) {
10537
10556
  var e = prefix + 'Transform';
10538
10557
  if (typeof document.body.style[e] !== 'undefined') {
10539
- _this61.xform = e;
10558
+ _this62.xform = e;
10540
10559
  return false;
10541
10560
  }
10542
10561
  return true;
10543
10562
  });
10544
10563
 
10545
- _this61._setupEventHandlers();
10546
- _this61._scroll(_this61.offset);
10547
- return _this61;
10564
+ _this62._setupEventHandlers();
10565
+ _this62._scroll(_this62.offset);
10566
+ return _this62;
10548
10567
  }
10549
10568
 
10550
10569
  _createClass(Carousel, [{
@@ -10566,7 +10585,7 @@ $jscomp.polyfill = function (e, r, p, m) {
10566
10585
  }, {
10567
10586
  key: "_setupEventHandlers",
10568
10587
  value: function _setupEventHandlers() {
10569
- var _this62 = this;
10588
+ var _this63 = this;
10570
10589
 
10571
10590
  this._handleCarouselTapBound = this._handleCarouselTap.bind(this);
10572
10591
  this._handleCarouselDragBound = this._handleCarouselDrag.bind(this);
@@ -10588,7 +10607,7 @@ $jscomp.polyfill = function (e, r, p, m) {
10588
10607
  if (this.showIndicators && this.$indicators) {
10589
10608
  this._handleIndicatorClickBound = this._handleIndicatorClick.bind(this);
10590
10609
  this.$indicators.find('.indicator-item').each(function (el, i) {
10591
- el.addEventListener('click', _this62._handleIndicatorClickBound);
10610
+ el.addEventListener('click', _this63._handleIndicatorClickBound);
10592
10611
  });
10593
10612
  }
10594
10613
 
@@ -10606,7 +10625,7 @@ $jscomp.polyfill = function (e, r, p, m) {
10606
10625
  }, {
10607
10626
  key: "_removeEventHandlers",
10608
10627
  value: function _removeEventHandlers() {
10609
- var _this63 = this;
10628
+ var _this64 = this;
10610
10629
 
10611
10630
  if (typeof window.ontouchstart !== 'undefined') {
10612
10631
  this.el.removeEventListener('touchstart', this._handleCarouselTapBound);
@@ -10621,7 +10640,7 @@ $jscomp.polyfill = function (e, r, p, m) {
10621
10640
 
10622
10641
  if (this.showIndicators && this.$indicators) {
10623
10642
  this.$indicators.find('.indicator-item').each(function (el, i) {
10624
- el.removeEventListener('click', _this63._handleIndicatorClickBound);
10643
+ el.removeEventListener('click', _this64._handleIndicatorClickBound);
10625
10644
  });
10626
10645
  }
10627
10646
 
@@ -10807,7 +10826,7 @@ $jscomp.polyfill = function (e, r, p, m) {
10807
10826
  }, {
10808
10827
  key: "_setCarouselHeight",
10809
10828
  value: function _setCarouselHeight(imageOnly) {
10810
- var _this64 = this;
10829
+ var _this65 = this;
10811
10830
 
10812
10831
  var firstSlide = this.$el.find('.carousel-item.active').length ? this.$el.find('.carousel-item.active').first() : this.$el.find('.carousel-item').first();
10813
10832
  var firstImage = firstSlide.find('img').first();
@@ -10827,7 +10846,7 @@ $jscomp.polyfill = function (e, r, p, m) {
10827
10846
  } else {
10828
10847
  // Get height when image is loaded normally
10829
10848
  firstImage.one('load', function (el, i) {
10830
- _this64.$el.css('height', el.offsetHeight + 'px');
10849
+ _this65.$el.css('height', el.offsetHeight + 'px');
10831
10850
  });
10832
10851
  }
10833
10852
  } else if (!imageOnly) {
@@ -10933,7 +10952,7 @@ $jscomp.polyfill = function (e, r, p, m) {
10933
10952
  }, {
10934
10953
  key: "_scroll",
10935
10954
  value: function _scroll(x) {
10936
- var _this65 = this;
10955
+ var _this66 = this;
10937
10956
 
10938
10957
  // Track scrolling state
10939
10958
  if (!this.$el.hasClass('scrolling')) {
@@ -10943,7 +10962,7 @@ $jscomp.polyfill = function (e, r, p, m) {
10943
10962
  window.clearTimeout(this.scrollingTimeout);
10944
10963
  }
10945
10964
  this.scrollingTimeout = window.setTimeout(function () {
10946
- _this65.$el.removeClass('scrolling');
10965
+ _this66.$el.removeClass('scrolling');
10947
10966
  }, this.options.duration);
10948
10967
 
10949
10968
  // Start actual scroll
@@ -11130,7 +11149,7 @@ $jscomp.polyfill = function (e, r, p, m) {
11130
11149
  }
11131
11150
 
11132
11151
  var index = this.center + n;
11133
- if (index > this.count || index < 0) {
11152
+ if (index >= this.count || index < 0) {
11134
11153
  if (this.noWrap) {
11135
11154
  return;
11136
11155
  }
@@ -11153,7 +11172,7 @@ $jscomp.polyfill = function (e, r, p, m) {
11153
11172
  }
11154
11173
 
11155
11174
  var index = this.center - n;
11156
- if (index > this.count || index < 0) {
11175
+ if (index >= this.count || index < 0) {
11157
11176
  if (this.noWrap) {
11158
11177
  return;
11159
11178
  }
@@ -11244,9 +11263,9 @@ $jscomp.polyfill = function (e, r, p, m) {
11244
11263
  function TapTarget(el, options) {
11245
11264
  _classCallCheck(this, TapTarget);
11246
11265
 
11247
- var _this66 = _possibleConstructorReturn(this, (TapTarget.__proto__ || Object.getPrototypeOf(TapTarget)).call(this, TapTarget, el, options));
11266
+ var _this67 = _possibleConstructorReturn(this, (TapTarget.__proto__ || Object.getPrototypeOf(TapTarget)).call(this, TapTarget, el, options));
11248
11267
 
11249
- _this66.el.M_TapTarget = _this66;
11268
+ _this67.el.M_TapTarget = _this67;
11250
11269
 
11251
11270
  /**
11252
11271
  * Options for the select
@@ -11254,17 +11273,17 @@ $jscomp.polyfill = function (e, r, p, m) {
11254
11273
  * @prop {Function} onOpen - Callback function called when feature discovery is opened
11255
11274
  * @prop {Function} onClose - Callback function called when feature discovery is closed
11256
11275
  */
11257
- _this66.options = $.extend({}, TapTarget.defaults, options);
11276
+ _this67.options = $.extend({}, TapTarget.defaults, options);
11258
11277
 
11259
- _this66.isOpen = false;
11278
+ _this67.isOpen = false;
11260
11279
 
11261
11280
  // setup
11262
- _this66.$origin = $('#' + _this66.$el.attr('data-target'));
11263
- _this66._setup();
11281
+ _this67.$origin = $('#' + _this67.$el.attr('data-target'));
11282
+ _this67._setup();
11264
11283
 
11265
- _this66._calculatePositioning();
11266
- _this66._setupEventHandlers();
11267
- return _this66;
11284
+ _this67._calculatePositioning();
11285
+ _this67._setupEventHandlers();
11286
+ return _this67;
11268
11287
  }
11269
11288
 
11270
11289
  _createClass(TapTarget, [{
@@ -11599,30 +11618,30 @@ $jscomp.polyfill = function (e, r, p, m) {
11599
11618
  _classCallCheck(this, FormSelect);
11600
11619
 
11601
11620
  // Don't init if browser default version
11602
- var _this67 = _possibleConstructorReturn(this, (FormSelect.__proto__ || Object.getPrototypeOf(FormSelect)).call(this, FormSelect, el, options));
11621
+ var _this68 = _possibleConstructorReturn(this, (FormSelect.__proto__ || Object.getPrototypeOf(FormSelect)).call(this, FormSelect, el, options));
11603
11622
 
11604
- if (_this67.$el.hasClass('browser-default')) {
11605
- return _possibleConstructorReturn(_this67);
11623
+ if (_this68.$el.hasClass('browser-default')) {
11624
+ return _possibleConstructorReturn(_this68);
11606
11625
  }
11607
11626
 
11608
- _this67.el.M_FormSelect = _this67;
11627
+ _this68.el.M_FormSelect = _this68;
11609
11628
 
11610
11629
  /**
11611
11630
  * Options for the select
11612
11631
  * @member FormSelect#options
11613
11632
  */
11614
- _this67.options = $.extend({}, FormSelect.defaults, options);
11633
+ _this68.options = $.extend({}, FormSelect.defaults, options);
11615
11634
 
11616
- _this67.isMultiple = _this67.$el.prop('multiple');
11635
+ _this68.isMultiple = _this68.$el.prop('multiple');
11617
11636
 
11618
11637
  // Setup
11619
- _this67.el.tabIndex = -1;
11620
- _this67._keysSelected = {};
11621
- _this67._valueDict = {}; // Maps key to original and generated option element.
11622
- _this67._setupDropdown();
11638
+ _this68.el.tabIndex = -1;
11639
+ _this68._keysSelected = {};
11640
+ _this68._valueDict = {}; // Maps key to original and generated option element.
11641
+ _this68._setupDropdown();
11623
11642
 
11624
- _this67._setupEventHandlers();
11625
- return _this67;
11643
+ _this68._setupEventHandlers();
11644
+ return _this68;
11626
11645
  }
11627
11646
 
11628
11647
  _createClass(FormSelect, [{
@@ -11645,14 +11664,14 @@ $jscomp.polyfill = function (e, r, p, m) {
11645
11664
  }, {
11646
11665
  key: "_setupEventHandlers",
11647
11666
  value: function _setupEventHandlers() {
11648
- var _this68 = this;
11667
+ var _this69 = this;
11649
11668
 
11650
11669
  this._handleSelectChangeBound = this._handleSelectChange.bind(this);
11651
11670
  this._handleOptionClickBound = this._handleOptionClick.bind(this);
11652
11671
  this._handleInputClickBound = this._handleInputClick.bind(this);
11653
11672
 
11654
11673
  $(this.dropdownOptions).find('li:not(.optgroup)').each(function (el) {
11655
- el.addEventListener('click', _this68._handleOptionClickBound);
11674
+ el.addEventListener('click', _this69._handleOptionClickBound);
11656
11675
  });
11657
11676
  this.el.addEventListener('change', this._handleSelectChangeBound);
11658
11677
  this.input.addEventListener('click', this._handleInputClickBound);
@@ -11665,10 +11684,10 @@ $jscomp.polyfill = function (e, r, p, m) {
11665
11684
  }, {
11666
11685
  key: "_removeEventHandlers",
11667
11686
  value: function _removeEventHandlers() {
11668
- var _this69 = this;
11687
+ var _this70 = this;
11669
11688
 
11670
11689
  $(this.dropdownOptions).find('li:not(.optgroup)').each(function (el) {
11671
- el.removeEventListener('click', _this69._handleOptionClickBound);
11690
+ el.removeEventListener('click', _this70._handleOptionClickBound);
11672
11691
  });
11673
11692
  this.el.removeEventListener('change', this._handleSelectChangeBound);
11674
11693
  this.input.removeEventListener('click', this._handleInputClickBound);
@@ -11714,8 +11733,12 @@ $jscomp.polyfill = function (e, r, p, m) {
11714
11733
  }
11715
11734
 
11716
11735
  // Set selected on original select option
11717
- $(this._valueDict[key].el).prop('selected', selected);
11718
- this.$el.trigger('change');
11736
+ // Only trigger if selected state changed
11737
+ var prevSelected = $(this._valueDict[key].el).prop('selected');
11738
+ if (prevSelected !== selected) {
11739
+ $(this._valueDict[key].el).prop('selected', selected);
11740
+ this.$el.trigger('change');
11741
+ }
11719
11742
  }
11720
11743
 
11721
11744
  e.stopPropagation();
@@ -11741,7 +11764,7 @@ $jscomp.polyfill = function (e, r, p, m) {
11741
11764
  }, {
11742
11765
  key: "_setupDropdown",
11743
11766
  value: function _setupDropdown() {
11744
- var _this70 = this;
11767
+ var _this71 = this;
11745
11768
 
11746
11769
  this.wrapper = document.createElement('div');
11747
11770
  $(this.wrapper).addClass('select-wrapper ' + this.options.classes);
@@ -11764,21 +11787,21 @@ $jscomp.polyfill = function (e, r, p, m) {
11764
11787
  if ($(el).is('option')) {
11765
11788
  // Direct descendant option.
11766
11789
  var optionEl = void 0;
11767
- if (_this70.isMultiple) {
11768
- optionEl = _this70._appendOptionWithIcon(_this70.$el, el, 'multiple');
11790
+ if (_this71.isMultiple) {
11791
+ optionEl = _this71._appendOptionWithIcon(_this71.$el, el, 'multiple');
11769
11792
  } else {
11770
- optionEl = _this70._appendOptionWithIcon(_this70.$el, el);
11793
+ optionEl = _this71._appendOptionWithIcon(_this71.$el, el);
11771
11794
  }
11772
11795
 
11773
- _this70._addOptionToValueDict(el, optionEl);
11796
+ _this71._addOptionToValueDict(el, optionEl);
11774
11797
  } else if ($(el).is('optgroup')) {
11775
11798
  // Optgroup.
11776
11799
  var selectOptions = $(el).children('option');
11777
- $(_this70.dropdownOptions).append($('<li class="optgroup"><span>' + el.getAttribute('label') + '</span></li>')[0]);
11800
+ $(_this71.dropdownOptions).append($('<li class="optgroup"><span>' + el.getAttribute('label') + '</span></li>')[0]);
11778
11801
 
11779
11802
  selectOptions.each(function (el) {
11780
- var optionEl = _this70._appendOptionWithIcon(_this70.$el, el, 'optgroup-option');
11781
- _this70._addOptionToValueDict(el, optionEl);
11803
+ var optionEl = _this71._appendOptionWithIcon(_this71.$el, el, 'optgroup-option');
11804
+ _this71._addOptionToValueDict(el, optionEl);
11782
11805
  });
11783
11806
  }
11784
11807
  });
@@ -11809,11 +11832,11 @@ $jscomp.polyfill = function (e, r, p, m) {
11809
11832
 
11810
11833
  // Add callback for centering selected option when dropdown content is scrollable
11811
11834
  dropdownOptions.onOpenEnd = function (el) {
11812
- var selectedOption = $(_this70.dropdownOptions).find('.selected').first();
11813
- if (_this70.dropdown.isScrollable && selectedOption.length) {
11814
- var scrollOffset = selectedOption[0].getBoundingClientRect().top - _this70.dropdownOptions.getBoundingClientRect().top; // scroll to selected option
11815
- scrollOffset -= _this70.dropdownOptions.clientHeight / 2; // center in dropdown
11816
- _this70.dropdownOptions.scrollTop = scrollOffset;
11835
+ var selectedOption = $(_this71.dropdownOptions).find('.selected').first();
11836
+ if (_this71.dropdown.isScrollable && selectedOption.length) {
11837
+ var scrollOffset = selectedOption[0].getBoundingClientRect().top - _this71.dropdownOptions.getBoundingClientRect().top; // scroll to selected option
11838
+ scrollOffset -= _this71.dropdownOptions.clientHeight / 2; // center in dropdown
11839
+ _this71.dropdownOptions.scrollTop = scrollOffset;
11817
11840
  }
11818
11841
  };
11819
11842
 
@@ -12057,23 +12080,23 @@ $jscomp.polyfill = function (e, r, p, m) {
12057
12080
  function Range(el, options) {
12058
12081
  _classCallCheck(this, Range);
12059
12082
 
12060
- var _this71 = _possibleConstructorReturn(this, (Range.__proto__ || Object.getPrototypeOf(Range)).call(this, Range, el, options));
12083
+ var _this72 = _possibleConstructorReturn(this, (Range.__proto__ || Object.getPrototypeOf(Range)).call(this, Range, el, options));
12061
12084
 
12062
- _this71.el.M_Range = _this71;
12085
+ _this72.el.M_Range = _this72;
12063
12086
 
12064
12087
  /**
12065
12088
  * Options for the range
12066
12089
  * @member Range#options
12067
12090
  */
12068
- _this71.options = $.extend({}, Range.defaults, options);
12091
+ _this72.options = $.extend({}, Range.defaults, options);
12069
12092
 
12070
- _this71._mousedown = false;
12093
+ _this72._mousedown = false;
12071
12094
 
12072
12095
  // Setup
12073
- _this71._setupThumb();
12096
+ _this72._setupThumb();
12074
12097
 
12075
- _this71._setupEventHandlers();
12076
- return _this71;
12098
+ _this72._setupEventHandlers();
12099
+ return _this72;
12077
12100
  }
12078
12101
 
12079
12102
  _createClass(Range, [{