fix for bug #382178: unable to clear a livemark's "site location" in the bookmark properties dialogr=mano
authorsspitzer@mozilla.org
Sun, 27 May 2007 16:36:57 -0700
changeset 1909 41507c6abaea9b9d05dc9b41a0a83cdedb70c265
parent 1908 6c6b78318462d8cc51a4f77df42bd84614e2cee4
child 1910 d63ada1f5399ed2f4c6bb13e6c849f32d43e54b1
push idunknown
push userunknown
push dateunknown
bugs382178
milestone1.9a5pre
fix for bug #382178: unable to clear a livemark's "site location" in the bookmark properties dialogr=mano
browser/components/places/content/bookmarkProperties.js
--- a/browser/components/places/content/bookmarkProperties.js
+++ b/browser/components/places/content/bookmarkProperties.js
@@ -830,25 +830,25 @@ var BookmarkPropertiesPanel = {
       var feedURIString = this._element("feedLocationTextfield").value;
       var feedURI = PlacesUtils._uri(feedURIString);
       if (!this._feedURI.equals(feedURI)) {
         transactions.push(
           new PlacesEditLivemarkFeedURITransaction(this._folderId, feedURI));
       }
 
       // Site Location is empty, we can set its URI to null
-      var siteURIString = this._element("feedSiteLocationTextfield").value;
-      var siteURI = null;
-      if (siteURIString)
-        siteURI = PlacesUtils._uri(siteURIString);
+      var newSiteURIString = this._element("feedSiteLocationTextfield").value;
+      var newSiteURI = null;
+      if (newSiteURIString)
+        newSiteURI = PlacesUtils._uri(newSiteURIString);
 
-      if ((!siteURI && this._siteURI)  ||
-          (siteURI && !this._siteURI.equals(siteURI))) {
+      if ((!newSiteURI && this._siteURI)  ||
+          (newSiteURI && (!this._siteURI || !this._siteURI.equals(newSiteURI)))) {
         transactions.push(
-          new PlacesEditLivemarkSiteURITransaction(this._folderId, siteURI));
+          new PlacesEditLivemarkSiteURITransaction(this._folderId, newSiteURI));
       }
     }
 
     // If we have any changes to perform, do them via the
     // transaction manager passed by the opener so they can be undone.
     if (transactions.length > 0) {
       window.arguments[0].performed = true;
       var aggregate =