40 lines
1.1 KiB

3 years ago
var EditLineWidth = function (parent) {
this.Parent = parent;
this.Dialog = $('#edit-line-width-dialog');
3 years ago
this.Config = {};
3 years ago
this.Setup = function () {
$("#width-sure-btn").on("click", this.OnSureButtonClick.bind(this));
$("#width-cancel-btn").on("click", this.HideDialog.bind(this));
$("#width-close").on("click", this.HideDialog.bind(this));
};
this.Show = function (data) {
this.Dialog.show();
3 years ago
console.log(data)
this.Config = data;
3 years ago
$("#width").textbox('setValue', data.Value);
};
this.OnSureButtonClick = function () {
3 years ago
this.Config.Value = $('#width').textbox('getValue');
this.UpdateLineWidth();
3 years ago
this.Dialog.hide();
};
3 years ago
this.UpdateLineWidth = function () {
$.ajax({
type: "POST",
dataType: 'text',
url: '/ConfigManagement/Update',
data: this.User,
success: function () {
this.Parent.ReLoadTableData();
}.bind(this)
});
};
3 years ago
this.HideDialog = function () {
this.Dialog.hide();
};
};