Bug 1344630 - Display parsed primary and secondary value in profile item. r=seanlee draft
authorRay Lin <ralin@mozilla.com>
Fri, 24 Feb 2017 10:15:55 +0800
changeset 493874 d22ffa752834689bd44077876610bb952de5c2cd
parent 493721 8d026c60151005ad942e3d4389318fe28a0c8c54
child 495592 f14933598c44d6d140c4c945d4f81170476d7e9b
push id47876
push userbmo:ralin@mozilla.com
push dateMon, 06 Mar 2017 08:31:55 +0000
reviewersseanlee
bugs1344630
milestone54.0a1
Bug 1344630 - Display parsed primary and secondary value in profile item. r=seanlee MozReview-Commit-ID: 2XJMS4fGzyg
browser/extensions/formautofill/content/formautofill.xml
--- a/browser/extensions/formautofill/content/formautofill.xml
+++ b/browser/extensions/formautofill/content/formautofill.xml
@@ -58,21 +58,20 @@
       <method name="_onUnderflow">
         <body></body>
       </method>
 
       <method name="_adjustAcItem">
         <body>
         <![CDATA[
           let outerBoxRect = this.parentNode.getBoundingClientRect();
-          let value = this.getAttribute("ac-value");
-          let comment = this.getAttribute("ac-comment");
+          let {primary, secondary} = JSON.parse(this.getAttribute("ac-value"));
 
-          this._comment.textContent = comment;
-          this._label.textContent = value;
+          this._label.textContent = primary;
+          this._comment.textContent = secondary;
 
           // Make item fit in popup as XUL box could not constrain
           // item's width
           this._itemBox.style.width =  outerBoxRect.width + "px";
           // Use two-lines layout when width is smaller than 150px
           if (outerBoxRect.width <= 150) {
             this._itemBox.setAttribute("size", "small");
           } else {