materialize-sass 1.0.0.beta → 1.0.0.1
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 +4 -4
- data/.gitattributes +1 -0
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/assets/javascripts/materialize/autocomplete.js +94 -37
- data/assets/javascripts/materialize/buttons.js +4 -6
- data/assets/javascripts/materialize/carousel.js +9 -9
- data/assets/javascripts/materialize/chips.js +2 -2
- data/assets/javascripts/materialize/collapsible.js +13 -10
- data/assets/javascripts/materialize/datepicker.js +27 -44
- data/assets/javascripts/materialize/dropdown.js +38 -15
- 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 +7 -8
- data/assets/javascripts/materialize/global.js +28 -11
- data/assets/javascripts/materialize/materialbox.js +12 -7
- data/assets/javascripts/materialize/modal.js +8 -4
- data/assets/javascripts/materialize/parallax.js +1 -1
- data/assets/javascripts/materialize/pushpin.js +8 -3
- data/assets/javascripts/materialize/range.js +2 -19
- data/assets/javascripts/materialize/select.js +57 -33
- data/assets/javascripts/materialize/sidenav.js +5 -3
- data/assets/javascripts/materialize/slider.js +2 -1
- data/assets/javascripts/materialize/tabs.js +13 -8
- data/assets/javascripts/materialize/timepicker.js +22 -5
- data/assets/javascripts/materialize/toasts.js +4 -3
- data/assets/javascripts/materialize/tooltip.js +14 -8
- data/assets/javascripts/materialize.js +804 -685
- data/assets/stylesheets/materialize/components/_buttons.scss +2 -1
- data/assets/stylesheets/materialize/components/_collapsible.scss +8 -1
- data/assets/stylesheets/materialize/components/_datepicker.scss +5 -1
- data/assets/stylesheets/materialize/components/_dropdown.scss +10 -1
- data/assets/stylesheets/materialize/components/_global.scss +2 -0
- data/assets/stylesheets/materialize/components/_modal.scss +4 -0
- data/assets/stylesheets/materialize/components/_sidenav.scss +9 -17
- data/assets/stylesheets/materialize/components/_toast.scss +0 -1
- data/assets/stylesheets/materialize/components/_variables.scss +1 -0
- data/assets/stylesheets/materialize/components/forms/_input-fields.scss +2 -0
- data/assets/stylesheets/materialize/components/forms/_range.scss +3 -3
- data/assets/stylesheets/materialize/components/forms/_select.scss +19 -7
- data/assets/stylesheets/materialize/extras/nouislider.css +1 -1
- data/lib/materialize-sass/engine.rb +4 -1
- data/lib/materialize-sass/version.rb +1 -1
- data/lib/materialize-sass.rb +3 -8
- data/materialize-sass.gemspec +4 -5
- metadata +18 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 399746b482a8e1e904d3bcb3b19687a53cfc6c733f53ea1b08a89654606e4418
|
4
|
+
data.tar.gz: a37994aac1585629354f79f2721dad29ef778582ec92554e326ea3f0c6c207d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4bd6c2888e737a5efffa08a6fb1579c9c48366886c2bdda158a6c69f4a97e64938003711dd3a9b09b280d822d54caed541f6d3ad74d1b4e957987d930ec7388e
|
7
|
+
data.tar.gz: 16056cadcbcc50683ee48918cbddad10dad4e62f1da6e829d14c2a03edd98d50b8c7faa4c477514466f599cad3e6b86a1e6bfe95abdce7c3765206bc7bfeca4e
|
data/.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
assets/* linguist-vendored
|
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
|
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
|
19
|
+
gem 'materialize-sass', '~> 1.0.0'
|
20
20
|
```
|
21
21
|
|
22
22
|
|
data/Rakefile
CHANGED
@@ -64,6 +64,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
64
64
|
_this.oldVal;
|
65
65
|
_this.$inputField = _this.$el.closest('.input-field');
|
66
66
|
_this.$active = $();
|
67
|
+
_this._mousedown = false;
|
67
68
|
_this._setupDropdown();
|
68
69
|
|
69
70
|
_this._setupEventHandlers();
|
@@ -93,16 +94,21 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
93
94
|
this._handleInputBlurBound = this._handleInputBlur.bind(this);
|
94
95
|
this._handleInputKeyupAndFocusBound = this._handleInputKeyupAndFocus.bind(this);
|
95
96
|
this._handleInputKeydownBound = this._handleInputKeydown.bind(this);
|
97
|
+
this._handleInputClickBound = this._handleInputClick.bind(this);
|
96
98
|
this._handleContainerMousedownAndTouchstartBound = this._handleContainerMousedownAndTouchstart.bind(this);
|
99
|
+
this._handleContainerMouseupAndTouchendBound = this._handleContainerMouseupAndTouchend.bind(this);
|
97
100
|
|
98
101
|
this.el.addEventListener('blur', this._handleInputBlurBound);
|
99
102
|
this.el.addEventListener('keyup', this._handleInputKeyupAndFocusBound);
|
100
103
|
this.el.addEventListener('focus', this._handleInputKeyupAndFocusBound);
|
101
104
|
this.el.addEventListener('keydown', this._handleInputKeydownBound);
|
105
|
+
this.el.addEventListener('click', this._handleInputClickBound);
|
102
106
|
this.container.addEventListener('mousedown', this._handleContainerMousedownAndTouchstartBound);
|
107
|
+
this.container.addEventListener('mouseup', this._handleContainerMouseupAndTouchendBound);
|
103
108
|
|
104
109
|
if (typeof window.ontouchstart !== 'undefined') {
|
105
110
|
this.container.addEventListener('touchstart', this._handleContainerMousedownAndTouchstartBound);
|
111
|
+
this.container.addEventListener('touchend', this._handleContainerMouseupAndTouchendBound);
|
106
112
|
}
|
107
113
|
}
|
108
114
|
|
@@ -117,10 +123,13 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
117
123
|
this.el.removeEventListener('keyup', this._handleInputKeyupAndFocusBound);
|
118
124
|
this.el.removeEventListener('focus', this._handleInputKeyupAndFocusBound);
|
119
125
|
this.el.removeEventListener('keydown', this._handleInputKeydownBound);
|
126
|
+
this.el.removeEventListener('click', this._handleInputClickBound);
|
120
127
|
this.container.removeEventListener('mousedown', this._handleContainerMousedownAndTouchstartBound);
|
128
|
+
this.container.removeEventListener('mouseup', this._handleContainerMouseupAndTouchendBound);
|
121
129
|
|
122
130
|
if (typeof window.ontouchstart !== 'undefined') {
|
123
131
|
this.container.removeEventListener('touchstart', this._handleContainerMousedownAndTouchstartBound);
|
132
|
+
this.container.removeEventListener('touchend', this._handleContainerMouseupAndTouchendBound);
|
124
133
|
}
|
125
134
|
}
|
126
135
|
|
@@ -131,6 +140,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
131
140
|
}, {
|
132
141
|
key: '_setupDropdown',
|
133
142
|
value: function _setupDropdown() {
|
143
|
+
var _this2 = this;
|
144
|
+
|
134
145
|
this.container = document.createElement('ul');
|
135
146
|
this.container.id = 'autocomplete-options-' + M.guid();
|
136
147
|
$(this.container).addClass('autocomplete-content dropdown-content');
|
@@ -140,7 +151,10 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
140
151
|
this.dropdown = M.Dropdown.init(this.el, {
|
141
152
|
autoFocus: false,
|
142
153
|
closeOnClick: false,
|
143
|
-
coverTrigger: false
|
154
|
+
coverTrigger: false,
|
155
|
+
onItemClick: function (itemEl) {
|
156
|
+
_this2.selectOption($(itemEl));
|
157
|
+
}
|
144
158
|
});
|
145
159
|
|
146
160
|
// Sketchy removal of dropdown click handler
|
@@ -164,8 +178,10 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
164
178
|
}, {
|
165
179
|
key: '_handleInputBlur',
|
166
180
|
value: function _handleInputBlur() {
|
167
|
-
this.
|
168
|
-
|
181
|
+
if (!this._mousedown) {
|
182
|
+
this.close();
|
183
|
+
this._resetAutocomplete();
|
184
|
+
}
|
169
185
|
}
|
170
186
|
|
171
187
|
/**
|
@@ -176,8 +192,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
176
192
|
}, {
|
177
193
|
key: '_handleInputKeyupAndFocus',
|
178
194
|
value: function _handleInputKeyupAndFocus(e) {
|
179
|
-
var _this2 = this;
|
180
|
-
|
181
195
|
if (e.type === 'keyup') {
|
182
196
|
Autocomplete._keydown = false;
|
183
197
|
}
|
@@ -191,25 +205,9 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
191
205
|
}
|
192
206
|
|
193
207
|
// Check if the input isn't empty
|
194
|
-
if
|
195
|
-
|
196
|
-
|
197
|
-
if (val.length >= this.options.minLength) {
|
198
|
-
this.isOpen = true;
|
199
|
-
this._renderDropdown(this.options.data, val);
|
200
|
-
}
|
201
|
-
|
202
|
-
// Open dropdown
|
203
|
-
if (!this.dropdown.isOpen) {
|
204
|
-
// Timeout to prevent dropdown temp doc click handler from firing
|
205
|
-
setTimeout(function () {
|
206
|
-
_this2.dropdown.open();
|
207
|
-
}, 100);
|
208
|
-
|
209
|
-
// Recalculate dropdown when its already open
|
210
|
-
} else {
|
211
|
-
this.dropdown.recalculateDimensions();
|
212
|
-
}
|
208
|
+
// Check if focus triggered by tab
|
209
|
+
if (this.oldVal !== val && (M.tabPressed || e.type !== 'focus')) {
|
210
|
+
this.open();
|
213
211
|
}
|
214
212
|
|
215
213
|
// Update oldVal
|
@@ -232,7 +230,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
232
230
|
numItems = $(this.container).children('li').length;
|
233
231
|
|
234
232
|
// select element on Enter
|
235
|
-
if (keyCode ===
|
233
|
+
if (keyCode === M.keys.ENTER && this.activeIndex >= 0) {
|
236
234
|
liElement = $(this.container).children('li').eq(this.activeIndex);
|
237
235
|
if (liElement.length) {
|
238
236
|
this.selectOption(liElement);
|
@@ -242,14 +240,14 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
242
240
|
}
|
243
241
|
|
244
242
|
// Capture up and down key
|
245
|
-
if (keyCode ===
|
243
|
+
if (keyCode === M.keys.ARROW_UP || keyCode === M.keys.ARROW_DOWN) {
|
246
244
|
e.preventDefault();
|
247
245
|
|
248
|
-
if (keyCode ===
|
246
|
+
if (keyCode === M.keys.ARROW_UP && this.activeIndex > 0) {
|
249
247
|
this.activeIndex--;
|
250
248
|
}
|
251
249
|
|
252
|
-
if (keyCode ===
|
250
|
+
if (keyCode === M.keys.ARROW_DOWN && this.activeIndex < numItems - 1) {
|
253
251
|
this.activeIndex++;
|
254
252
|
}
|
255
253
|
|
@@ -261,6 +259,17 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
261
259
|
}
|
262
260
|
}
|
263
261
|
|
262
|
+
/**
|
263
|
+
* Handle Input Click
|
264
|
+
* @param {Event} e
|
265
|
+
*/
|
266
|
+
|
267
|
+
}, {
|
268
|
+
key: '_handleInputClick',
|
269
|
+
value: function _handleInputClick(e) {
|
270
|
+
this.open();
|
271
|
+
}
|
272
|
+
|
264
273
|
/**
|
265
274
|
* Handle Container Mousedown and Touchstart
|
266
275
|
* @param {Event} e
|
@@ -269,8 +278,18 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
269
278
|
}, {
|
270
279
|
key: '_handleContainerMousedownAndTouchstart',
|
271
280
|
value: function _handleContainerMousedownAndTouchstart(e) {
|
272
|
-
|
273
|
-
|
281
|
+
this._mousedown = true;
|
282
|
+
}
|
283
|
+
|
284
|
+
/**
|
285
|
+
* Handle Container Mouseup and Touchend
|
286
|
+
* @param {Event} e
|
287
|
+
*/
|
288
|
+
|
289
|
+
}, {
|
290
|
+
key: '_handleContainerMouseupAndTouchend',
|
291
|
+
value: function _handleContainerMouseupAndTouchend(e) {
|
292
|
+
this._mousedown = false;
|
274
293
|
}
|
275
294
|
|
276
295
|
/**
|
@@ -281,12 +300,12 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
281
300
|
key: '_highlight',
|
282
301
|
value: function _highlight(string, $el) {
|
283
302
|
var img = $el.find('img');
|
284
|
-
var matchStart = $el.text().toLowerCase().indexOf(
|
303
|
+
var matchStart = $el.text().toLowerCase().indexOf('' + string.toLowerCase() + ''),
|
285
304
|
matchEnd = matchStart + string.length - 1,
|
286
305
|
beforeMatch = $el.text().slice(0, matchStart),
|
287
306
|
matchText = $el.text().slice(matchStart, matchEnd + 1),
|
288
307
|
afterMatch = $el.text().slice(matchEnd + 1);
|
289
|
-
$el.html(
|
308
|
+
$el.html('<span>' + beforeMatch + '<span class=\'highlight\'>' + matchText + '</span>' + afterMatch + '</span>');
|
290
309
|
if (img.length) {
|
291
310
|
$el.prepend(img);
|
292
311
|
}
|
@@ -314,6 +333,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
314
333
|
this._resetCurrentElement();
|
315
334
|
this.oldVal = null;
|
316
335
|
this.isOpen = false;
|
336
|
+
this._mousedown = false;
|
317
337
|
}
|
318
338
|
|
319
339
|
/**
|
@@ -328,7 +348,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
328
348
|
this.el.value = text;
|
329
349
|
this.$el.trigger('change');
|
330
350
|
this._resetAutocomplete();
|
331
|
-
this.
|
351
|
+
this.close();
|
332
352
|
|
333
353
|
// Handle onAutocomplete callback.
|
334
354
|
if (typeof this.options.onAutocomplete === 'function') {
|
@@ -370,10 +390,12 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
370
390
|
}
|
371
391
|
|
372
392
|
// Sort
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
393
|
+
if (this.options.sortFunction) {
|
394
|
+
var sortFunctionBound = function (a, b) {
|
395
|
+
return _this3.options.sortFunction(a.key.toLowerCase(), b.key.toLowerCase(), val.toLowerCase());
|
396
|
+
};
|
397
|
+
matchingData.sort(sortFunctionBound);
|
398
|
+
}
|
377
399
|
|
378
400
|
// Render
|
379
401
|
for (var i = 0; i < matchingData.length; i++) {
|
@@ -390,6 +412,41 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
390
412
|
}
|
391
413
|
}
|
392
414
|
|
415
|
+
/**
|
416
|
+
* Open Autocomplete Dropdown
|
417
|
+
*/
|
418
|
+
|
419
|
+
}, {
|
420
|
+
key: 'open',
|
421
|
+
value: function open() {
|
422
|
+
var val = this.el.value.toLowerCase();
|
423
|
+
|
424
|
+
this._resetAutocomplete();
|
425
|
+
|
426
|
+
if (val.length >= this.options.minLength) {
|
427
|
+
this.isOpen = true;
|
428
|
+
this._renderDropdown(this.options.data, val);
|
429
|
+
}
|
430
|
+
|
431
|
+
// Open dropdown
|
432
|
+
if (!this.dropdown.isOpen) {
|
433
|
+
this.dropdown.open();
|
434
|
+
} else {
|
435
|
+
// Recalculate dropdown when its already open
|
436
|
+
this.dropdown.recalculateDimensions();
|
437
|
+
}
|
438
|
+
}
|
439
|
+
|
440
|
+
/**
|
441
|
+
* Close Autocomplete Dropdown
|
442
|
+
*/
|
443
|
+
|
444
|
+
}, {
|
445
|
+
key: 'close',
|
446
|
+
value: function close() {
|
447
|
+
this.dropdown.close();
|
448
|
+
}
|
449
|
+
|
393
450
|
/**
|
394
451
|
* Update Data
|
395
452
|
* @param {Object} data
|
@@ -56,17 +56,15 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
56
56
|
_this.$floatingBtnsReverse = _this.$el.find('ul .btn-floating').reverse();
|
57
57
|
_this.offsetY = 0;
|
58
58
|
_this.offsetX = 0;
|
59
|
+
|
60
|
+
_this.$el.addClass('direction-' + _this.options.direction);
|
59
61
|
if (_this.options.direction === 'top') {
|
60
|
-
_this.$el.addClass('direction-top');
|
61
62
|
_this.offsetY = 40;
|
62
63
|
} else if (_this.options.direction === 'right') {
|
63
|
-
_this.$el.addClass('direction-right');
|
64
64
|
_this.offsetX = -40;
|
65
65
|
} else if (_this.options.direction === 'bottom') {
|
66
|
-
_this.$el.addClass('direction-bottom');
|
67
66
|
_this.offsetY = -40;
|
68
67
|
} else {
|
69
|
-
_this.$el.addClass('direction-left');
|
70
68
|
_this.offsetX = 40;
|
71
69
|
}
|
72
70
|
_this._setupEventHandlers();
|
@@ -202,7 +200,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
202
200
|
anim({
|
203
201
|
targets: el,
|
204
202
|
opacity: 1,
|
205
|
-
scale: [.4, 1],
|
203
|
+
scale: [0.4, 1],
|
206
204
|
translateY: [_this2.offsetY, 0],
|
207
205
|
translateX: [_this2.offsetX, 0],
|
208
206
|
duration: 275,
|
@@ -227,7 +225,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
227
225
|
anim({
|
228
226
|
targets: el,
|
229
227
|
opacity: 0,
|
230
|
-
scale: .4,
|
228
|
+
scale: 0.4,
|
231
229
|
translateY: _this3.offsetY,
|
232
230
|
translateX: _this3.offsetX,
|
233
231
|
duration: 175,
|
@@ -572,7 +572,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
572
572
|
this.$el.find('.carousel-item').removeClass('active');
|
573
573
|
el.classList.add('active');
|
574
574
|
}
|
575
|
-
var transformString = alignment + ' translateX(' + -delta / 2 + 'px)
|
575
|
+
var transformString = alignment + ' translateX(' + -delta / 2 + 'px) translateX(' + dir * this.options.shift * tween * i + 'px) translateZ(' + this.options.dist * tween + 'px)';
|
576
576
|
this._updateItemStyle(el, centerTweenedOpacity, 0, transformString);
|
577
577
|
}
|
578
578
|
|
@@ -588,7 +588,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
588
588
|
// Don't show wrapped items.
|
589
589
|
if (!this.noWrap || this.center + i < this.count) {
|
590
590
|
el = this.images[this._wrap(this.center + i)];
|
591
|
-
var _transformString = alignment + ' translateX(' + (this.options.shift + (this.dim * i - delta) / 2) + 'px)
|
591
|
+
var _transformString = alignment + ' translateX(' + (this.options.shift + (this.dim * i - delta) / 2) + 'px) translateZ(' + zTranslation + 'px)';
|
592
592
|
this._updateItemStyle(el, tweenedOpacity, -i, _transformString);
|
593
593
|
}
|
594
594
|
|
@@ -603,7 +603,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
603
603
|
// Don't show wrapped items.
|
604
604
|
if (!this.noWrap || this.center - i >= 0) {
|
605
605
|
el = this.images[this._wrap(this.center - i)];
|
606
|
-
var _transformString2 = alignment + ' translateX(' + (-this.options.shift + (-this.dim * i - delta) / 2) + 'px)
|
606
|
+
var _transformString2 = alignment + ' translateX(' + (-this.options.shift + (-this.dim * i - delta) / 2) + 'px) translateZ(' + zTranslation + 'px)';
|
607
607
|
this._updateItemStyle(el, tweenedOpacity, -i, _transformString2);
|
608
608
|
}
|
609
609
|
}
|
@@ -612,18 +612,18 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
612
612
|
// Don't show wrapped items.
|
613
613
|
if (!this.noWrap || this.center >= 0 && this.center < this.count) {
|
614
614
|
el = this.images[this._wrap(this.center)];
|
615
|
-
var _transformString3 = alignment + ' translateX(' + -delta / 2 + 'px)
|
615
|
+
var _transformString3 = alignment + ' translateX(' + -delta / 2 + 'px) translateX(' + dir * this.options.shift * tween + 'px) translateZ(' + this.options.dist * tween + 'px)';
|
616
616
|
this._updateItemStyle(el, centerTweenedOpacity, 0, _transformString3);
|
617
617
|
}
|
618
618
|
|
619
619
|
// onCycleTo callback
|
620
620
|
var $currItem = this.$el.find('.carousel-item').eq(this._wrap(this.center));
|
621
|
-
if (lastCenter !== this.center && typeof this.options.onCycleTo ===
|
621
|
+
if (lastCenter !== this.center && typeof this.options.onCycleTo === 'function') {
|
622
622
|
this.options.onCycleTo.call(this, $currItem[0], this.dragged);
|
623
623
|
}
|
624
624
|
|
625
625
|
// One time callback
|
626
|
-
if (typeof this.oneTimeCallback ===
|
626
|
+
if (typeof this.oneTimeCallback === 'function') {
|
627
627
|
this.oneTimeCallback.call(this, $currItem[0], this.dragged);
|
628
628
|
this.oneTimeCallback = null;
|
629
629
|
}
|
@@ -681,7 +681,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
681
681
|
}
|
682
682
|
|
683
683
|
// Set one time callback
|
684
|
-
if (typeof callback ===
|
684
|
+
if (typeof callback === 'function') {
|
685
685
|
this.oneTimeCallback = callback;
|
686
686
|
}
|
687
687
|
|
@@ -706,7 +706,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
706
706
|
}
|
707
707
|
|
708
708
|
var index = this.center + n;
|
709
|
-
if (index
|
709
|
+
if (index >= this.count || index < 0) {
|
710
710
|
if (this.noWrap) {
|
711
711
|
return;
|
712
712
|
}
|
@@ -729,7 +729,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
729
729
|
}
|
730
730
|
|
731
731
|
var index = this.center - n;
|
732
|
-
if (index
|
732
|
+
if (index >= this.count || index < 0) {
|
733
733
|
if (this.noWrap) {
|
734
734
|
return;
|
735
735
|
}
|
@@ -325,7 +325,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
325
325
|
value: function _setupLabel() {
|
326
326
|
this.$label = this.$el.find('label');
|
327
327
|
if (this.$label.length) {
|
328
|
-
this.$label.setAttribute('for', this.$input.attr('id'));
|
328
|
+
this.$label[0].setAttribute('for', this.$input.attr('id'));
|
329
329
|
}
|
330
330
|
}
|
331
331
|
|
@@ -551,7 +551,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
551
551
|
M.initializeJqueryWrapper(Chips, 'chips', 'M_Chips');
|
552
552
|
}
|
553
553
|
|
554
|
-
$(document).
|
554
|
+
$(document).ready(function () {
|
555
555
|
// Handle removal of static chips.
|
556
556
|
$(document.body).on('click', '.chip .close', function () {
|
557
557
|
var $chips = $(this).closest('.chips');
|
@@ -109,7 +109,12 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
109
109
|
}, {
|
110
110
|
key: '_removeEventHandlers',
|
111
111
|
value: function _removeEventHandlers() {
|
112
|
+
var _this3 = this;
|
113
|
+
|
112
114
|
this.el.removeEventListener('click', this._handleCollapsibleClickBound);
|
115
|
+
this.$headers.each(function (header) {
|
116
|
+
header.removeEventListener('keydown', _this3._handleCollapsibleKeydownBound);
|
117
|
+
});
|
113
118
|
}
|
114
119
|
|
115
120
|
/**
|
@@ -159,7 +164,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
159
164
|
}, {
|
160
165
|
key: '_animateIn',
|
161
166
|
value: function _animateIn(index) {
|
162
|
-
var
|
167
|
+
var _this4 = this;
|
163
168
|
|
164
169
|
var $collapsibleLi = this.$el.children('li').eq(index);
|
165
170
|
if ($collapsibleLi.length) {
|
@@ -198,8 +203,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
198
203
|
});
|
199
204
|
|
200
205
|
// onOpenEnd callback
|
201
|
-
if (typeof
|
202
|
-
|
206
|
+
if (typeof _this4.options.onOpenEnd === 'function') {
|
207
|
+
_this4.options.onOpenEnd.call(_this4, $collapsibleLi[0]);
|
203
208
|
}
|
204
209
|
}
|
205
210
|
});
|
@@ -214,7 +219,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
214
219
|
}, {
|
215
220
|
key: '_animateOut',
|
216
221
|
value: function _animateOut(index) {
|
217
|
-
var
|
222
|
+
var _this5 = this;
|
218
223
|
|
219
224
|
var $collapsibleLi = this.$el.children('li').eq(index);
|
220
225
|
if ($collapsibleLi.length) {
|
@@ -237,8 +242,8 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
237
242
|
});
|
238
243
|
|
239
244
|
// onCloseEnd callback
|
240
|
-
if (typeof
|
241
|
-
|
245
|
+
if (typeof _this5.options.onCloseEnd === 'function') {
|
246
|
+
_this5.options.onCloseEnd.call(_this5, $collapsibleLi[0]);
|
242
247
|
}
|
243
248
|
}
|
244
249
|
});
|
@@ -253,11 +258,10 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
253
258
|
}, {
|
254
259
|
key: 'open',
|
255
260
|
value: function open(index) {
|
256
|
-
var
|
261
|
+
var _this6 = this;
|
257
262
|
|
258
263
|
var $collapsibleLi = this.$el.children('li').eq(index);
|
259
264
|
if ($collapsibleLi.length && !$collapsibleLi[0].classList.contains('active')) {
|
260
|
-
|
261
265
|
// onOpenStart callback
|
262
266
|
if (typeof this.options.onOpenStart === 'function') {
|
263
267
|
this.options.onOpenStart.call(this, $collapsibleLi[0]);
|
@@ -269,7 +273,7 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
269
273
|
var $activeLis = this.$el.children('li.active');
|
270
274
|
$activeLis.each(function (el) {
|
271
275
|
var index = $collapsibleLis.index($(el));
|
272
|
-
|
276
|
+
_this6.close(index);
|
273
277
|
});
|
274
278
|
}
|
275
279
|
|
@@ -289,7 +293,6 @@ function _inherits(subClass, superClass) { if (typeof superClass !== "function"
|
|
289
293
|
value: function close(index) {
|
290
294
|
var $collapsibleLi = this.$el.children('li').eq(index);
|
291
295
|
if ($collapsibleLi.length && $collapsibleLi[0].classList.contains('active')) {
|
292
|
-
|
293
296
|
// onCloseStart callback
|
294
297
|
if (typeof this.options.onCloseStart === 'function') {
|
295
298
|
this.options.onCloseStart.call(this, $collapsibleLi[0]);
|