Commit e8154bcd authored by ransome1's avatar ransome1
Browse files

Fixed needless confirmation on unchanged input values (262), improved link click (264)

parent 2e5ec0be
{ {
"name": "sleek", "name": "sleek",
"productName": "sleek", "productName": "sleek",
"version": "1.1.2-rc.1", "version": "1.1.2-rc.2",
"description": "Todo app based on todo.txt for Linux, Windows and MacOS, free and open-source", "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", "synopsis": "Todo app based on todo.txt for Linux, Windows and MacOS, free and open-source",
"category": "ProjectManagement", "category": "ProjectManagement",
......
...@@ -46,7 +46,7 @@ marked.use({ renderer }); ...@@ -46,7 +46,7 @@ marked.use({ renderer });
const tableContainerContent = document.createDocumentFragment(); const tableContainerContent = document.createDocumentFragment();
const todoTableBodyRowTemplate = document.createElement("div"); const todoTableBodyRowTemplate = document.createElement("div");
const todoTableBodyCellCheckboxTemplate = document.createElement("div"); const todoTableBodyCellCheckboxTemplate = document.createElement("div");
const todoTableBodyCellTextTemplate = document.createElement("a"); const todoTableBodyCellTextTemplate = document.createElement("div");
const tableContainerCategoriesTemplate = document.createElement("span"); const tableContainerCategoriesTemplate = document.createElement("span");
const todoTableBodyCellPriorityTemplate = document.createElement("div"); const todoTableBodyCellPriorityTemplate = document.createElement("div");
const todoTableBodyCellDueDateTemplate = document.createElement("span"); const todoTableBodyCellDueDateTemplate = document.createElement("span");
...@@ -63,9 +63,8 @@ let ...@@ -63,9 +63,8 @@ let
todoRows; todoRows;
todoTableWrapper.addEventListener("scroll", function(event) { todoTableWrapper.addEventListener("scroll", function(event) {
if(clusterThreshold>=items.filtered.length) return false; if(visibleRows>=items.filtered.length) return false;
if(Math.floor(event.target.scrollHeight - event.target.scrollTop) <= event.target.clientHeight) { if(Math.floor(event.target.scrollHeight - event.target.scrollTop) <= event.target.clientHeight) {
//clusterThreshold = clusterThreshold + clusterCounter;
startBuilding(true); startBuilding(true);
} }
}); });
...@@ -95,7 +94,7 @@ function configureTodoTableTemplate() { ...@@ -95,7 +94,7 @@ function configureTodoTableTemplate() {
todoTableBodyCellCheckboxTemplate.setAttribute("class", "cell checkbox"); todoTableBodyCellCheckboxTemplate.setAttribute("class", "cell checkbox");
todoTableBodyCellTextTemplate.setAttribute("class", "cell text"); todoTableBodyCellTextTemplate.setAttribute("class", "cell text");
todoTableBodyCellTextTemplate.setAttribute("tabindex", 0); todoTableBodyCellTextTemplate.setAttribute("tabindex", 0);
todoTableBodyCellTextTemplate.setAttribute("href", "#"); //todoTableBodyCellTextTemplate.setAttribute("href", "#");
tableContainerCategoriesTemplate.setAttribute("class", "categories"); tableContainerCategoriesTemplate.setAttribute("class", "categories");
todoTableBodyCellDueDateTemplate.setAttribute("class", "cell itemDueDate"); todoTableBodyCellDueDateTemplate.setAttribute("class", "cell itemDueDate");
todoTableBodyCellRecurrenceTemplate.setAttribute("class", "cell recurrence"); todoTableBodyCellRecurrenceTemplate.setAttribute("class", "cell recurrence");
...@@ -164,8 +163,6 @@ async function generateTable(groups, loadAll) { ...@@ -164,8 +163,6 @@ async function generateTable(groups, loadAll) {
todoRows = new Array; todoRows = new Array;
// TODO Overthink due to performance reasons // TODO Overthink due to performance reasons
todoTable.textContent = ""; todoTable.textContent = "";
// configure stats // configure stats
showResultStats(); showResultStats();
// prepare the templates for the table // prepare the templates for the table
...@@ -468,6 +465,8 @@ function setTodoComplete(todo) { ...@@ -468,6 +465,8 @@ function setTodoComplete(todo) {
items.objects.splice(index, 1, todo); items.objects.splice(index, 1, todo);
// if recurrence is set start generating the recurring todo // if recurrence is set start generating the recurring todo
if(todo.rec) generateRecurrence(todo) if(todo.rec) generateRecurrence(todo)
// finally remove priority
todo.priority = null;
} }
//write the data to the file //write the data to the file
window.api.send("writeToFile", [items.objects.join("\n").toString() + "\n"]); window.api.send("writeToFile", [items.objects.join("\n").toString() + "\n"]);
......
...@@ -385,7 +385,7 @@ function registerEvents() { ...@@ -385,7 +385,7 @@ function registerEvents() {
const modalObject = document.getElementById(el.parentElement.id); const modalObject = document.getElementById(el.parentElement.id);
if(modalObject.id==="modalPrompt") return false; if(modalObject.id==="modalPrompt") return false;
// if modal is modalForm and input is equal the data item // if modal is modalForm and input is equal the data item
if(modalObject.id === "modalForm" && modalForm.getAttribute("data-item") !== modalFormInput.value) { if(modalObject.id === "modalForm" && modalForm.getAttribute("data-item") !== document.getElementById("modalFormInput").value) {
getConfirmation(resetModal, translations.modalBackgroundAttention, modalObject); getConfirmation(resetModal, translations.modalBackgroundAttention, modalObject);
} else { } else {
resetModal(modalObject).then(function(result) { resetModal(modalObject).then(function(result) {
......
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