You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.3 KiB

3 years ago
var EditLocateIcon = function (parent) {
this.Parent = parent;
this.Dialog = $('#edit-locate-icon-dialog');
3 years ago
this.LocateIcon = {};
3 years ago
this.Setup = function () {
$('#file').on('change', this.onFileChange.bind(this))
$("#icon-sure-btn").on("click", this.OnSureButtonClick.bind(this));
$("#icon-cancel-btn").on("click", this.HideDialog.bind(this));
$("#icon-close").on("click", this.HideDialog.bind(this));
};
this.Show = function (data) {
this.Dialog.show();
3 years ago
this.LocateIcon = data;
$("#path").textbox('setValue', data.Value);
3 years ago
};
3 years ago
this.onFileChange = function (event) {
$("#path").textbox('setValue', event.target.files[0].name);
3 years ago
};
this.OnSureButtonClick = function () {
3 years ago
this.LocateIcon.Value = $('#path').textbox('getValue');
this.UpdateLocateIcon();
3 years ago
this.Dialog.hide();
3 years ago
this.Parent.DisabledEvent();
};
this.UpdateLocateIcon = function () {
$.ajax({
type: "POST",
dataType: 'text',
url: '/ConfigManagement/Update',
data: this.LocateIcon,
success: function () {
this.Parent.ReLoadTableData();
}.bind(this)
});
3 years ago
};
this.HideDialog = function () {
this.Dialog.hide();
};
};