js2ts: processing - plugin 구조 마저 변경
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import $ from 'jquery';
|
||||
|
||||
export function loadPlugin(): void{
|
||||
export function colorSelect(): void{
|
||||
function changeNationColorPlate(){
|
||||
const $this = $('#colorType');
|
||||
const $option = $this.find('option:selected');
|
||||
@@ -13,8 +11,4 @@ export function loadPlugin(): void{
|
||||
changeNationColorPlate();
|
||||
});
|
||||
changeNationColorPlate();
|
||||
}
|
||||
|
||||
$(function(){
|
||||
loadPlugin();
|
||||
});
|
||||
}
|
||||
@@ -14,6 +14,8 @@ import { DataFormat, IdTextPair, OptionData } from 'select2';
|
||||
import { unwrap } from "./util/unwrap";
|
||||
import { defaultSelectCityByMap } from './defaultSelectCityByMap';
|
||||
import { defaultSelectNationByMap } from './defaultSelectNationByMap';
|
||||
import { colorSelect } from './colorSelect';
|
||||
import { recruitCrewForm } from './recruitCrewForm';
|
||||
|
||||
declare const isChiefTurn: boolean;
|
||||
declare const jsPlugins: string[];
|
||||
@@ -286,6 +288,8 @@ $(function ($) {
|
||||
const pluginMap:Record<string, ()=>void> = {
|
||||
'defaultSelectCityByMap': defaultSelectCityByMap,
|
||||
'defaultSelectNationByMap': defaultSelectNationByMap,
|
||||
'colorSelect': colorSelect,
|
||||
'recruitCrewForm': recruitCrewForm,
|
||||
};
|
||||
for (const jsPlugin of jsPlugins) {
|
||||
if (jsPlugin in pluginMap) {
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import $ from 'jquery';
|
||||
import { unwrap_any } from './util/unwrap_any';
|
||||
|
||||
|
||||
@@ -21,7 +20,7 @@ function calc(id: number) {
|
||||
$cost.val(Math.round(cost));
|
||||
}
|
||||
|
||||
$(function () {
|
||||
export function recruitCrewForm(): void {
|
||||
const $formAmount = $('#amount');
|
||||
const $formCrewtype = $('#crewType');
|
||||
$('.form_double').on('keyup change', function (e) {
|
||||
@@ -101,4 +100,4 @@ $(function () {
|
||||
}
|
||||
});
|
||||
$('.show_default_false').hide();
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user