Skip to content

Commit af05341

Browse files
committed
refactor(select): removed jquery and fixed test
1 parent bc5ad9d commit af05341

File tree

4 files changed

+189
-174
lines changed

4 files changed

+189
-174
lines changed

docs/js/materialize.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datepicker.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Component } from "./component";
22
import { M } from "./global";
33
import { Modal } from "./modal";
4+
import { FormSelect } from "./select";
45

56
let _defaults = {
67
// Close when date is selected
@@ -207,11 +208,11 @@ let _defaults = {
207208
destroySelects() {
208209
let oldYearSelect = this.calendarEl.querySelector('.orig-select-year');
209210
if (oldYearSelect) {
210-
M.FormSelect.getInstance(oldYearSelect).destroy();
211+
FormSelect.getInstance(oldYearSelect).destroy();
211212
}
212213
let oldMonthSelect = this.calendarEl.querySelector('.orig-select-month');
213214
if (oldMonthSelect) {
214-
M.FormSelect.getInstance(oldMonthSelect).destroy();
215+
FormSelect.getInstance(oldMonthSelect).destroy();
215216
}
216217
}
217218

@@ -657,11 +658,11 @@ let _defaults = {
657658
// Init Materialize Select
658659
let yearSelect = this.calendarEl.querySelector('.orig-select-year');
659660
let monthSelect = this.calendarEl.querySelector('.orig-select-month');
660-
M.FormSelect.init(yearSelect, {
661+
FormSelect.init(yearSelect, {
661662
classes: 'select-year',
662663
dropdownOptions: { container: document.body, constrainWidth: false }
663664
});
664-
M.FormSelect.init(monthSelect, {
665+
FormSelect.init(monthSelect, {
665666
classes: 'select-month',
666667
dropdownOptions: { container: document.body, constrainWidth: false }
667668
});

0 commit comments

Comments
 (0)