Bug 912855 - Can't remove check-mark on "Load this bookmark in the sidebar". r=mak, a=akeybl
authorAsaf Romano <aromano@mozilla.com>
Wed, 09 Oct 2013 16:33:58 +0200
changeset 160623 de66802f05aa7d780686c06268ec924f38225c2b
parent 160622 8320c2fdf24093115072baeec5804b358d550c46
child 160624 1444db55ea3c74c11f8667a24b9b210facac0751
push id2961
push userlsblakk@mozilla.com
push dateMon, 28 Oct 2013 21:59:28 +0000
treeherdermozilla-beta@73ef4f13486f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak, akeybl
bugs912855
milestone26.0a2
Bug 912855 - Can't remove check-mark on "Load this bookmark in the sidebar". r=mak, a=akeybl
browser/components/places/content/bookmarkProperties.js
browser/components/places/content/editBookmarkOverlay.js
--- a/browser/components/places/content/bookmarkProperties.js
+++ b/browser/components/places/content/bookmarkProperties.js
@@ -552,20 +552,17 @@ var BookmarkPropertiesPanel = {
                       value  : this._description,
                       expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
       let editItemTxn = new PlacesSetItemAnnotationTransaction(-1, annoObj);
       childTransactions.push(editItemTxn);
     }
 
     if (this._loadInSidebar) {
       let annoObj = { name   : PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO,
-                      type   : Ci.nsIAnnotationService.TYPE_INT32,
-                      flags  : 0,
-                      value  : this._loadInSidebar,
-                      expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
+                      value  : true };
       let setLoadTxn = new PlacesSetItemAnnotationTransaction(-1, annoObj);
       childTransactions.push(setLoadTxn);
     }
 
     if (this._postData) {
       let postDataTxn = new PlacesEditBookmarkPostDataTransaction(-1, this._postData);
       childTransactions.push(postDataTxn);
     }
--- a/browser/components/places/content/editBookmarkOverlay.js
+++ b/browser/components/places/content/editBookmarkOverlay.js
@@ -584,24 +584,20 @@ var gEditItemOverlay = {
     if (keyword != PlacesUtils.bookmarks.getKeywordForBookmark(this._itemId)) {
       var txn = new PlacesEditBookmarkKeywordTransaction(this._itemId, keyword);
       PlacesUtils.transactionManager.doTransaction(txn);
     }
   },
 
   onLoadInSidebarCheckboxCommand:
   function EIO_onLoadInSidebarCheckboxCommand() {
-    var loadInSidebarChecked = this._element("loadInSidebarCheckbox").checked;
-    var annoObj = { name   : PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO,
-                    type   : Ci.nsIAnnotationService.TYPE_INT32,
-                    flags  : 0,
-                    value  : loadInSidebarChecked,
-                    expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
-    var txn = new PlacesSetItemAnnotationTransaction(this._itemId,
-                                                     annoObj);
+    let annoObj = { name : PlacesUIUtils.LOAD_IN_SIDEBAR_ANNO };
+    if (this._element("loadInSidebarCheckbox").checked)
+      annoObj.value = true;
+    let txn = new PlacesSetItemAnnotationTransaction(this._itemId, annoObj);
     PlacesUtils.transactionManager.doTransaction(txn);
   },
 
   toggleFolderTreeVisibility: function EIO_toggleFolderTreeVisibility() {
     var expander = this._element("foldersExpander");
     var folderTreeRow = this._element("folderTreeRow");
     if (!folderTreeRow.collapsed) {
       expander.className = "expander-down";