diff --git a/web/js/area.js b/web/js/area.js
index 9ab02a31..184d01e7 100644
--- a/web/js/area.js
+++ b/web/js/area.js
@@ -1,5 +1,8 @@
$(function () {
common.checkboxInit("area");
+ $("#area-list").on('pjax:success', function () {
+ common.checkboxInit("area");
+ });
});
function validate() {
diff --git a/web/js/card-register.js b/web/js/card-register.js
index 7c45e517..c7763252 100644
--- a/web/js/card-register.js
+++ b/web/js/card-register.js
@@ -1,5 +1,8 @@
$(function () {
common.checkboxInit("staff");
+ $("#staff-list").on('pjax:success', function () {
+ common.checkboxInit("staff");
+ });
});
function validate() {
diff --git a/web/js/common.js b/web/js/common.js
index 30139809..e2c9625b 100644
--- a/web/js/common.js
+++ b/web/js/common.js
@@ -25,7 +25,10 @@ common.modalOpen = function (data, lg, title) {
$("#myModalLabel").html(title);
}
$("#myModalFooter").addClass("hidden");
- $("#myModal").modal();
+ $("#myModal").modal({
+ keyboard: false,
+ backdrop: false
+ });
};
common.modalOpenFullScreen = function (data, title) {
$("input[name='ReLoadFullScreen']").val("false");
diff --git a/web/js/department.js b/web/js/department.js
index 486b07d7..1a7df1f2 100644
--- a/web/js/department.js
+++ b/web/js/department.js
@@ -1,6 +1,9 @@
$(function () {
common.checkboxInit("department");
btnUpload($("input[name='upload_file_url']").val(), "", '.xls,.xlsx', 3500);
+ $("#department-list").on('pjax:success', function () {
+ common.checkboxInit("department");
+ });
});
function validate() {
diff --git a/web/js/device.js b/web/js/device.js
index 472d23f4..93e50cc1 100644
--- a/web/js/device.js
+++ b/web/js/device.js
@@ -1,5 +1,8 @@
$(function () {
common.checkboxInit("device");
+ $("#device-list").on('pjax:success', function () {
+ common.checkboxInit("device");
+ });
});
function validate() {
@@ -291,6 +294,21 @@ function getDataSync(data) {
var html = "";
html = " Bắt đầu đồng bộ dữ liệu tới thiết bị " + data.IP + ".
";
$("#logs-response").append(html);
+ if (data.schedule.length == 0 && data.staffs.length == 0) {
+ var html = "";
+ html = " Không có dữ liệu cần đồng bộ tới thiết bị " + data.IP + ".
";
+ $("#logs-response").append(html);
+ progress += 2;
+ var percent = parseInt(progress / totals * 100);
+ $("#progress").attr("aria-valuenow", percent);
+ $("#progress").attr("style", "width: " + percent + "%");
+ $("#progress").html(percent + "%");
+ if (percent >= 100) {
+ progress = 0;
+ $("#close-modal").attr("disabled", false);
+ }
+ return;
+ }
syncSchedule(data.schedule, data.staffs, data.IP);
},
error: function (jqXHR, textStatus, errorThrown) {
diff --git a/web/js/schedule.js b/web/js/schedule.js
index 46c42db5..5eaf0a60 100644
--- a/web/js/schedule.js
+++ b/web/js/schedule.js
@@ -1,5 +1,8 @@
$(function () {
common.checkboxInit("schedule");
+ $("#schedule-list").on('pjax:success', function () {
+ common.checkboxInit("schedule");
+ });
});
function _create(e) {
diff --git a/web/js/staff.js b/web/js/staff.js
index 0df25335..fc1c9af5 100644
--- a/web/js/staff.js
+++ b/web/js/staff.js
@@ -1,6 +1,9 @@
$(function () {
common.checkboxInit("staff");
btnUpload($("input[name='upload_file_url']").val(), "", '.xls,.xlsx', 3500);
+ $("#staff-list").on('pjax:success', function () {
+ common.checkboxInit("staff");
+ });
});
function validate() {