diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index 5e46971..8909924 100755 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -219,6 +219,41 @@ let todoModalIsShown = false; $(document).bind('keydown', function (e) { + // ESC Key + if (e.key === "Escape") { + // Ketika Todo View Modal terbuka + const statusTodoViewModal = ($("#todo-view-modal").data('bs.modal') || {}).isShown; + if (statusTodoViewModal !== "undefined" && statusTodoViewModal) { + $("#todo-view-modal").modal('hide'); + } + + // Ketika Todo Create Modal terbuka + const statusTodoCreateModal = ($("#todo-create-modal").data('bs.modal') || {}).isShown; + if (statusTodoCreateModal !== "undefined" && statusTodoCreateModal) { + $("#todo-create-modal").modal('hide'); + } + + // Ketika Todo Edit Modal terbuka + const statusTodoEditModal = ($("#todo-edit-modal").data('bs.modal') || {}).isShown; + if (statusTodoEditModal !== "undefined" && statusTodoEditModal) { + $("#todo-edit-modal").modal('hide'); + $("#todo-view-modal").modal('show'); + } + + // Ketika Todo Item Create Modal terbuka + const statusTodoItemCreateModal = ($("#todo-item-create-modal").data('bs.modal') || {}).isShown; + if (statusTodoItemCreateModal !== "undefined" && statusTodoItemCreateModal) { + $("#todo-item-create-modal").modal('hide'); + $("#todo-view-modal").modal('show'); + } + + // Ketika Todo Item Edit Modal terbuka + const statusTodoItemEditModal = ($("#todo-item-edit-modal").data('bs.modal') || {}).isShown; + if (statusTodoItemEditModal !== "undefined" && statusTodoItemEditModal) { + $("#todo-item-edit-modal").modal('hide'); + $("#todo-view-modal").modal('show'); + } + } // CTRL + S if (e.ctrlKey && e.which === 83) { toastr.error("Prevented"); diff --git a/resources/views/layout/admin.blade.php b/resources/views/layout/admin.blade.php index 97e06d9..ee96655 100755 --- a/resources/views/layout/admin.blade.php +++ b/resources/views/layout/admin.blade.php @@ -154,8 +154,7 @@ - Copyright © @php echo date('Y'); @endphp Todo App. - All rights + Copyright © @php echo date('Y'); @endphp Todo App. All rights reserved.