[bug] fix edit state not setting to false when last link is removed

This commit is contained in:
Kombie 2019-03-16 20:46:28 +00:00 committed by GitHub
parent 89dff38f5d
commit e1eb5f91a5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 2 deletions

View File

@ -36,7 +36,7 @@ var keyboard = (function() {
};
// ctrl+alt+e
if (event.ctrlKey && event.altKey && event.keyCode == 69) {
if (state.get().bookmarks.show.link) {
if (state.get().bookmarks.show.link && bookmarks.get().length > 0) {
if (state.get().bookmarks.edit) {
helper.setObject({
object: state.get(),

View File

@ -101,11 +101,22 @@ var link = (function() {
var remove = function(bookmarkData) {
bookmarks.remove(bookmarkData.timeStamp);
_checkCount();
data.save();
clear();
render();
};
var _checkCount = function() {
if (bookmarks.get().length <= 0) {
helper.setObject({
object: state.get(),
path: "bookmarks.edit",
newValue: false
});
};
};
var _makeLinkForm = function() {
var form = helper.makeNode({
tag: "form",

View File

@ -1,7 +1,7 @@
var version = (function() {
// version is normally bumped when the state needs changing or any new functionality is added
var current = "2.9.4";
var current = "2.9.5";
var get = function() {
var number = current.split(".");