Commit 2614b95b authored by ransome1's avatar ransome1
Browse files

Fixed isFocused error, added escape key to close context

parent d0089691
{
"name": "sleek",
"productName": "sleek",
"version": "1.1.2",
"version": "1.1.3-rc.1",
"description": "Todo app based on todo.txt for Linux, Windows and MacOS, free and open-source",
"synopsis": "Todo app based on todo.txt for Linux, Windows and MacOS, free and open-source",
"category": "ProjectManagement",
......@@ -120,7 +120,7 @@
"vanillajs-datepicker": "^1.1.4"
},
"devDependencies": {
"electron": "12.0.10",
"electron": "12.1.0",
"electron-builder": "^22.11.7",
"eslint": "^7.25.0",
"mocha": "^9.0.0",
......
......@@ -781,8 +781,9 @@ const createWindow = async function() {
// REFRESH WHEN IN BACKGROUND
// ########################################################################################################################
setInterval(() => {
if(userData.data.files && !mainWindow.isFocused()) {
const index = userData.data.files.findIndex(file => file[0] ===1 );
if(userData.data.files.length > 0 && mainWindow && !mainWindow.isFocused()) {
const index = userData.data.files.findIndex(file => file[0] === 1);
if(index <= 0) return false;
getContent(userData.data.files[index][1]).then(content => {
mainWindow.webContents.send("refresh", [content])
}).catch(error => {
......
......@@ -462,6 +462,11 @@ function registerKeyboardShortcuts() {
}
}, true)
window.addEventListener("keyup", function(event) {
// escape in context menu
if(event.key === "Escape" && todoContext.classList.contains("is-active")) {
todoContext.classList.remove("is-active");
todoContext.removeAttribute("data-item");
}
// switch files
const regex=/^[1-9]+$/;
if(event.key.match(regex) && userData.files.length > 1 && userData.files[event.key-1] && !modalForm.classList.contains("is-active") && (document.activeElement.id!="todoTableSearch" && document.activeElement.id!="filterContextInput" && document.activeElement.id!="modalFormInput")) {
......
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment