summaryrefslogtreecommitdiffstats
path: root/application/palemoon/components/places/content
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-05-02 23:43:12 +0200
committerGitHub <noreply@github.com>2018-05-02 23:43:12 +0200
commitb1728772a796834e7bd9e6707e8855bee49b5368 (patch)
tree3d0505129698683b22541ec2acd03f75d34172bb /application/palemoon/components/places/content
parent7ea87f571b01412fde39e30d596abec718ceb3ba (diff)
parent39902d8998da806c833f6cc67465a869fc40f116 (diff)
downloadUXP-b1728772a796834e7bd9e6707e8855bee49b5368.tar
UXP-b1728772a796834e7bd9e6707e8855bee49b5368.tar.gz
UXP-b1728772a796834e7bd9e6707e8855bee49b5368.tar.lz
UXP-b1728772a796834e7bd9e6707e8855bee49b5368.tar.xz
UXP-b1728772a796834e7bd9e6707e8855bee49b5368.zip
Merge pull request #318 from janekptacijarabaci/pm_places_keyword_1
[PALEMOON] [frontend vs backend] Places - Fix: "Keyword" reset (to an empty value) does not work
Diffstat (limited to 'application/palemoon/components/places/content')
-rw-r--r--application/palemoon/components/places/content/editBookmarkOverlay.js21
1 files changed, 12 insertions, 9 deletions
diff --git a/application/palemoon/components/places/content/editBookmarkOverlay.js b/application/palemoon/components/places/content/editBookmarkOverlay.js
index 43645cc73..69d7d32eb 100644
--- a/application/palemoon/components/places/content/editBookmarkOverlay.js
+++ b/application/palemoon/components/places/content/editBookmarkOverlay.js
@@ -12,6 +12,7 @@ var gEditItemOverlay = {
_uris: [],
_tags: [],
_allTags: [],
+ _keyword: null,
_multiEdit: false,
_itemType: -1,
_readOnly: false,
@@ -139,9 +140,8 @@ var gEditItemOverlay = {
this._itemType = PlacesUtils.bookmarks.getItemType(this._itemId);
if (this._itemType == Ci.nsINavBookmarksService.TYPE_BOOKMARK) {
this._uri = PlacesUtils.bookmarks.getBookmarkURI(this._itemId);
- this._initTextField("keywordField",
- PlacesUtils.bookmarks
- .getKeywordForBookmark(this._itemId));
+ this._keyword = PlacesUtils.bookmarks.getKeywordForBookmark(this._itemId);
+ this._initTextField("keywordField", this._keyword);
this._element("loadInSidebarCheckbox").checked =
PlacesUtils.annotations.itemHasAnnotation(this._itemId,
PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO);
@@ -610,9 +610,13 @@ var gEditItemOverlay = {
},
onKeywordFieldBlur: function EIO_onKeywordFieldBlur() {
- var keyword = this._element("keywordField").value;
- if (keyword != PlacesUtils.bookmarks.getKeywordForBookmark(this._itemId)) {
- var txn = new PlacesEditBookmarkKeywordTransaction(this._itemId, keyword);
+ let oldKeyword = this._keyword;
+ let keyword = this._keyword = this._element("keywordField").value;
+ if (keyword != oldKeyword) {
+ let txn = new PlacesEditBookmarkKeywordTransaction(this._itemId,
+ keyword,
+ null,
+ oldKeyword);
PlacesUtils.transactionManager.doTransaction(txn);
}
},
@@ -1004,9 +1008,8 @@ var gEditItemOverlay = {
}
break;
case "keyword":
- this._initTextField("keywordField",
- PlacesUtils.bookmarks
- .getKeywordForBookmark(this._itemId));
+ this._keyword = PlacesUtils.bookmarks.getKeywordForBookmark(this._itemId);
+ this._initTextField("keywordField", this._keyword);
break;
case PlacesUIUtils.DESCRIPTION_ANNO:
this._initTextField("descriptionField",