commonui-lib-test
Version:
"#common ui lib test"
38 lines (37 loc) • 1.59 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Dialog_Basic_1 = require("./Dialog_Basic");
const dialogLanguageAni_1 = require("../../ui/common/dialogLanguageAni");
const StorageHandler_1 = require("../handler/common/StorageHandler");
class Dialog_Language extends Dialog_Basic_1.default {
constructor() {
super();
this.view = dialogLanguageAni_1.default.createInstance();
this.getLocalSetting();
}
onInit() {
this.closeButton = this.view.comDialogLanguage.btnCancel;
this.view.comDialogLanguage.btnConfirm.onClick(this, this.onRightBtn);
this.view.comDialogLanguage.btnCancel.onClick(this, this.onLeftBtn);
this.setBtnEvent(null, this.onBtnOkEvent, this.onBtnNoEvent, this);
super.onInit();
}
getLocalSetting() {
this.currlang = StorageHandler_1.StorageHandler.getLanguage();
this.view.comDialogLanguage.comLanguageDropbox.value = this.currlang;
}
onBtnOkEvent() {
let selectLang = this.view.comDialogLanguage.comLanguageDropbox.value;
if (selectLang === this.currlang)
return;
this.currlang = StorageHandler_1.StorageHandler.setLanguage(selectLang);
window.location.reload();
}
onBtnNoEvent() {
let selectLang = this.view.comDialogLanguage.comLanguageDropbox.value;
if (selectLang === this.currlang)
return;
this.view.comDialogLanguage.comLanguageDropbox.value = this.currlang;
}
}
exports.default = Dialog_Language;