From 8b01066314f640ad96a030c29246f0d13b18b128 Mon Sep 17 00:00:00 2001 From: dongpd Date: Mon, 2 Nov 2020 17:23:08 +0700 Subject: [PATCH] =?UTF-8?q?update=20state=20button=20lu=C3=B4n=20=C4=91?= =?UTF-8?q?=C3=B3ng,=20lu=C3=B4n=20m=E1=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/device/doors.tpl | 4 ++-- web/js/device.js | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/views/device/doors.tpl b/views/device/doors.tpl index a7322231..d5b101a9 100644 --- a/views/device/doors.tpl +++ b/views/device/doors.tpl @@ -35,10 +35,10 @@ - - diff --git a/web/js/device.js b/web/js/device.js index 394d4cca..d8f593ae 100644 --- a/web/js/device.js +++ b/web/js/device.js @@ -557,6 +557,19 @@ function changeDuration(e) { $(".change-duration-" + id).removeClass("btn-warning").addClass("btn-default"); if (data.always_close || data.always_open) { $(e).removeClass("btn-default").addClass("btn-warning"); + if (data.always_close) { + $("#always-open-" + id).attr("disabled", true); + } + if (data.always_open) { + $("#always-close-" + id).attr("disabled", true); + } + } else { + if (!data.always_close) { + $("#always-open-" + id).attr("disabled", false); + } + if (!data.always_open) { + $("#always-close-" + id).attr("disabled", false); + } } notification.success("Đã lưu thông tin", 2000); },