[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
3 changed files with 13 additions and 2 deletions

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",