materialize-sass 1.0.0.alpha1 → 1.0.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/javascripts/materialize-sprockets.js +1 -1
- data/assets/javascripts/materialize.js +1162 -1218
- data/assets/javascripts/materialize/anime.min.js +417 -0
- data/assets/javascripts/materialize/buttons.js +49 -26
- data/assets/javascripts/materialize/cards.js +14 -8
- data/assets/javascripts/materialize/cash.js +3 -5
- data/assets/javascripts/materialize/chips.js +22 -19
- data/assets/javascripts/materialize/collapsible.js +53 -17
- data/assets/javascripts/materialize/datepicker.js +94 -78
- data/assets/javascripts/materialize/dropdown.js +33 -26
- 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 +17 -6
- data/assets/javascripts/materialize/global.js +17 -15
- data/assets/javascripts/materialize/materialbox.js +62 -35
- data/assets/javascripts/materialize/modal.js +50 -19
- data/assets/javascripts/materialize/range.js +40 -16
- data/assets/javascripts/materialize/scrollspy.js +9 -3
- data/assets/javascripts/materialize/select.js +62 -38
- data/assets/javascripts/materialize/sidenav.js +52 -18
- data/assets/javascripts/materialize/slider.js +56 -16
- data/assets/javascripts/materialize/tabs.js +35 -23
- data/assets/javascripts/materialize/timepicker.js +581 -579
- data/assets/javascripts/materialize/toasts.js +11 -7
- data/assets/javascripts/materialize/tooltip.js +16 -18
- data/assets/stylesheets/materialize.scss +3 -3
- data/assets/stylesheets/materialize/components/_buttons.scss +2 -2
- data/assets/stylesheets/materialize/components/_color-classes.scss +32 -0
- data/assets/stylesheets/materialize/components/{_color.scss → _color-variables.scss} +0 -42
- data/assets/stylesheets/materialize/components/_datepicker.scss +10 -4
- data/assets/stylesheets/materialize/components/_dropdown.scss +5 -0
- data/assets/stylesheets/materialize/components/_navbar.scss +3 -3
- data/assets/stylesheets/materialize/components/_pulse.scss +1 -1
- data/assets/stylesheets/materialize/components/_timepicker.scss +1 -0
- data/assets/stylesheets/materialize/components/_variables.scss +0 -1
- data/assets/stylesheets/materialize/components/forms/_input-fields.scss +6 -4
- data/assets/stylesheets/materialize/components/forms/_range.scss +3 -3
- data/assets/stylesheets/materialize/components/forms/_select.scss +7 -7
- data/assets/stylesheets/materialize/extras/nouislider.css +1 -1
- data/lib/materialize-sass/engine.rb +2 -0
- data/lib/materialize-sass/helpers.rb +38 -0
- data/lib/materialize-sass/version.rb +1 -1
- metadata +6 -5
- data/assets/javascripts/materialize/velocity.min.js +0 -782
- data/assets/stylesheets/materialize/components/_mixins.scss +0 -5
@@ -1,4 +1,4 @@
|
|
1
|
-
(function ($,
|
1
|
+
(function ($, anim) {
|
2
2
|
$(document).on('click', '.card', function (e) {
|
3
3
|
if ($(this).children('.card-reveal').length) {
|
4
4
|
var $card = $(e.target).closest('.card');
|
@@ -8,21 +8,27 @@
|
|
8
8
|
var $cardReveal = $(this).find('.card-reveal');
|
9
9
|
if ($(e.target).is($('.card-reveal .card-title')) || $(e.target).is($('.card-reveal .card-title i'))) {
|
10
10
|
// Make Reveal animate down and display none
|
11
|
-
|
11
|
+
anim({
|
12
|
+
targets: $cardReveal[0],
|
13
|
+
translateY: 0,
|
12
14
|
duration: 225,
|
13
|
-
queue: false,
|
14
15
|
easing: 'easeInOutQuad',
|
15
|
-
complete: function () {
|
16
|
-
|
16
|
+
complete: function (anim) {
|
17
|
+
var el = anim.animatables[0].target;
|
18
|
+
$(el).css({ display: 'none' });
|
17
19
|
$card.css('overflow', $card.data('initialOverflow'));
|
18
20
|
}
|
19
21
|
});
|
20
22
|
} else if ($(e.target).is($('.card .activator')) || $(e.target).is($('.card .activator i'))) {
|
21
23
|
$card.css('overflow', 'hidden');
|
22
24
|
$cardReveal.css({ display: 'block' });
|
23
|
-
|
24
|
-
|
25
|
+
anim({
|
26
|
+
targets: $cardReveal[0],
|
27
|
+
translateY: '-100%',
|
28
|
+
duration: 300,
|
29
|
+
easing: 'easeInOutQuad'
|
30
|
+
});
|
25
31
|
}
|
26
32
|
}
|
27
33
|
});
|
28
|
-
})(cash, M.
|
34
|
+
})(cash, M.anime);
|
@@ -32,7 +32,7 @@
|
|
32
32
|
var frag;
|
33
33
|
function parseHTML(str) {
|
34
34
|
if (!frag) {
|
35
|
-
frag = doc.implementation.createHTMLDocument();
|
35
|
+
frag = doc.implementation.createHTMLDocument(null);
|
36
36
|
var base = frag.createElement("base");
|
37
37
|
base.href = doc.location.href;
|
38
38
|
frag.head.appendChild(base);
|
@@ -558,9 +558,7 @@
|
|
558
558
|
|
559
559
|
on: function (eventName, delegate, callback, runOnce) {
|
560
560
|
// jshint ignore:line
|
561
|
-
|
562
561
|
var originalCallback;
|
563
|
-
|
564
562
|
if (!isString(eventName)) {
|
565
563
|
for (var key in eventName) {
|
566
564
|
this.on(key, delegate, eventName[key]);
|
@@ -582,11 +580,11 @@
|
|
582
580
|
originalCallback = callback;
|
583
581
|
callback = function (e) {
|
584
582
|
var t = e.target;
|
585
|
-
|
586
583
|
while (!matches(t, delegate)) {
|
587
|
-
if (t === this) {
|
584
|
+
if (t === this || t === null) {
|
588
585
|
return t = false;
|
589
586
|
}
|
587
|
+
|
590
588
|
t = t.parentNode;
|
591
589
|
}
|
592
590
|
|
@@ -2,7 +2,7 @@ var _createClass = function () { function defineProperties(target, props) { for
|
|
2
2
|
|
3
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
4
4
|
|
5
|
-
(function (
|
5
|
+
(function ($) {
|
6
6
|
'use strict';
|
7
7
|
|
8
8
|
var _defaults = {
|
@@ -59,8 +59,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
59
59
|
this.$el.addClass('chips input-field');
|
60
60
|
this.chipsData = [];
|
61
61
|
this.$chips = $();
|
62
|
-
this
|
63
|
-
this.$input.addClass('input');
|
62
|
+
this._setupInput();
|
64
63
|
this.hasAutocomplete = Object.keys(this.options.autocompleteOptions).length > 0;
|
65
64
|
|
66
65
|
// Set input id
|
@@ -272,7 +271,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
272
271
|
}
|
273
272
|
|
274
273
|
// move input to end
|
275
|
-
this.$el.append(this.$input);
|
274
|
+
this.$el.append(this.$input[0]);
|
276
275
|
}
|
277
276
|
|
278
277
|
/**
|
@@ -293,6 +292,22 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
293
292
|
this.autocomplete = M.Autocomplete.init(this.$input, this.options.autocompleteOptions)[0];
|
294
293
|
}
|
295
294
|
|
295
|
+
/**
|
296
|
+
* Setup Input
|
297
|
+
*/
|
298
|
+
|
299
|
+
}, {
|
300
|
+
key: '_setupInput',
|
301
|
+
value: function _setupInput() {
|
302
|
+
this.$input = this.$el.find('input');
|
303
|
+
if (!this.$input.length) {
|
304
|
+
this.$input = $('<input></input>');
|
305
|
+
this.$el.append(this.$input);
|
306
|
+
}
|
307
|
+
|
308
|
+
this.$input.addClass('input');
|
309
|
+
}
|
310
|
+
|
296
311
|
/**
|
297
312
|
* Setup Label
|
298
313
|
*/
|
@@ -374,7 +389,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
374
389
|
}, {
|
375
390
|
key: 'deleteChip',
|
376
391
|
value: function deleteChip(chipIndex) {
|
377
|
-
|
392
|
+
var $chip = this.$chips.eq(chipIndex);
|
378
393
|
this.$chips.eq(chipIndex).remove();
|
379
394
|
this.$chips = this.$chips.filter(function (el) {
|
380
395
|
return $(el).index() >= 0;
|
@@ -384,7 +399,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
384
399
|
|
385
400
|
// fire chipDelete callback
|
386
401
|
if (typeof this.options.onChipDelete === 'function') {
|
387
|
-
this.options.onChipDelete.call(this, this.$el,
|
402
|
+
this.options.onChipDelete.call(this, this.$el, $chip[0]);
|
388
403
|
}
|
389
404
|
}
|
390
405
|
|
@@ -402,21 +417,9 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
402
417
|
|
403
418
|
// fire chipSelect callback
|
404
419
|
if (typeof this.options.onChipSelect === 'function') {
|
405
|
-
this.options.onChipSelect.call(this, this.$el,
|
420
|
+
this.options.onChipSelect.call(this, this.$el, $chip[0]);
|
406
421
|
}
|
407
422
|
}
|
408
|
-
|
409
|
-
/**
|
410
|
-
* Deselect chip
|
411
|
-
* @param {Number} chip
|
412
|
-
*/
|
413
|
-
|
414
|
-
}, {
|
415
|
-
key: 'deselectChip',
|
416
|
-
value: function deselectChip(chipIndex) {
|
417
|
-
var $chip = this.$chips.eq(chipIndex);
|
418
|
-
this._selectedChip = null;
|
419
|
-
}
|
420
423
|
}], [{
|
421
424
|
key: 'init',
|
422
425
|
value: function init($els, options) {
|
@@ -2,7 +2,7 @@ var _createClass = function () { function defineProperties(target, props) { for
|
|
2
2
|
|
3
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
4
4
|
|
5
|
-
(function ($,
|
5
|
+
(function ($, anim) {
|
6
6
|
'use strict';
|
7
7
|
|
8
8
|
var _defaults = {
|
@@ -137,19 +137,45 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
137
137
|
var $collapsibleLi = this.$el.children('li').eq(index);
|
138
138
|
if ($collapsibleLi.length) {
|
139
139
|
var $body = $collapsibleLi.children('.collapsible-body');
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
140
|
+
|
141
|
+
anim.remove($body[0]);
|
142
|
+
$body.css({
|
143
|
+
display: 'block',
|
144
|
+
overflow: 'hidden',
|
145
|
+
height: 0,
|
146
|
+
paddingTop: '',
|
147
|
+
paddingBottom: ''
|
148
|
+
});
|
149
|
+
|
150
|
+
var pTop = $body.css('padding-top');
|
151
|
+
var pBottom = $body.css('padding-bottom');
|
152
|
+
var finalHeight = $body[0].scrollHeight;
|
153
|
+
$body.css({
|
154
|
+
paddingTop: 0,
|
155
|
+
paddingBottom: 0
|
156
|
+
});
|
157
|
+
|
158
|
+
anim({
|
159
|
+
targets: $body[0],
|
160
|
+
height: finalHeight,
|
161
|
+
paddingTop: pTop,
|
162
|
+
paddingBottom: pBottom,
|
163
|
+
duration: this.options.inDuration,
|
164
|
+
easing: 'easeInOutCubic',
|
165
|
+
complete: function (anim) {
|
166
|
+
$body.css({
|
167
|
+
overflow: '',
|
168
|
+
paddingTop: '',
|
169
|
+
paddingBottom: '',
|
170
|
+
height: ''
|
171
|
+
});
|
147
172
|
|
148
173
|
// onOpenEnd callback
|
149
174
|
if (typeof _this.options.onOpenEnd === 'function') {
|
150
175
|
_this.options.onOpenEnd.call(_this, $collapsibleLi[0]);
|
151
176
|
}
|
152
|
-
}
|
177
|
+
}
|
178
|
+
});
|
153
179
|
}
|
154
180
|
}
|
155
181
|
|
@@ -166,19 +192,29 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
166
192
|
var $collapsibleLi = this.$el.children('li').eq(index);
|
167
193
|
if ($collapsibleLi.length) {
|
168
194
|
var $body = $collapsibleLi.children('.collapsible-body');
|
169
|
-
|
170
|
-
|
195
|
+
anim.remove($body[0]);
|
196
|
+
$body.css('overflow', 'hidden');
|
197
|
+
anim({
|
198
|
+
targets: $body[0],
|
199
|
+
height: 0,
|
200
|
+
paddingTop: 0,
|
201
|
+
paddingBottom: 0,
|
202
|
+
duration: this.options.outDuration,
|
203
|
+
easing: 'easeInOutCubic',
|
171
204
|
complete: function () {
|
172
|
-
$body
|
173
|
-
|
174
|
-
|
175
|
-
|
205
|
+
$body.css({
|
206
|
+
height: '',
|
207
|
+
overflow: '',
|
208
|
+
padding: '',
|
209
|
+
display: ''
|
210
|
+
});
|
176
211
|
|
177
212
|
// onCloseEnd callback
|
178
213
|
if (typeof _this2.options.onCloseEnd === 'function') {
|
179
214
|
_this2.options.onCloseEnd.call(_this2, $collapsibleLi[0]);
|
180
215
|
}
|
181
|
-
}
|
216
|
+
}
|
217
|
+
});
|
182
218
|
}
|
183
219
|
}
|
184
220
|
|
@@ -272,4 +308,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
272
308
|
if (M.jQueryLoaded) {
|
273
309
|
M.initializeJqueryWrapper(Collapsible, 'collapsible', 'M_Collapsible');
|
274
310
|
}
|
275
|
-
})(cash, M.
|
311
|
+
})(cash, M.anime);
|
@@ -2,17 +2,13 @@ var _createClass = function () { function defineProperties(target, props) { for
|
|
2
2
|
|
3
3
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
4
4
|
|
5
|
-
(function (
|
5
|
+
(function ($) {
|
6
6
|
'use strict';
|
7
7
|
|
8
8
|
var _defaults = {
|
9
9
|
|
10
10
|
// the default output format for the input field value
|
11
|
-
format: '
|
12
|
-
|
13
|
-
// the toString function which gets passed a current date object and format
|
14
|
-
// and returns a string
|
15
|
-
toString: null,
|
11
|
+
format: 'mmm dd, yyyy',
|
16
12
|
|
17
13
|
// Used to create date object from current input string
|
18
14
|
parse: null,
|
@@ -108,6 +104,10 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
108
104
|
|
109
105
|
this.options = $.extend({}, Datepicker.defaults, options);
|
110
106
|
|
107
|
+
// Remove time component from minDate and maxDate options
|
108
|
+
if (this.options.minDate) this.options.minDate.setHours(0, 0, 0, 0);
|
109
|
+
if (this.options.maxDate) this.options.maxDate.setHours(0, 0, 0, 0);
|
110
|
+
|
111
111
|
this.id = M.guid();
|
112
112
|
|
113
113
|
this._setupVariables();
|
@@ -177,14 +177,22 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
177
177
|
}, {
|
178
178
|
key: 'toString',
|
179
179
|
value: function toString(format) {
|
180
|
+
var _this2 = this;
|
181
|
+
|
180
182
|
format = format || this.options.format;
|
181
183
|
if (!Datepicker._isDate(this.date)) {
|
182
184
|
return '';
|
183
185
|
}
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
186
|
+
|
187
|
+
var formatArray = format.split(/(d{1,4}|m{1,4}|y{4}|yy|!.)/g);
|
188
|
+
var formattedDate = formatArray.map(function (label) {
|
189
|
+
if (_this2.formats[label]) {
|
190
|
+
return _this2.formats[label]();
|
191
|
+
} else {
|
192
|
+
return label;
|
193
|
+
}
|
194
|
+
}).join('');
|
195
|
+
return formattedDate;
|
188
196
|
}
|
189
197
|
}, {
|
190
198
|
key: 'setDate',
|
@@ -218,7 +226,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
218
226
|
this.gotoDate(this.date);
|
219
227
|
|
220
228
|
if (!preventOnSelect && typeof this.options.onSelect === 'function') {
|
221
|
-
this.options.onSelect.call(this, this.
|
229
|
+
this.options.onSelect.call(this, this.date);
|
222
230
|
}
|
223
231
|
}
|
224
232
|
}, {
|
@@ -473,7 +481,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
473
481
|
arr.push('<option value="' + (year === refYear ? i - c : 12 + i - c) + '"' + (i === month ? ' selected="selected"' : '') + (isMinYear && i < opts.minMonth || isMaxYear && i > opts.maxMonth ? 'disabled="disabled"' : '') + '>' + opts.i18n.months[i] + '</option>');
|
474
482
|
}
|
475
483
|
|
476
|
-
// monthHtml = '<div class="pika-label">' + opts.i18n.months[month] + '<select class="pika-select pika-select-month" tabindex="-1">' + arr.join('') + '</select></div>';
|
477
484
|
monthHtml = '<select class="pika-select pika-select-month" tabindex="-1">' + arr.join('') + '</select>';
|
478
485
|
|
479
486
|
if ($.isArray(opts.yearRange)) {
|
@@ -489,7 +496,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
489
496
|
arr.push('<option value="' + i + '"' + (i === year ? ' selected="selected"' : '') + '>' + i + '</option>');
|
490
497
|
}
|
491
498
|
}
|
492
|
-
|
499
|
+
|
493
500
|
yearHtml = '<select class="pika-select pika-select-year" tabindex="-1">' + arr.join('') + '</select>';
|
494
501
|
|
495
502
|
var leftArrow = '<svg fill="#000000" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"/><path d="M0-.5h24v24H0z" fill="none"/></svg>';
|
@@ -560,8 +567,14 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
560
567
|
this.calendarEl.innerHTML = html;
|
561
568
|
|
562
569
|
// Init Materialize Select
|
563
|
-
|
564
|
-
|
570
|
+
var yearSelect = this.calendarEl.querySelector('.pika-select-year');
|
571
|
+
var monthSelect = this.calendarEl.querySelector('.pika-select-month');
|
572
|
+
new M.Select(yearSelect, { classes: 'select-year' });
|
573
|
+
new M.Select(monthSelect, { classes: 'select-month' });
|
574
|
+
|
575
|
+
// Add change handlers for select
|
576
|
+
yearSelect.addEventListener('change', this._handleYearChange.bind(this));
|
577
|
+
monthSelect.addEventListener('change', this._handleMonthChange.bind(this));
|
565
578
|
|
566
579
|
if (typeof this.options.onDraw === 'function') {
|
567
580
|
this.options.onDraw(this);
|
@@ -582,6 +595,7 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
582
595
|
this._finishSelectionBound = this._finishSelection.bind(this);
|
583
596
|
this._handleTodayClickBound = this._handleTodayClick.bind(this);
|
584
597
|
this._handleClearClickBound = this._handleClearClick.bind(this);
|
598
|
+
this._handleMonthChange = this._handleMonthChange.bind(this);
|
585
599
|
|
586
600
|
this.el.addEventListener('click', this._handleInputClickBound);
|
587
601
|
this.el.addEventListener('keydown', this._handleInputKeydownBound);
|
@@ -594,6 +608,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
594
608
|
}, {
|
595
609
|
key: '_setupVariables',
|
596
610
|
value: function _setupVariables() {
|
611
|
+
var _this3 = this;
|
612
|
+
|
597
613
|
this.$modalEl = $(Datepicker._template);
|
598
614
|
this.modalEl = this.$modalEl[0];
|
599
615
|
|
@@ -604,6 +620,34 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
604
620
|
this.clearBtn = this.modalEl.querySelector('.datepicker-clear');
|
605
621
|
this.todayBtn = this.modalEl.querySelector('.datepicker-today');
|
606
622
|
this.doneBtn = this.modalEl.querySelector('.datepicker-done');
|
623
|
+
|
624
|
+
this.formats = {
|
625
|
+
|
626
|
+
dd: function () {
|
627
|
+
return _this3.date.getDate();
|
628
|
+
},
|
629
|
+
ddd: function () {
|
630
|
+
return _this3.options.i18n.weekdaysShort[_this3.date.getDay()];
|
631
|
+
},
|
632
|
+
dddd: function () {
|
633
|
+
return _this3.options.i18n.weekdays[_this3.date.getDay()];
|
634
|
+
},
|
635
|
+
mm: function () {
|
636
|
+
return _this3.date.getMonth() + 1;
|
637
|
+
},
|
638
|
+
mmm: function () {
|
639
|
+
return _this3.options.i18n.monthsShort[_this3.date.getMonth()];
|
640
|
+
},
|
641
|
+
mmmm: function () {
|
642
|
+
return _this3.options.i18n.monthsShort[_this3.date.getMonth()];
|
643
|
+
},
|
644
|
+
yy: function () {
|
645
|
+
return _this3.date.getFullYear().slice(2);
|
646
|
+
},
|
647
|
+
yyyy: function () {
|
648
|
+
return _this3.date.getFullYear();
|
649
|
+
}
|
650
|
+
};
|
607
651
|
}
|
608
652
|
|
609
653
|
/**
|
@@ -674,50 +718,42 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
674
718
|
this.setInputValue();
|
675
719
|
this.close();
|
676
720
|
}
|
721
|
+
}, {
|
722
|
+
key: '_handleMonthChange',
|
723
|
+
value: function _handleMonthChange(e) {
|
724
|
+
this.gotoMonth(e.target.value);
|
725
|
+
}
|
726
|
+
}, {
|
727
|
+
key: '_handleYearChange',
|
728
|
+
value: function _handleYearChange(e) {
|
729
|
+
this.gotoYear(e.target.value);
|
730
|
+
}
|
677
731
|
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
// if (self.isVisible()) {
|
696
|
-
|
697
|
-
// switch(e.keyCode){
|
698
|
-
// case 13:
|
699
|
-
// case 27:
|
700
|
-
// if (opts.field) {
|
701
|
-
// opts.field.blur();
|
702
|
-
// }
|
703
|
-
// break;
|
704
|
-
// case 37:
|
705
|
-
// e.preventDefault();
|
706
|
-
// self.adjustDate('subtract', 1);
|
707
|
-
// break;
|
708
|
-
// case 38:
|
709
|
-
// self.adjustDate('subtract', 7);
|
710
|
-
// break;
|
711
|
-
// case 39:
|
712
|
-
// self.adjustDate('add', 1);
|
713
|
-
// break;
|
714
|
-
// case 40:
|
715
|
-
// self.adjustDate('add', 7);
|
716
|
-
// break;
|
717
|
-
// }
|
718
|
-
// }
|
719
|
-
// }
|
732
|
+
/**
|
733
|
+
* change view to a specific month (zero-index, e.g. 0: January)
|
734
|
+
*/
|
735
|
+
|
736
|
+
}, {
|
737
|
+
key: 'gotoMonth',
|
738
|
+
value: function gotoMonth(month) {
|
739
|
+
if (!isNaN(month)) {
|
740
|
+
this.calendars[0].month = parseInt(month, 10);
|
741
|
+
this.adjustCalendars();
|
742
|
+
}
|
743
|
+
}
|
744
|
+
|
745
|
+
/**
|
746
|
+
* change view to a specific full year (e.g. "2012")
|
747
|
+
*/
|
720
748
|
|
749
|
+
}, {
|
750
|
+
key: 'gotoYear',
|
751
|
+
value: function gotoYear(year) {
|
752
|
+
if (!isNaN(year)) {
|
753
|
+
this.calendars[0].year = parseInt(year, 10);
|
754
|
+
this.adjustCalendars();
|
755
|
+
}
|
756
|
+
}
|
721
757
|
}, {
|
722
758
|
key: '_handleInputChange',
|
723
759
|
value: function _handleInputChange(e) {
|
@@ -740,26 +776,6 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
740
776
|
// self.show();
|
741
777
|
// }
|
742
778
|
}
|
743
|
-
|
744
|
-
// _onInputBlur() {
|
745
|
-
// // IE allows pika div to gain focus; catch blur the input field
|
746
|
-
// let pEl = document.activeElement;
|
747
|
-
// do {
|
748
|
-
// if (hasClass(pEl, 'pika-single')) {
|
749
|
-
// return;
|
750
|
-
// }
|
751
|
-
// }
|
752
|
-
// while ((pEl = pEl.parentNode));
|
753
|
-
|
754
|
-
// if (!self._c) {
|
755
|
-
// self._b = sto(function() {
|
756
|
-
// self.hide();
|
757
|
-
// }, 50);
|
758
|
-
// }
|
759
|
-
// self._c = false;
|
760
|
-
// }
|
761
|
-
|
762
|
-
|
763
779
|
}, {
|
764
780
|
key: 'renderDayName',
|
765
781
|
value: function renderDayName(opts, day, abbr) {
|
@@ -895,4 +911,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
|
|
895
911
|
if (M.jQueryLoaded) {
|
896
912
|
M.initializeJqueryWrapper(Datepicker, 'datepicker', 'M_Datepicker');
|
897
913
|
}
|
898
|
-
})(cash
|
914
|
+
})(cash);
|