Skip to content
Snippets Groups Projects
Commit de9daaf0 authored by Aria Givi's avatar Aria Givi
Browse files

ActionListener auf Checkboxes zeigt Save/Delete-Buttons an/ blendet sie aus

parent 24ee5b5a
No related branches found
No related tags found
1 merge request!1365Resolve "Filter Options for MetaGer"
......@@ -60,6 +60,7 @@ function setActionListeners () {
window.location = './settings/';
});
}
$('.focusCheckbox').click(toggleFocusButtons);
$('#addFocusBtn').click(() => showFocusCreateDialog(''));
$('.save-focus-btn').click(saveFocus);
$('.delete-focus-btn').click(deleteFocus);
......@@ -242,6 +243,8 @@ function showFocusCreateDialog (id) {
} catch (ex) {
console.error(ex);
}
} else {
toggleFocusButtons();
}
}
/**
......@@ -250,6 +253,20 @@ function showFocusCreateDialog (id) {
function showFocusEditDialog (id) {
showFocusCreateDialog(id);
}
/**
* Shows/Hides the save and delete buttons if (no) checkboxes are selected
*/
function toggleFocusButtons() {
if(atLeastOneChecked()) {
$('.save-focus-btn').show();
$('.delete-focus-btn').show();
} else {
$('.save-focus-btn').hide();
$('.delete-focus-btn').hide();
}
}
/**
* Save the current Focus
* Listens for save button
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment