Thêm nút Luôn mở + luôn đóng
This commit is contained in:
@@ -544,4 +544,25 @@ function editDoor(e) {
|
||||
alert("Thời gian mở cửa phải từ 1-254 giây");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
function changeDuration(e) {
|
||||
common.modalBlock(true);
|
||||
$.ajax({
|
||||
url: $(e).attr('data-href'),
|
||||
type: 'POST',
|
||||
success: function (data) {
|
||||
common.modalBlock(false);
|
||||
var id = parseInt(data.id);
|
||||
$(".change-duration-" + id).removeClass("btn-warning").addClass("btn-default");
|
||||
$(e).removeClass("btn-default").addClass("btn-warning");
|
||||
$("#duration-text-" + id).html(data.duration);
|
||||
$("#duration-input-" + id).val(data.duration);
|
||||
notification.success("Đã lưu thông tin", 2000);
|
||||
},
|
||||
error: function (jqXHR, textStatus, errorThrown) {
|
||||
common.modalBlock(false);
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user