materialize-sass 1.0.0.alpha3 → 1.0.0.alpha4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/assets/javascripts/materialize.js +289 -184
- data/assets/javascripts/materialize/autocomplete.js +7 -0
- data/assets/javascripts/materialize/buttons.js +1 -1
- data/assets/javascripts/materialize/chips.js +1 -1
- data/assets/javascripts/materialize/component.js +1 -1
- data/assets/javascripts/materialize/datepicker.js +30 -7
- data/assets/javascripts/materialize/dropdown.js +27 -16
- data/assets/javascripts/materialize/extras/nouislider.js +1 -1
- data/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
- data/assets/javascripts/materialize/forms.js +8 -3
- data/assets/javascripts/materialize/global.js +12 -9
- data/assets/javascripts/materialize/materialbox.js +34 -13
- data/assets/javascripts/materialize/modal.js +16 -10
- data/assets/javascripts/materialize/parallax.js +6 -5
- data/assets/javascripts/materialize/select.js +26 -19
- data/assets/javascripts/materialize/sidenav.js +17 -3
- data/assets/javascripts/materialize/timepicker.js +19 -12
- data/assets/stylesheets/materialize/components/_badges.scss +8 -0
- data/assets/stylesheets/materialize/components/_buttons.scss +35 -37
- data/assets/stylesheets/materialize/components/_datepicker.scss +2 -2
- data/assets/stylesheets/materialize/components/_dropdown.scss +3 -1
- data/assets/stylesheets/materialize/components/_global.scss +11 -1
- data/assets/stylesheets/materialize/components/_sidenav.scss +1 -1
- data/assets/stylesheets/materialize/components/_timepicker.scss +2 -2
- data/assets/stylesheets/materialize/components/_variables.scss +11 -3
- data/assets/stylesheets/materialize/components/forms/_input-fields.scss +4 -3
- data/assets/stylesheets/materialize/components/forms/_select.scss +3 -2
- data/assets/stylesheets/materialize/extras/nouislider.css +1 -1
- data/lib/materialize-sass/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d663fb262bda28a9d3a301ff8b967e730b79d54befd25c33ee449c914a5209c5
|
4
|
+
data.tar.gz: 46a85c9259899296f1d0a55ee55cce924ebe3488b467b61e1ba677abbc481cde
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5f9201a2252c0d1be8a9c886f64219ea53594a9c26c03bc542bb979c4108c9775794c6a8a4280d052faea073ff7c1c9d5a9a9a5a352afa5f183213dc3386e7ed
|
7
|
+
data.tar.gz: 661af14ace10a0779f7acdc0ed2c85e47e90d4713092aeaa837c80d9a9b9c5c37242940fab83234609b6a2277423c4c1f01f34031eee9c0ade6e2c745e32b643
|
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.
|
10
|
+
This master branch now v1.0.0.alpha4
|
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'
|
19
|
+
gem 'materialize-sass', '~> 1.0.0.alpha4'
|
20
20
|
```
|
21
21
|
|
22
22
|
|
@@ -74,7 +74,7 @@ Require Materialize javascripts in `app/assets/javascripts/application.js`:
|
|
74
74
|
|
75
75
|
or
|
76
76
|
|
77
|
-
Require materialize-sprockets to
|
77
|
+
Require materialize-sprockets to provide individual Materialize components for ease of debugging
|
78
78
|
|
79
79
|
```js
|
80
80
|
//= require materialize-sprockets
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*!
|
2
|
-
* Materialize v1.0.0-alpha.
|
2
|
+
* Materialize v1.0.0-alpha.4 (http://materializecss.com)
|
3
3
|
* Copyright 2014-2017 Materialize
|
4
4
|
* MIT License (https://raw.githubusercontent.com/Dogfalo/materialize/master/LICENSE)
|
5
5
|
*/
|
@@ -1043,7 +1043,7 @@ var Component = function () {
|
|
1043
1043
|
var instances = null;
|
1044
1044
|
if (els instanceof Element) {
|
1045
1045
|
instances = new classDef(els, options);
|
1046
|
-
} else if (!!els.jquery || els instanceof NodeList) {
|
1046
|
+
} else if (!!els && (els.jquery || els.cash || els instanceof NodeList)) {
|
1047
1047
|
var instancesArr = [];
|
1048
1048
|
for (var i = 0; i < els.length; i++) {
|
1049
1049
|
instancesArr.push(new classDef(els[i], options));
|
@@ -1172,7 +1172,7 @@ M.guid = function () {
|
|
1172
1172
|
* @returns {string}
|
1173
1173
|
*/
|
1174
1174
|
M.escapeHash = function (hash) {
|
1175
|
-
return hash.replace(/(:|\.|\[|\]
|
1175
|
+
return hash.replace(/(:|\.|\[|\]|,|=|\/)/g, "\\$1");
|
1176
1176
|
};
|
1177
1177
|
|
1178
1178
|
M.elementOrParentIsFixed = function (element) {
|
@@ -1261,35 +1261,38 @@ M.checkPossibleAlignments = function (el, container, bounding, offset) {
|
|
1261
1261
|
|
1262
1262
|
var containerAllowsOverflow = getComputedStyle(container).overflow === 'visible';
|
1263
1263
|
var containerRect = container.getBoundingClientRect();
|
1264
|
+
var containerHeight = Math.min(containerRect.height, window.innerHeight);
|
1265
|
+
var containerWidth = Math.min(containerRect.width, window.innerWidth);
|
1264
1266
|
var elOffsetRect = el.getBoundingClientRect();
|
1265
1267
|
|
1266
1268
|
var scrollLeft = container.scrollLeft;
|
1267
1269
|
var scrollTop = container.scrollTop;
|
1268
1270
|
|
1269
1271
|
var scrolledX = bounding.left - scrollLeft;
|
1270
|
-
var
|
1272
|
+
var scrolledYTopEdge = bounding.top - scrollTop;
|
1273
|
+
var scrolledYBottomEdge = bounding.top + elOffsetRect.height - scrollTop;
|
1271
1274
|
|
1272
1275
|
// Check for container and viewport for left
|
1273
|
-
canAlign.spaceOnRight = !containerAllowsOverflow ?
|
1274
|
-
if (
|
1276
|
+
canAlign.spaceOnRight = !containerAllowsOverflow ? containerWidth - (scrolledX + bounding.width) : window.innerWidth - (elOffsetRect.left + bounding.width);
|
1277
|
+
if (canAlign.spaceOnRight < 0) {
|
1275
1278
|
canAlign.left = false;
|
1276
1279
|
}
|
1277
1280
|
|
1278
1281
|
// Check for container and viewport for Right
|
1279
1282
|
canAlign.spaceOnLeft = !containerAllowsOverflow ? scrolledX - bounding.width + elOffsetRect.width : elOffsetRect.right - bounding.width;
|
1280
|
-
if (
|
1283
|
+
if (canAlign.spaceOnLeft < 0) {
|
1281
1284
|
canAlign.right = false;
|
1282
1285
|
}
|
1283
1286
|
|
1284
1287
|
// Check for container and viewport for Top
|
1285
|
-
canAlign.spaceOnBottom = !containerAllowsOverflow ?
|
1286
|
-
if (
|
1288
|
+
canAlign.spaceOnBottom = !containerAllowsOverflow ? containerHeight - (scrolledYTopEdge + bounding.height + offset) : window.innerHeight - (elOffsetRect.top + bounding.height + offset);
|
1289
|
+
if (canAlign.spaceOnBottom < 0) {
|
1287
1290
|
canAlign.top = false;
|
1288
1291
|
}
|
1289
1292
|
|
1290
1293
|
// Check for container and viewport for Bottom
|
1291
|
-
canAlign.spaceOnTop = !containerAllowsOverflow ?
|
1292
|
-
if (
|
1294
|
+
canAlign.spaceOnTop = !containerAllowsOverflow ? scrolledYBottomEdge - (bounding.height - offset) : elOffsetRect.bottom - (bounding.height + offset);
|
1295
|
+
if (canAlign.spaceOnTop < 0) {
|
1293
1296
|
canAlign.bottom = false;
|
1294
1297
|
}
|
1295
1298
|
|
@@ -2135,6 +2138,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
2135
2138
|
var _defaults = {
|
2136
2139
|
alignment: 'left',
|
2137
2140
|
constrainWidth: true,
|
2141
|
+
container: null,
|
2138
2142
|
coverTrigger: true,
|
2139
2143
|
closeOnClick: true,
|
2140
2144
|
hover: false,
|
@@ -2168,10 +2172,18 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
2168
2172
|
/**
|
2169
2173
|
* Options for the dropdown
|
2170
2174
|
* @member Dropdown#options
|
2171
|
-
* @prop {
|
2172
|
-
* @prop {
|
2173
|
-
* @prop {
|
2174
|
-
* @prop {
|
2175
|
+
* @prop {String} [alignment='left'] - Edge which the dropdown is aligned to
|
2176
|
+
* @prop {Boolean} [constrainWidth=true] - Constrain width to width of the button
|
2177
|
+
* @prop {Element} container - Container element to attach dropdown to (optional)
|
2178
|
+
* @prop {Boolean} [coverTrigger=true] - Place dropdown over trigger
|
2179
|
+
* @prop {Boolean} [closeOnClick=true] - Close on click of dropdown item
|
2180
|
+
* @prop {Boolean} [hover=false] - Open dropdown on hover
|
2181
|
+
* @prop {Number} [inDuration=150] - Duration of open animation in ms
|
2182
|
+
* @prop {Number} [outDuration=250] - Duration of close animation in ms
|
2183
|
+
* @prop {Function} onOpenStart - Function called when dropdown starts opening
|
2184
|
+
* @prop {Function} onOpenEnd - Function called when dropdown finishes opening
|
2185
|
+
* @prop {Function} onCloseStart - Function called when dropdown starts closing
|
2186
|
+
* @prop {Function} onCloseEnd - Function called when dropdown finishes closing
|
2175
2187
|
*/
|
2176
2188
|
_this7.options = $.extend({}, Dropdown.defaults, options);
|
2177
2189
|
|
@@ -2185,7 +2197,11 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
2185
2197
|
_this7.filterQuery = [];
|
2186
2198
|
|
2187
2199
|
// Move dropdown-content after dropdown-trigger
|
2188
|
-
|
2200
|
+
if (!!_this7.options.container) {
|
2201
|
+
$(_this7.options.container).append(_this7.dropdownEl);
|
2202
|
+
} else {
|
2203
|
+
_this7.$el.after(_this7.dropdownEl);
|
2204
|
+
}
|
2189
2205
|
|
2190
2206
|
_this7._makeDropdownFocusable();
|
2191
2207
|
_this7._resetFilterQueryBound = _this7._resetFilterQuery.bind(_this7);
|
@@ -2258,6 +2274,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
2258
2274
|
value: function _setupTemporaryEventHandlers() {
|
2259
2275
|
// Use capture phase event handler to prevent click
|
2260
2276
|
document.body.addEventListener('click', this._handleDocumentClickBound, true);
|
2277
|
+
document.body.addEventListener('touchend', this._handleDocumentClickBound);
|
2261
2278
|
this.dropdownEl.addEventListener('keydown', this._handleDropdownKeydownBound);
|
2262
2279
|
}
|
2263
2280
|
}, {
|
@@ -2265,6 +2282,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
2265
2282
|
value: function _removeTemporaryEventHandlers() {
|
2266
2283
|
// Use capture phase event handler to prevent click
|
2267
2284
|
document.body.removeEventListener('click', this._handleDocumentClickBound, true);
|
2285
|
+
document.body.removeEventListener('touchend', this._handleDocumentClickBound);
|
2268
2286
|
this.dropdownEl.removeEventListener('keydown', this._handleDropdownKeydownBound);
|
2269
2287
|
}
|
2270
2288
|
}, {
|
@@ -2305,11 +2323,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
2305
2323
|
setTimeout(function () {
|
2306
2324
|
_this8.close();
|
2307
2325
|
}, 0);
|
2308
|
-
} else if ($target.closest('.dropdown-trigger').length) {
|
2309
|
-
setTimeout(function () {
|
2310
|
-
_this8.close();
|
2311
|
-
}, 0);
|
2312
|
-
} else if (!$target.closest('.dropdown-content').length) {
|
2326
|
+
} else if ($target.closest('.dropdown-trigger').length || !$target.closest('.dropdown-content').length) {
|
2313
2327
|
setTimeout(function () {
|
2314
2328
|
_this8.close();
|
2315
2329
|
}, 0);
|
@@ -2422,15 +2436,13 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
2422
2436
|
key: "_getDropdownPosition",
|
2423
2437
|
value: function _getDropdownPosition() {
|
2424
2438
|
var offsetParentBRect = this.el.offsetParent.getBoundingClientRect();
|
2425
|
-
var triggerOffset = { left: this.el.offsetLeft, top: this.el.offsetTop, width: this.el.offsetWidth, height: this.el.offsetHeight };
|
2426
|
-
var dropdownOffset = { left: this.dropdownEl.offsetLeft, top: this.dropdownEl.offsetTop, width: this.dropdownEl.offsetWidth, height: this.dropdownEl.offsetHeight };
|
2427
2439
|
var triggerBRect = this.el.getBoundingClientRect();
|
2428
2440
|
var dropdownBRect = this.dropdownEl.getBoundingClientRect();
|
2429
2441
|
|
2430
2442
|
var idealHeight = dropdownBRect.height;
|
2431
2443
|
var idealWidth = dropdownBRect.width;
|
2432
|
-
var idealXPos =
|
2433
|
-
var idealYPos =
|
2444
|
+
var idealXPos = triggerBRect.left - dropdownBRect.left;
|
2445
|
+
var idealYPos = triggerBRect.top - dropdownBRect.top;
|
2434
2446
|
|
2435
2447
|
var dropdownBounds = {
|
2436
2448
|
left: idealXPos,
|
@@ -2485,12 +2497,14 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
2485
2497
|
if (horizontalAlignment === 'right') {
|
2486
2498
|
idealXPos = idealXPos - dropdownBRect.width + triggerBRect.width;
|
2487
2499
|
}
|
2488
|
-
return {
|
2500
|
+
return {
|
2501
|
+
x: idealXPos,
|
2489
2502
|
y: idealYPos,
|
2490
2503
|
verticalAlignment: verticalAlignment,
|
2491
2504
|
horizontalAlignment: horizontalAlignment,
|
2492
2505
|
height: idealHeight,
|
2493
|
-
width: idealWidth
|
2506
|
+
width: idealWidth
|
2507
|
+
};
|
2494
2508
|
}
|
2495
2509
|
|
2496
2510
|
/**
|
@@ -2719,10 +2733,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
2719
2733
|
_this11._openingTrigger = undefined;
|
2720
2734
|
_this11.$overlay = $('<div class="modal-overlay"></div>');
|
2721
2735
|
|
2722
|
-
Modal._increment++;
|
2723
2736
|
Modal._count++;
|
2724
|
-
_this11.$overlay[0].style.zIndex = 1000 + Modal._increment * 2;
|
2725
|
-
_this11.el.style.zIndex = 1000 + Modal._increment * 2 + 1;
|
2726
2737
|
_this11._setupEventHandlers();
|
2727
2738
|
return _this11;
|
2728
2739
|
}
|
@@ -2959,20 +2970,24 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
2959
2970
|
}
|
2960
2971
|
|
2961
2972
|
this.isOpen = true;
|
2973
|
+
Modal._modalsOpen++;
|
2974
|
+
|
2975
|
+
// Set Z-Index based on number of currently open modals
|
2976
|
+
this.$overlay[0].style.zIndex = 1000 + Modal._modalsOpen * 2;
|
2977
|
+
this.el.style.zIndex = 1000 + Modal._modalsOpen * 2 + 1;
|
2978
|
+
|
2979
|
+
// Set opening trigger, undefined indicates modal was opened by javascript
|
2980
|
+
this._openingTrigger = !!$trigger ? $trigger[0] : undefined;
|
2962
2981
|
|
2963
2982
|
// onOpenStart callback
|
2964
2983
|
if (typeof this.options.onOpenStart === 'function') {
|
2965
2984
|
this.options.onOpenStart.call(this, this.el, this._openingTrigger);
|
2966
2985
|
}
|
2967
2986
|
|
2968
|
-
|
2969
|
-
body.style.overflow = 'hidden';
|
2987
|
+
document.body.style.overflow = 'hidden';
|
2970
2988
|
this.el.classList.add('open');
|
2971
2989
|
this.el.insertAdjacentElement('afterend', this.$overlay[0]);
|
2972
2990
|
|
2973
|
-
// Set opening trigger, undefined indicates modal was opened by javascript
|
2974
|
-
this._openingTrigger = !!$trigger ? $trigger[0] : undefined;
|
2975
|
-
|
2976
2991
|
if (this.options.dismissible) {
|
2977
2992
|
this._handleKeydownBound = this._handleKeydown.bind(this);
|
2978
2993
|
document.addEventListener('keydown', this._handleKeydownBound);
|
@@ -2996,6 +3011,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
2996
3011
|
}
|
2997
3012
|
|
2998
3013
|
this.isOpen = false;
|
3014
|
+
Modal._modalsOpen--;
|
2999
3015
|
|
3000
3016
|
// Call onCloseStart callback
|
3001
3017
|
if (typeof this.options.onCloseStart === 'function') {
|
@@ -3003,7 +3019,11 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
3003
3019
|
}
|
3004
3020
|
|
3005
3021
|
this.el.classList.remove('open');
|
3006
|
-
|
3022
|
+
|
3023
|
+
// Enable body scrolling only if there are no more modals open.
|
3024
|
+
if (Modal._modalsOpen === 0) {
|
3025
|
+
document.body.style.overflow = '';
|
3026
|
+
}
|
3007
3027
|
|
3008
3028
|
if (this.options.dismissible) {
|
3009
3029
|
document.removeEventListener('keydown', this._handleKeydownBound);
|
@@ -3046,7 +3066,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
3046
3066
|
*/
|
3047
3067
|
|
3048
3068
|
|
3049
|
-
Modal.
|
3069
|
+
Modal._modalsOpen = 0;
|
3050
3070
|
|
3051
3071
|
/**
|
3052
3072
|
* @static
|
@@ -3149,8 +3169,8 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
3149
3169
|
*/
|
3150
3170
|
|
3151
3171
|
}, {
|
3152
|
-
key: "
|
3153
|
-
value: function
|
3172
|
+
key: "_removeEventHandlers",
|
3173
|
+
value: function _removeEventHandlers() {
|
3154
3174
|
this.el.removeEventListener('click', this._handleMaterialboxClickBound);
|
3155
3175
|
}
|
3156
3176
|
|
@@ -3242,8 +3262,8 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
3242
3262
|
|
3243
3263
|
var animOptions = {
|
3244
3264
|
targets: this.el,
|
3245
|
-
height: this.newHeight,
|
3246
|
-
width: this.newWidth,
|
3265
|
+
height: [this.originalHeight, this.newHeight],
|
3266
|
+
width: [this.originalWidth, this.newWidth],
|
3247
3267
|
left: M.getDocumentScrollLeft() + this.windowWidth / 2 - this.placeholder.offset().left - this.newWidth / 2,
|
3248
3268
|
top: M.getDocumentScrollTop() + this.windowHeight / 2 - this.placeholder.offset().top - this.newHeight / 2,
|
3249
3269
|
duration: this.options.inDuration,
|
@@ -3258,12 +3278,14 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
3258
3278
|
}
|
3259
3279
|
};
|
3260
3280
|
|
3261
|
-
|
3281
|
+
// Override max-width or max-height if needed
|
3282
|
+
this.maxWidth = this.$el.css('max-width');
|
3283
|
+
this.maxHeight = this.$el.css('max-height');
|
3284
|
+
if (this.maxWidth !== 'none') {
|
3262
3285
|
animOptions.maxWidth = this.newWidth;
|
3263
|
-
|
3264
|
-
|
3265
|
-
animOptions.
|
3266
|
-
animOptions.top = [animOptions.top, 0];
|
3286
|
+
}
|
3287
|
+
if (this.maxHeight !== 'none') {
|
3288
|
+
animOptions.maxHeight = this.newHeight;
|
3267
3289
|
}
|
3268
3290
|
|
3269
3291
|
anim(animOptions);
|
@@ -3295,6 +3317,14 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
3295
3317
|
left: ''
|
3296
3318
|
});
|
3297
3319
|
|
3320
|
+
// Revert to width or height attribute
|
3321
|
+
if (_this16.attrWidth) {
|
3322
|
+
_this16.$el.attr('width', _this16.attrWidth);
|
3323
|
+
}
|
3324
|
+
if (_this16.attrHeight) {
|
3325
|
+
_this16.$el.attr('height', _this16.attrHeight);
|
3326
|
+
}
|
3327
|
+
|
3298
3328
|
_this16.$el.removeAttr('style');
|
3299
3329
|
_this16.$el.attr('style', _this16.originInlineStyles);
|
3300
3330
|
|
@@ -3370,6 +3400,18 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
3370
3400
|
'will-change': 'left, top, width, height'
|
3371
3401
|
});
|
3372
3402
|
|
3403
|
+
// Change from width or height attribute to css
|
3404
|
+
this.attrWidth = this.$el.attr('width');
|
3405
|
+
this.attrHeight = this.$el.attr('height');
|
3406
|
+
if (this.attrWidth) {
|
3407
|
+
this.$el.css('width', this.attrWidth + 'px');
|
3408
|
+
this.$el.removeAttr('width');
|
3409
|
+
}
|
3410
|
+
if (this.attrHeight) {
|
3411
|
+
this.$el.css('width', this.attrHeight + 'px');
|
3412
|
+
this.$el.removeAttr('height');
|
3413
|
+
}
|
3414
|
+
|
3373
3415
|
// Add overlay
|
3374
3416
|
this.$overlay = $('<div id="materialbox-overlay"></div>').css({
|
3375
3417
|
opacity: 0
|
@@ -3394,10 +3436,6 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
3394
3436
|
anim.remove(this.el);
|
3395
3437
|
anim.remove(this.$overlay[0]);
|
3396
3438
|
|
3397
|
-
if (this.caption !== "") {
|
3398
|
-
anim.remove(this.$photoCaption[0]);
|
3399
|
-
}
|
3400
|
-
|
3401
3439
|
// Animate Overlay
|
3402
3440
|
anim({
|
3403
3441
|
targets: this.$overlay[0],
|
@@ -3408,6 +3446,9 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
3408
3446
|
|
3409
3447
|
// Add and animate caption if it exists
|
3410
3448
|
if (this.caption !== "") {
|
3449
|
+
if (this.$photocaption) {
|
3450
|
+
anim.remove(this.$photoCaption[0]);
|
3451
|
+
}
|
3411
3452
|
this.$photoCaption = $('<div class="materialbox-caption"></div>');
|
3412
3453
|
this.$photoCaption.text(this.caption);
|
3413
3454
|
$('body').append(this.$photoCaption);
|
@@ -3560,9 +3601,14 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
3560
3601
|
* @prop {Number} responsiveThreshold
|
3561
3602
|
*/
|
3562
3603
|
_this19.options = $.extend({}, Parallax.defaults, options);
|
3604
|
+
_this19._enabled = window.innerWidth > _this19.options.responsiveThreshold;
|
3563
3605
|
|
3564
3606
|
_this19.$img = _this19.$el.find('img').first();
|
3565
|
-
_this19.
|
3607
|
+
_this19.$img.each(function () {
|
3608
|
+
var el = this;
|
3609
|
+
if (el.complete) $(el).trigger("load");
|
3610
|
+
});
|
3611
|
+
|
3566
3612
|
_this19._updateParallax();
|
3567
3613
|
_this19._setupEventHandlers();
|
3568
3614
|
_this19._setupStyles();
|
@@ -3618,10 +3664,6 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
3618
3664
|
key: "_handleImageLoad",
|
3619
3665
|
value: function _handleImageLoad() {
|
3620
3666
|
this._updateParallax();
|
3621
|
-
this.$img.each(function () {
|
3622
|
-
var el = this;
|
3623
|
-
if (el.complete) $(el).trigger("load");
|
3624
|
-
});
|
3625
3667
|
}
|
3626
3668
|
}, {
|
3627
3669
|
key: "_updateParallax",
|
@@ -5371,6 +5413,11 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
5371
5413
|
}, {
|
5372
5414
|
key: "_handleDragTargetDrag",
|
5373
5415
|
value: function _handleDragTargetDrag(e) {
|
5416
|
+
// Check if draggable
|
5417
|
+
if (!this.options.draggable || this._isCurrentlyFixed()) {
|
5418
|
+
return;
|
5419
|
+
}
|
5420
|
+
|
5374
5421
|
// If not being dragged, set initial drag start variables
|
5375
5422
|
if (!this.isDragged) {
|
5376
5423
|
this._startDrag(e);
|
@@ -5438,6 +5485,10 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
5438
5485
|
key: "_handleCloseDrag",
|
5439
5486
|
value: function _handleCloseDrag(e) {
|
5440
5487
|
if (this.isOpen) {
|
5488
|
+
// Check if draggable
|
5489
|
+
if (!this.options.draggable || this._isCurrentlyFixed()) {
|
5490
|
+
return;
|
5491
|
+
}
|
5441
5492
|
|
5442
5493
|
// If not being dragged, set initial drag start variables
|
5443
5494
|
if (!this.isDragged) {
|
@@ -5534,10 +5585,15 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
5534
5585
|
}, {
|
5535
5586
|
key: "_setupFixed",
|
5536
5587
|
value: function _setupFixed() {
|
5537
|
-
if (this.
|
5588
|
+
if (this._isCurrentlyFixed()) {
|
5538
5589
|
this.open();
|
5539
5590
|
}
|
5540
5591
|
}
|
5592
|
+
}, {
|
5593
|
+
key: "_isCurrentlyFixed",
|
5594
|
+
value: function _isCurrentlyFixed() {
|
5595
|
+
return this.isFixed && window.innerWidth > 992;
|
5596
|
+
}
|
5541
5597
|
}, {
|
5542
5598
|
key: "_createDragTarget",
|
5543
5599
|
value: function _createDragTarget() {
|
@@ -5573,7 +5629,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
5573
5629
|
}
|
5574
5630
|
|
5575
5631
|
// Handle fixed Sidenav
|
5576
|
-
if (this.
|
5632
|
+
if (this._isCurrentlyFixed()) {
|
5577
5633
|
anim.remove(this.el);
|
5578
5634
|
anim({
|
5579
5635
|
targets: this.el,
|
@@ -5608,7 +5664,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
5608
5664
|
}
|
5609
5665
|
|
5610
5666
|
// Handle fixed Sidenav
|
5611
|
-
if (this.
|
5667
|
+
if (this._isCurrentlyFixed()) {
|
5612
5668
|
var transformX = this.options.edge === 'left' ? '-105%' : '105%';
|
5613
5669
|
this.el.style.transform = "translateX(" + transformX + ")";
|
5614
5670
|
|
@@ -6358,6 +6414,9 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
6358
6414
|
$(this.container).empty();
|
6359
6415
|
this._resetCurrentElement();
|
6360
6416
|
this.oldVal = null;
|
6417
|
+
$(this.container).css({
|
6418
|
+
display: ''
|
6419
|
+
});
|
6361
6420
|
this.isOpen = false;
|
6362
6421
|
}
|
6363
6422
|
|
@@ -6419,6 +6478,10 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
6419
6478
|
};
|
6420
6479
|
matchingData.sort(sortFunctionBound);
|
6421
6480
|
|
6481
|
+
$(this.container).css({
|
6482
|
+
display: 'block'
|
6483
|
+
});
|
6484
|
+
|
6422
6485
|
// Render
|
6423
6486
|
for (var i = 0; i < matchingData.length; i++) {
|
6424
6487
|
var _entry = matchingData[i];
|
@@ -6535,6 +6598,11 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
6535
6598
|
$textarea = $($textarea);
|
6536
6599
|
}
|
6537
6600
|
|
6601
|
+
if (!$textarea.length) {
|
6602
|
+
console.error("No textarea element found");
|
6603
|
+
return;
|
6604
|
+
}
|
6605
|
+
|
6538
6606
|
// Textarea Auto Resize
|
6539
6607
|
var hiddenDiv = $('.hiddendiv').first();
|
6540
6608
|
if (!hiddenDiv.length) {
|
@@ -6591,10 +6659,10 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
6591
6659
|
// When textarea is hidden, width goes crazy.
|
6592
6660
|
// Approximate with half of window size
|
6593
6661
|
|
6594
|
-
if ($textarea.
|
6662
|
+
if ($textarea[0].offsetWidth > 0 && $textarea[0].offsetHeight > 0) {
|
6595
6663
|
hiddenDiv.css('width', $textarea.width() + 'px');
|
6596
6664
|
} else {
|
6597
|
-
hiddenDiv.css('width',
|
6665
|
+
hiddenDiv.css('width', window.innerWidth / 2 + 'px');
|
6598
6666
|
}
|
6599
6667
|
|
6600
6668
|
/**
|
@@ -6646,7 +6714,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
6646
6714
|
setTimeout(function () {
|
6647
6715
|
formReset.find('select').each(function () {
|
6648
6716
|
// check if initialized
|
6649
|
-
if (this.
|
6717
|
+
if (this.M_FormSelect) {
|
6650
6718
|
var reset_text = $(this).find('option[selected]').text();
|
6651
6719
|
$(this).siblings('input.select-dropdown')[0].value = reset_text;
|
6652
6720
|
}
|
@@ -7463,7 +7531,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
7463
7531
|
_this43.$input[0].focus();
|
7464
7532
|
};
|
7465
7533
|
|
7466
|
-
this.autocomplete = M.Autocomplete.init(this.$input, this.options.autocompleteOptions)
|
7534
|
+
this.autocomplete = M.Autocomplete.init(this.$input[0], this.options.autocompleteOptions);
|
7467
7535
|
}
|
7468
7536
|
|
7469
7537
|
/**
|
@@ -8207,7 +8275,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
8207
8275
|
var windowWidth = window.innerWidth;
|
8208
8276
|
var windowHeight = window.innerHeight;
|
8209
8277
|
var backdrop = this.$el.find('.fab-backdrop');
|
8210
|
-
var fabColor = anchor.css('background-color');
|
8278
|
+
var fabColor = this.$anchor.css('background-color');
|
8211
8279
|
|
8212
8280
|
this.offsetX = this.btnLeft - windowWidth / 2 + this.btnWidth / 2;
|
8213
8281
|
this.offsetY = windowHeight - this.btnBottom;
|
@@ -8352,8 +8420,8 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
8352
8420
|
nextMonth: '›',
|
8353
8421
|
months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
|
8354
8422
|
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
|
8355
|
-
weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
8356
8423
|
weekdays: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'],
|
8424
|
+
weekdaysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
8357
8425
|
weekdaysAbbrev: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
|
8358
8426
|
},
|
8359
8427
|
|
@@ -8390,6 +8458,11 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
8390
8458
|
|
8391
8459
|
_this50.options = $.extend({}, Datepicker.defaults, options);
|
8392
8460
|
|
8461
|
+
// make sure i18n defaults are not lost when only few i18n option properties are passed
|
8462
|
+
if (!!options && options.hasOwnProperty('i18n') && typeof options.i18n === 'object') {
|
8463
|
+
_this50.options.i18n = $.extend({}, Datepicker.defaults.i18n, options.i18n);
|
8464
|
+
}
|
8465
|
+
|
8393
8466
|
// Remove time component from minDate and maxDate options
|
8394
8467
|
if (_this50.options.minDate) _this50.options.minDate.setHours(0, 0, 0, 0);
|
8395
8468
|
if (_this50.options.maxDate) _this50.options.maxDate.setHours(0, 0, 0, 0);
|
@@ -8857,13 +8930,23 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
8857
8930
|
html += this.renderTitle(this, c, this.calendars[c].year, this.calendars[c].month, this.calendars[0].year, randId) + this.render(this.calendars[c].year, this.calendars[c].month, randId);
|
8858
8931
|
}
|
8859
8932
|
|
8933
|
+
// Destroy Materialize Select
|
8934
|
+
var oldYearSelect = this.calendarEl.querySelector('.pika-select-year');
|
8935
|
+
if (oldYearSelect) {
|
8936
|
+
M.FormSelect.getInstance(oldYearSelect).destroy();
|
8937
|
+
}
|
8938
|
+
var oldMonthSelect = this.calendarEl.querySelector('.pika-select-month');
|
8939
|
+
if (oldMonthSelect) {
|
8940
|
+
M.FormSelect.getInstance(oldMonthSelect).destroy();
|
8941
|
+
}
|
8942
|
+
|
8860
8943
|
this.calendarEl.innerHTML = html;
|
8861
8944
|
|
8862
8945
|
// Init Materialize Select
|
8863
8946
|
var yearSelect = this.calendarEl.querySelector('.pika-select-year');
|
8864
8947
|
var monthSelect = this.calendarEl.querySelector('.pika-select-month');
|
8865
|
-
M.
|
8866
|
-
M.
|
8948
|
+
M.FormSelect.init(yearSelect, { classes: 'select-year', dropdownOptions: { container: document.body, constrainWidth: false } });
|
8949
|
+
M.FormSelect.init(monthSelect, { classes: 'select-month', dropdownOptions: { container: document.body, constrainWidth: false } });
|
8867
8950
|
|
8868
8951
|
// Add change handlers for select
|
8869
8952
|
yearSelect.addEventListener('change', this._handleYearChange.bind(this));
|
@@ -8916,26 +8999,34 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
8916
8999
|
|
8917
9000
|
this.formats = {
|
8918
9001
|
|
8919
|
-
|
9002
|
+
d: function () {
|
8920
9003
|
return _this53.date.getDate();
|
8921
9004
|
},
|
9005
|
+
dd: function () {
|
9006
|
+
var d = _this53.date.getDate();
|
9007
|
+
return (d < 10 ? '0' : '') + d;
|
9008
|
+
},
|
8922
9009
|
ddd: function () {
|
8923
9010
|
return _this53.options.i18n.weekdaysShort[_this53.date.getDay()];
|
8924
9011
|
},
|
8925
9012
|
dddd: function () {
|
8926
9013
|
return _this53.options.i18n.weekdays[_this53.date.getDay()];
|
8927
9014
|
},
|
8928
|
-
|
9015
|
+
m: function () {
|
8929
9016
|
return _this53.date.getMonth() + 1;
|
8930
9017
|
},
|
9018
|
+
mm: function () {
|
9019
|
+
var m = _this53.date.getMonth() + 1;
|
9020
|
+
return (m < 10 ? '0' : '') + m;
|
9021
|
+
},
|
8931
9022
|
mmm: function () {
|
8932
9023
|
return _this53.options.i18n.monthsShort[_this53.date.getMonth()];
|
8933
9024
|
},
|
8934
9025
|
mmmm: function () {
|
8935
|
-
return _this53.options.i18n.
|
9026
|
+
return _this53.options.i18n.months[_this53.date.getMonth()];
|
8936
9027
|
},
|
8937
9028
|
yy: function () {
|
8938
|
-
return _this53.date.getFullYear().slice(2);
|
9029
|
+
return ('' + _this53.date.getFullYear()).slice(2);
|
8939
9030
|
},
|
8940
9031
|
yyyy: function () {
|
8941
9032
|
return _this53.date.getFullYear();
|
@@ -9213,9 +9304,14 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
9213
9304
|
container: null,
|
9214
9305
|
defaultTime: 'now', // default time, 'now' or '13:14' e.g.
|
9215
9306
|
fromnow: 0, // Millisecond offset from the defaultTime
|
9216
|
-
|
9217
|
-
|
9218
|
-
|
9307
|
+
|
9308
|
+
// internationalization
|
9309
|
+
i18n: {
|
9310
|
+
done: 'Ok',
|
9311
|
+
clear: 'Clear',
|
9312
|
+
cancel: 'Cancel'
|
9313
|
+
},
|
9314
|
+
|
9219
9315
|
autoClose: false, // auto close when minute is selected
|
9220
9316
|
twelveHour: true, // change to 12 hour AM/PM clock from 24 hour
|
9221
9317
|
vibrate: true // vibrate the device when dragging clock hand
|
@@ -9341,6 +9437,8 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
9341
9437
|
}, {
|
9342
9438
|
key: "_handleDocumentClickEnd",
|
9343
9439
|
value: function _handleDocumentClickEnd(e) {
|
9440
|
+
var _this55 = this;
|
9441
|
+
|
9344
9442
|
e.preventDefault();
|
9345
9443
|
document.removeEventListener('mouseup', this._handleDocumentClickEndBound);
|
9346
9444
|
document.removeEventListener('touchend', this._handleDocumentClickEndBound);
|
@@ -9354,9 +9452,9 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
9354
9452
|
if (this.currentView === 'hours') {
|
9355
9453
|
this.showView('minutes', this.options.duration / 2);
|
9356
9454
|
} else if (this.options.autoClose) {
|
9357
|
-
this.minutesView.addClass('timepicker-dial-out');
|
9455
|
+
$(this.minutesView).addClass('timepicker-dial-out');
|
9358
9456
|
setTimeout(function () {
|
9359
|
-
|
9457
|
+
_this55.done();
|
9360
9458
|
}, this.options.duration / 2);
|
9361
9459
|
}
|
9362
9460
|
|
@@ -9382,11 +9480,11 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
9382
9480
|
}, {
|
9383
9481
|
key: "_setupModal",
|
9384
9482
|
value: function _setupModal() {
|
9385
|
-
var
|
9483
|
+
var _this56 = this;
|
9386
9484
|
|
9387
9485
|
this.modal = M.Modal.init(this.modalEl, {
|
9388
9486
|
onCloseEnd: function () {
|
9389
|
-
|
9487
|
+
_this56.isOpen = false;
|
9390
9488
|
}
|
9391
9489
|
});
|
9392
9490
|
}
|
@@ -9410,11 +9508,11 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
9410
9508
|
}, {
|
9411
9509
|
key: "_pickerSetup",
|
9412
9510
|
value: function _pickerSetup() {
|
9413
|
-
$('<button class="btn-flat timepicker-clear waves-effect" type="button" tabindex="' + (this.options.twelveHour ? '3' : '1') + '">' + this.options.
|
9511
|
+
$('<button class="btn-flat timepicker-clear waves-effect" type="button" tabindex="' + (this.options.twelveHour ? '3' : '1') + '">' + this.options.i18n.clear + '</button>').appendTo(this.footer).on('click', this.clear.bind(this));
|
9414
9512
|
|
9415
9513
|
var confirmationBtnsContainer = $('<div class="confirmation-btns"></div>');
|
9416
|
-
$('<button class="btn-flat timepicker-close waves-effect" type="button" tabindex="' + (this.options.twelveHour ? '3' : '1') + '">' + this.options.
|
9417
|
-
$('<button class="btn-flat timepicker-close waves-effect" type="button" tabindex="' + (this.options.twelveHour ? '3' : '1') + '">' + this.options.
|
9514
|
+
$('<button class="btn-flat timepicker-close waves-effect" type="button" tabindex="' + (this.options.twelveHour ? '3' : '1') + '">' + this.options.i18n.cancel + '</button>').appendTo(confirmationBtnsContainer).on('click', this.close.bind(this));
|
9515
|
+
$('<button class="btn-flat timepicker-close waves-effect" type="button" tabindex="' + (this.options.twelveHour ? '3' : '1') + '">' + this.options.i18n.done + '</button>').appendTo(confirmationBtnsContainer).on('click', this.done.bind(this));
|
9418
9516
|
confirmationBtnsContainer.appendTo(this.footer);
|
9419
9517
|
}
|
9420
9518
|
}, {
|
@@ -9612,7 +9710,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
9612
9710
|
}, {
|
9613
9711
|
key: "setHand",
|
9614
9712
|
value: function setHand(x, y, roundBy5) {
|
9615
|
-
var
|
9713
|
+
var _this57 = this;
|
9616
9714
|
|
9617
9715
|
var radian = Math.atan2(x, -y),
|
9618
9716
|
isHours = this.currentView === 'hours',
|
@@ -9667,7 +9765,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
9667
9765
|
if (!this.vibrateTimer) {
|
9668
9766
|
navigator[this.vibrate](10);
|
9669
9767
|
this.vibrateTimer = setTimeout(function () {
|
9670
|
-
|
9768
|
+
_this57.vibrateTimer = null;
|
9671
9769
|
}, 100);
|
9672
9770
|
}
|
9673
9771
|
}
|
@@ -9831,20 +9929,20 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
9831
9929
|
function CharacterCounter(el, options) {
|
9832
9930
|
_classCallCheck(this, CharacterCounter);
|
9833
9931
|
|
9834
|
-
var
|
9932
|
+
var _this58 = _possibleConstructorReturn(this, (CharacterCounter.__proto__ || Object.getPrototypeOf(CharacterCounter)).call(this, CharacterCounter, el, options));
|
9835
9933
|
|
9836
|
-
|
9934
|
+
_this58.el.M_CharacterCounter = _this58;
|
9837
9935
|
|
9838
9936
|
/**
|
9839
9937
|
* Options for the character counter
|
9840
9938
|
*/
|
9841
|
-
|
9939
|
+
_this58.options = $.extend({}, CharacterCounter.defaults, options);
|
9842
9940
|
|
9843
|
-
|
9844
|
-
|
9845
|
-
|
9846
|
-
|
9847
|
-
return
|
9941
|
+
_this58.isInvalid = false;
|
9942
|
+
_this58.isValidLength = false;
|
9943
|
+
_this58._setupCounter();
|
9944
|
+
_this58._setupEventHandlers();
|
9945
|
+
return _this58;
|
9848
9946
|
}
|
9849
9947
|
|
9850
9948
|
_createClass(CharacterCounter, [{
|
@@ -10010,9 +10108,9 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10010
10108
|
function Carousel(el, options) {
|
10011
10109
|
_classCallCheck(this, Carousel);
|
10012
10110
|
|
10013
|
-
var
|
10111
|
+
var _this59 = _possibleConstructorReturn(this, (Carousel.__proto__ || Object.getPrototypeOf(Carousel)).call(this, Carousel, el, options));
|
10014
10112
|
|
10015
|
-
|
10113
|
+
_this59.el.M_Carousel = _this59;
|
10016
10114
|
|
10017
10115
|
/**
|
10018
10116
|
* Options for the carousel
|
@@ -10026,38 +10124,38 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10026
10124
|
* @prop {Boolean} noWrap
|
10027
10125
|
* @prop {Function} onCycleTo
|
10028
10126
|
*/
|
10029
|
-
|
10127
|
+
_this59.options = $.extend({}, Carousel.defaults, options);
|
10030
10128
|
|
10031
10129
|
// Setup
|
10032
|
-
|
10033
|
-
|
10034
|
-
|
10035
|
-
|
10036
|
-
|
10037
|
-
|
10038
|
-
|
10039
|
-
|
10040
|
-
|
10041
|
-
|
10042
|
-
|
10043
|
-
|
10130
|
+
_this59.hasMultipleSlides = _this59.$el.find('.carousel-item').length > 1;
|
10131
|
+
_this59.showIndicators = _this59.options.indicators && _this59.hasMultipleSlides;
|
10132
|
+
_this59.noWrap = _this59.options.noWrap || !_this59.hasMultipleSlides;
|
10133
|
+
_this59.pressed = false;
|
10134
|
+
_this59.dragged = false;
|
10135
|
+
_this59.offset = _this59.target = 0;
|
10136
|
+
_this59.images = [];
|
10137
|
+
_this59.itemWidth = _this59.$el.find('.carousel-item').first().innerWidth();
|
10138
|
+
_this59.itemHeight = _this59.$el.find('.carousel-item').first().innerHeight();
|
10139
|
+
_this59.dim = _this59.itemWidth * 2 + _this59.options.padding || 1; // Make sure dim is non zero for divisions.
|
10140
|
+
_this59._autoScrollBound = _this59._autoScroll.bind(_this59);
|
10141
|
+
_this59._trackBound = _this59._track.bind(_this59);
|
10044
10142
|
|
10045
10143
|
// Full Width carousel setup
|
10046
|
-
if (
|
10047
|
-
|
10048
|
-
|
10144
|
+
if (_this59.options.fullWidth) {
|
10145
|
+
_this59.options.dist = 0;
|
10146
|
+
_this59._setCarouselHeight();
|
10049
10147
|
|
10050
10148
|
// Offset fixed items when indicators.
|
10051
|
-
if (
|
10052
|
-
|
10149
|
+
if (_this59.showIndicators) {
|
10150
|
+
_this59.$el.find('.carousel-fixed-item').addClass('with-indicators');
|
10053
10151
|
}
|
10054
10152
|
}
|
10055
10153
|
|
10056
10154
|
// Iterate through slides
|
10057
|
-
|
10058
|
-
|
10059
|
-
|
10060
|
-
if (
|
10155
|
+
_this59.$indicators = $('<ul class="indicators"></ul>');
|
10156
|
+
_this59.$el.find('.carousel-item').each(function (el, i) {
|
10157
|
+
_this59.images.push(el);
|
10158
|
+
if (_this59.showIndicators) {
|
10061
10159
|
var $indicator = $('<li class="indicator-item"></li>');
|
10062
10160
|
|
10063
10161
|
// Add active to first by default.
|
@@ -10065,28 +10163,28 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10065
10163
|
$indicator[0].classList.add('active');
|
10066
10164
|
}
|
10067
10165
|
|
10068
|
-
|
10166
|
+
_this59.$indicators.append($indicator);
|
10069
10167
|
}
|
10070
10168
|
});
|
10071
|
-
if (
|
10072
|
-
|
10169
|
+
if (_this59.showIndicators) {
|
10170
|
+
_this59.$el.append(_this59.$indicators);
|
10073
10171
|
}
|
10074
|
-
|
10172
|
+
_this59.count = _this59.images.length;
|
10075
10173
|
|
10076
10174
|
// Setup cross browser string
|
10077
|
-
|
10175
|
+
_this59.xform = 'transform';
|
10078
10176
|
['webkit', 'Moz', 'O', 'ms'].every(function (prefix) {
|
10079
10177
|
var e = prefix + 'Transform';
|
10080
10178
|
if (typeof document.body.style[e] !== 'undefined') {
|
10081
|
-
|
10179
|
+
_this59.xform = e;
|
10082
10180
|
return false;
|
10083
10181
|
}
|
10084
10182
|
return true;
|
10085
10183
|
});
|
10086
10184
|
|
10087
|
-
|
10088
|
-
|
10089
|
-
return
|
10185
|
+
_this59._setupEventHandlers();
|
10186
|
+
_this59._scroll(_this59.offset);
|
10187
|
+
return _this59;
|
10090
10188
|
}
|
10091
10189
|
|
10092
10190
|
_createClass(Carousel, [{
|
@@ -10108,7 +10206,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10108
10206
|
}, {
|
10109
10207
|
key: "_setupEventHandlers",
|
10110
10208
|
value: function _setupEventHandlers() {
|
10111
|
-
var
|
10209
|
+
var _this60 = this;
|
10112
10210
|
|
10113
10211
|
this._handleCarouselTapBound = this._handleCarouselTap.bind(this);
|
10114
10212
|
this._handleCarouselDragBound = this._handleCarouselDrag.bind(this);
|
@@ -10130,7 +10228,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10130
10228
|
if (this.showIndicators && this.$indicators) {
|
10131
10229
|
this._handleIndicatorClickBound = this._handleIndicatorClick.bind(this);
|
10132
10230
|
this.$indicators.find('.indicator-item').each(function (el, i) {
|
10133
|
-
el.addEventListener('click',
|
10231
|
+
el.addEventListener('click', _this60._handleIndicatorClickBound);
|
10134
10232
|
});
|
10135
10233
|
}
|
10136
10234
|
|
@@ -10148,7 +10246,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10148
10246
|
}, {
|
10149
10247
|
key: "_removeEventHandlers",
|
10150
10248
|
value: function _removeEventHandlers() {
|
10151
|
-
var
|
10249
|
+
var _this61 = this;
|
10152
10250
|
|
10153
10251
|
if (typeof window.ontouchstart !== 'undefined') {
|
10154
10252
|
this.el.removeEventListener('touchstart', this._handleCarouselTapBound);
|
@@ -10163,7 +10261,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10163
10261
|
|
10164
10262
|
if (this.showIndicators && this.$indicators) {
|
10165
10263
|
this.$indicators.find('.indicator-item').each(function (el, i) {
|
10166
|
-
el.removeEventListener('click',
|
10264
|
+
el.removeEventListener('click', _this61._handleIndicatorClickBound);
|
10167
10265
|
});
|
10168
10266
|
}
|
10169
10267
|
|
@@ -10349,7 +10447,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10349
10447
|
}, {
|
10350
10448
|
key: "_setCarouselHeight",
|
10351
10449
|
value: function _setCarouselHeight(imageOnly) {
|
10352
|
-
var
|
10450
|
+
var _this62 = this;
|
10353
10451
|
|
10354
10452
|
var firstSlide = this.$el.find('.carousel-item.active').length ? this.$el.find('.carousel-item.active').first() : this.$el.find('.carousel-item').first();
|
10355
10453
|
var firstImage = firstSlide.find('img').first();
|
@@ -10369,7 +10467,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10369
10467
|
} else {
|
10370
10468
|
// Get height when image is loaded normally
|
10371
10469
|
firstImage.one('load', function (el, i) {
|
10372
|
-
|
10470
|
+
_this62.$el.css('height', el.offsetHeight + 'px');
|
10373
10471
|
});
|
10374
10472
|
}
|
10375
10473
|
} else if (!imageOnly) {
|
@@ -10475,7 +10573,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10475
10573
|
}, {
|
10476
10574
|
key: "_scroll",
|
10477
10575
|
value: function _scroll(x) {
|
10478
|
-
var
|
10576
|
+
var _this63 = this;
|
10479
10577
|
|
10480
10578
|
// Track scrolling state
|
10481
10579
|
if (!this.$el.hasClass('scrolling')) {
|
@@ -10485,7 +10583,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10485
10583
|
window.clearTimeout(this.scrollingTimeout);
|
10486
10584
|
}
|
10487
10585
|
this.scrollingTimeout = window.setTimeout(function () {
|
10488
|
-
|
10586
|
+
_this63.$el.removeClass('scrolling');
|
10489
10587
|
}, this.options.duration);
|
10490
10588
|
|
10491
10589
|
// Start actual scroll
|
@@ -10783,9 +10881,9 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10783
10881
|
function FeatureDiscovery(el, options) {
|
10784
10882
|
_classCallCheck(this, FeatureDiscovery);
|
10785
10883
|
|
10786
|
-
var
|
10884
|
+
var _this64 = _possibleConstructorReturn(this, (FeatureDiscovery.__proto__ || Object.getPrototypeOf(FeatureDiscovery)).call(this, FeatureDiscovery, el, options));
|
10787
10885
|
|
10788
|
-
|
10886
|
+
_this64.el.M_FeatureDiscovery = _this64;
|
10789
10887
|
|
10790
10888
|
/**
|
10791
10889
|
* Options for the select
|
@@ -10793,17 +10891,17 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
10793
10891
|
* @prop {Function} onOpen - Callback function called when feature discovery is opened
|
10794
10892
|
* @prop {Function} onClose - Callback function called when feature discovery is closed
|
10795
10893
|
*/
|
10796
|
-
|
10894
|
+
_this64.options = $.extend({}, FeatureDiscovery.defaults, options);
|
10797
10895
|
|
10798
|
-
|
10896
|
+
_this64.isOpen = false;
|
10799
10897
|
|
10800
10898
|
// setup
|
10801
|
-
|
10802
|
-
|
10899
|
+
_this64.$origin = $('#' + _this64.$el.attr('data-target'));
|
10900
|
+
_this64._setup();
|
10803
10901
|
|
10804
|
-
|
10805
|
-
|
10806
|
-
return
|
10902
|
+
_this64._calculatePositioning();
|
10903
|
+
_this64._setupEventHandlers();
|
10904
|
+
return _this64;
|
10807
10905
|
}
|
10808
10906
|
|
10809
10907
|
_createClass(FeatureDiscovery, [{
|
@@ -11116,7 +11214,8 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11116
11214
|
'use strict';
|
11117
11215
|
|
11118
11216
|
var _defaults = {
|
11119
|
-
classes: ''
|
11217
|
+
classes: '',
|
11218
|
+
dropdownOptions: {}
|
11120
11219
|
};
|
11121
11220
|
|
11122
11221
|
/**
|
@@ -11124,40 +11223,46 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11124
11223
|
*
|
11125
11224
|
*/
|
11126
11225
|
|
11127
|
-
var
|
11128
|
-
_inherits(
|
11226
|
+
var FormSelect = function (_Component20) {
|
11227
|
+
_inherits(FormSelect, _Component20);
|
11129
11228
|
|
11130
11229
|
/**
|
11131
|
-
* Construct
|
11230
|
+
* Construct FormSelect instance
|
11132
11231
|
* @constructor
|
11133
11232
|
* @param {Element} el
|
11134
11233
|
* @param {Object} options
|
11135
11234
|
*/
|
11136
|
-
function
|
11137
|
-
_classCallCheck(this,
|
11235
|
+
function FormSelect(el, options) {
|
11236
|
+
_classCallCheck(this, FormSelect);
|
11138
11237
|
|
11139
|
-
|
11238
|
+
// Don't init if browser default version
|
11239
|
+
var _this65 = _possibleConstructorReturn(this, (FormSelect.__proto__ || Object.getPrototypeOf(FormSelect)).call(this, FormSelect, el, options));
|
11140
11240
|
|
11141
|
-
|
11241
|
+
if (_this65.$el.hasClass('browser-default')) {
|
11242
|
+
return _possibleConstructorReturn(_this65);
|
11243
|
+
}
|
11244
|
+
|
11245
|
+
_this65.el.M_FormSelect = _this65;
|
11142
11246
|
|
11143
11247
|
/**
|
11144
11248
|
* Options for the select
|
11145
|
-
* @member
|
11249
|
+
* @member FormSelect#options
|
11146
11250
|
*/
|
11147
|
-
|
11251
|
+
_this65.options = $.extend({}, FormSelect.defaults, options);
|
11148
11252
|
|
11149
|
-
|
11253
|
+
_this65.isMultiple = _this65.$el.prop('multiple');
|
11150
11254
|
|
11151
11255
|
// Setup
|
11152
|
-
|
11153
|
-
|
11154
|
-
|
11256
|
+
_this65.el.tabIndex = -1;
|
11257
|
+
_this65._keysSelected = {};
|
11258
|
+
_this65._valueDict = {}; // Maps key to original and generated option element.
|
11259
|
+
_this65._setupDropdown();
|
11155
11260
|
|
11156
|
-
|
11157
|
-
return
|
11261
|
+
_this65._setupEventHandlers();
|
11262
|
+
return _this65;
|
11158
11263
|
}
|
11159
11264
|
|
11160
|
-
_createClass(
|
11265
|
+
_createClass(FormSelect, [{
|
11161
11266
|
key: "destroy",
|
11162
11267
|
|
11163
11268
|
|
@@ -11167,7 +11272,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11167
11272
|
value: function destroy() {
|
11168
11273
|
this._removeEventHandlers();
|
11169
11274
|
this._removeDropdown();
|
11170
|
-
this.el.
|
11275
|
+
this.el.M_FormSelect = undefined;
|
11171
11276
|
}
|
11172
11277
|
|
11173
11278
|
/**
|
@@ -11177,14 +11282,14 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11177
11282
|
}, {
|
11178
11283
|
key: "_setupEventHandlers",
|
11179
11284
|
value: function _setupEventHandlers() {
|
11180
|
-
var
|
11285
|
+
var _this66 = this;
|
11181
11286
|
|
11182
11287
|
this._handleSelectChangeBound = this._handleSelectChange.bind(this);
|
11183
11288
|
this._handleOptionClickBound = this._handleOptionClick.bind(this);
|
11184
11289
|
this._handleInputClickBound = this._handleInputClick.bind(this);
|
11185
11290
|
|
11186
11291
|
$(this.dropdownOptions).find('li:not(.optgroup)').each(function (el) {
|
11187
|
-
el.addEventListener('click',
|
11292
|
+
el.addEventListener('click', _this66._handleOptionClickBound);
|
11188
11293
|
});
|
11189
11294
|
this.el.addEventListener('change', this._handleSelectChangeBound);
|
11190
11295
|
this.input.addEventListener('click', this._handleInputClickBound);
|
@@ -11197,14 +11302,13 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11197
11302
|
}, {
|
11198
11303
|
key: "_removeEventHandlers",
|
11199
11304
|
value: function _removeEventHandlers() {
|
11200
|
-
var
|
11305
|
+
var _this67 = this;
|
11201
11306
|
|
11202
11307
|
$(this.dropdownOptions).find('li:not(.optgroup)').each(function (el) {
|
11203
|
-
el.removeEventListener('click',
|
11308
|
+
el.removeEventListener('click', _this67._handleOptionClickBound);
|
11204
11309
|
});
|
11205
11310
|
this.el.removeEventListener('change', this._handleSelectChangeBound);
|
11206
11311
|
this.input.removeEventListener('click', this._handleInputClickBound);
|
11207
|
-
this.input.removeEventListener('focus', this._handleInputFocusBound);
|
11208
11312
|
}
|
11209
11313
|
|
11210
11314
|
/**
|
@@ -11278,7 +11382,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11278
11382
|
}, {
|
11279
11383
|
key: "_setupDropdown",
|
11280
11384
|
value: function _setupDropdown() {
|
11281
|
-
var
|
11385
|
+
var _this68 = this;
|
11282
11386
|
|
11283
11387
|
this.wrapper = document.createElement('div');
|
11284
11388
|
$(this.wrapper).addClass('select-wrapper' + ' ' + this.options.classes);
|
@@ -11301,21 +11405,21 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11301
11405
|
if ($(el).is('option')) {
|
11302
11406
|
// Direct descendant option.
|
11303
11407
|
var optionEl = void 0;
|
11304
|
-
if (
|
11305
|
-
optionEl =
|
11408
|
+
if (_this68.isMultiple) {
|
11409
|
+
optionEl = _this68._appendOptionWithIcon(_this68.$el, el, 'multiple');
|
11306
11410
|
} else {
|
11307
|
-
optionEl =
|
11411
|
+
optionEl = _this68._appendOptionWithIcon(_this68.$el, el);
|
11308
11412
|
}
|
11309
11413
|
|
11310
|
-
|
11414
|
+
_this68._addOptionToValueDict(el, optionEl);
|
11311
11415
|
} else if ($(el).is('optgroup')) {
|
11312
11416
|
// Optgroup.
|
11313
11417
|
var selectOptions = $(el).children('option');
|
11314
|
-
$(
|
11418
|
+
$(_this68.dropdownOptions).append($('<li class="optgroup"><span>' + el.getAttribute('label') + '</span></li>')[0]);
|
11315
11419
|
|
11316
11420
|
selectOptions.each(function (el) {
|
11317
|
-
var optionEl =
|
11318
|
-
|
11421
|
+
var optionEl = _this68._appendOptionWithIcon(_this68.$el, el, 'optgroup-option');
|
11422
|
+
_this68._addOptionToValueDict(el, optionEl);
|
11319
11423
|
});
|
11320
11424
|
}
|
11321
11425
|
});
|
@@ -11342,7 +11446,8 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11342
11446
|
|
11343
11447
|
// Initialize dropdown
|
11344
11448
|
if (!this.el.disabled) {
|
11345
|
-
var dropdownOptions = {};
|
11449
|
+
var dropdownOptions = $.extend({}, this.options.dropdownOptions);
|
11450
|
+
|
11346
11451
|
if (this.isMultiple) {
|
11347
11452
|
dropdownOptions.closeOnClick = false;
|
11348
11453
|
}
|
@@ -11529,7 +11634,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11529
11634
|
}], [{
|
11530
11635
|
key: "init",
|
11531
11636
|
value: function init(els, options) {
|
11532
|
-
return _get(
|
11637
|
+
return _get(FormSelect.__proto__ || Object.getPrototypeOf(FormSelect), "init", this).call(this, this, els, options);
|
11533
11638
|
}
|
11534
11639
|
|
11535
11640
|
/**
|
@@ -11540,7 +11645,7 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11540
11645
|
key: "getInstance",
|
11541
11646
|
value: function getInstance(el) {
|
11542
11647
|
var domElem = !!el.jquery ? el[0] : el;
|
11543
|
-
return domElem.
|
11648
|
+
return domElem.M_FormSelect;
|
11544
11649
|
}
|
11545
11650
|
}, {
|
11546
11651
|
key: "defaults",
|
@@ -11549,13 +11654,13 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11549
11654
|
}
|
11550
11655
|
}]);
|
11551
11656
|
|
11552
|
-
return
|
11657
|
+
return FormSelect;
|
11553
11658
|
}(Component);
|
11554
11659
|
|
11555
|
-
M.
|
11660
|
+
M.FormSelect = FormSelect;
|
11556
11661
|
|
11557
11662
|
if (M.jQueryLoaded) {
|
11558
|
-
M.initializeJqueryWrapper(
|
11663
|
+
M.initializeJqueryWrapper(FormSelect, 'formSelect', 'M_FormSelect');
|
11559
11664
|
}
|
11560
11665
|
})(cash);
|
11561
11666
|
;(function ($, anim) {
|
@@ -11580,23 +11685,23 @@ $jscomp.polyfill = function (e, r, p, m) {
|
|
11580
11685
|
function Range(el, options) {
|
11581
11686
|
_classCallCheck(this, Range);
|
11582
11687
|
|
11583
|
-
var
|
11688
|
+
var _this69 = _possibleConstructorReturn(this, (Range.__proto__ || Object.getPrototypeOf(Range)).call(this, Range, el, options));
|
11584
11689
|
|
11585
|
-
|
11690
|
+
_this69.el.M_Range = _this69;
|
11586
11691
|
|
11587
11692
|
/**
|
11588
11693
|
* Options for the range
|
11589
11694
|
* @member Range#options
|
11590
11695
|
*/
|
11591
|
-
|
11696
|
+
_this69.options = $.extend({}, Range.defaults, options);
|
11592
11697
|
|
11593
|
-
|
11698
|
+
_this69._mousedown = false;
|
11594
11699
|
|
11595
11700
|
// Setup
|
11596
|
-
|
11701
|
+
_this69._setupThumb();
|
11597
11702
|
|
11598
|
-
|
11599
|
-
return
|
11703
|
+
_this69._setupEventHandlers();
|
11704
|
+
return _this69;
|
11600
11705
|
}
|
11601
11706
|
|
11602
11707
|
_createClass(Range, [{
|