Bug 912855 - Can't remove check-mark on "Load this bookmark in the sidebar". r=mak
authorAsaf Romano <aromano@mozilla.com>
Wed, 09 Oct 2013 16:33:58 +0200
changeset 150194 b088976006effdf73f7737255b45d3df10b3c6d2
parent 150193 335e5804cbf1ab8093465702a943a6720c8ab792
child 150195 57594d25cc7e94fce8214e67203dd5cdb0c302e1
push id2972
push usermak77@bonardo.net
push dateWed, 09 Oct 2013 14:34:12 +0000
treeherderfx-team@b088976006ef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs912855
milestone27.0a1
Bug 912855 - Can't remove check-mark on "Load this bookmark in the sidebar". r=mak
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";