pageSelectorをVanilla化
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
import { fetchGet } from './fetch';
|
||||
|
||||
export function pageSelector(el: Element) {
|
||||
if (!(el instanceof HTMLSelectElement)) return;
|
||||
el.addEventListener('change', function () {
|
||||
location.href = this.options[this.selectedIndex].dataset.href as string;
|
||||
});
|
||||
}
|
||||
|
||||
(function ($) {
|
||||
$.fn.linkCard = function (options) {
|
||||
const settings = $.extend(
|
||||
@@ -52,12 +59,6 @@ import { fetchGet } from './fetch';
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.pageSelector = function () {
|
||||
return this.on('change', function () {
|
||||
location.href = $(this).find(':selected').data('href');
|
||||
});
|
||||
};
|
||||
|
||||
$.fn.deleteCheckinModal = function () {
|
||||
return this.each(function () {
|
||||
$(this)
|
||||
|
||||
Reference in New Issue
Block a user