update thu gọn danh sách cửa khi cấp quyền truy cập
This commit is contained in:
@@ -92,8 +92,17 @@ schedule.setSchedule = function (e) {
|
||||
notification.success("Đã lưu thông tin", 1000);
|
||||
$.each($("input[name='checkbox-staff-schedule']:checked"), function () {
|
||||
if ($(this).val() !== "0") {
|
||||
$("#schedule-staff-results-" + $(this).val()).html(data.schedule);
|
||||
$("#schedule-door-results-" + $(this).val()).html(data.doors);
|
||||
var id = $(this).val();
|
||||
$("#schedule-staff-results-" + id).html(data.schedule);
|
||||
var alert = "";
|
||||
var hidden = "";
|
||||
if (data.doors.length <= 2) {
|
||||
alert = "<div id='short-{$model->id}'>" + data.doors.join("<br>") + "</div>";
|
||||
} else {
|
||||
alert = "<div id='short-" + id + "'>" + data.doors[0] + "<br>" + data.doors[1] + "<a href='#' onclick='openDoorList(this, true);return false;' data='" + id + "'><i class='fa fa-chevron-down'></i> Xem thêm</a></div>";
|
||||
hidden = "<div id='full-" + id + "' class='hidden'>" + data.doors.join("<br>") + "<a href='#' onclick='openDoorList(this, false);return false;' data='" + id + "'><i class='fa fa-chevron-up'></i> Thu gọn</a></div>";
|
||||
}
|
||||
$("#schedule-door-results-" + id).html(alert + hidden);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -103,4 +112,15 @@ schedule.setSchedule = function (e) {
|
||||
common.ajaxError();
|
||||
}
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
function openDoorList(e, stt) {
|
||||
var id = $(e).attr("data");
|
||||
if (stt) {
|
||||
$("#short-" + id).addClass("hidden");
|
||||
$("#full-" + id).removeClass("hidden");
|
||||
} else {
|
||||
$("#short-" + id).removeClass("hidden");
|
||||
$("#full-" + id).addClass("hidden");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user