Bug 1570679 - for chat-conversation, remove usage of "chat" attribute. r=aleca
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Tue, 20 Aug 2019 13:45:22 +0300
changeset 36177 7b046aa7c4afc118571eafe4674d3ae65d83558b
parent 36176 979207319f7a0eed4b9615cb5d56fb3c354b3df2
child 36178 0e0b6fb625ce7dd891cc83e926d38296c4e85bc5
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
reviewersaleca
bugs1570679
Bug 1570679 - for chat-conversation, remove usage of "chat" attribute. r=aleca
mail/components/im/content/chat-conversation.js
mail/components/im/content/chat-messenger.js
mail/components/im/content/chat.css
--- a/mail/components/im/content/chat-conversation.js
+++ b/mail/components/im/content/chat-conversation.js
@@ -153,17 +153,16 @@
       this.setAttribute("flex", "1");
       this.classList.add("convBox");
 
       this.convTop = document.createXULElement("hbox");
       this.convTop.setAttribute("flex", "1");
       this.convTop.classList.add("conv-top");
 
       this.notification = document.createXULElement("hbox");
-      this.notification.setAttribute("inherits", "chat");
       this.notification.setAttribute("flex", "1");
 
       let nbox = document.createXULElement("vbox");
       nbox.setAttribute("flex", "1");
 
       this.convBrowser = document.createXULElement("browser",
         { is: "conversation-browser" });
       this.convBrowser.setAttribute("flex", "1");
@@ -1513,17 +1512,16 @@
           .map(nick => this.buddies.get(nick)));
         this.updateParticipantCount();
       }
     }
 
     initConversationUI() {
       if (this._conv.isChat) {
         this.updateTopic();
-        this.setAttribute("chat", "true");
         let cti = document.getElementById("conv-top-info");
         cti.setAttribute("displayName", this._conv.title);
         cti.setAttribute("status", "chat");
 
         this._activeBuddies = {};
         this.showParticipants();
 
         if (Services.prefs.getBoolPref("messenger.conversations.showNicks")) {
--- a/mail/components/im/content/chat-messenger.js
+++ b/mail/components/im/content/chat-messenger.js
@@ -727,17 +727,16 @@ var chatHandler = {
             return;
           this._pendingSearchTerm = item.searchTerm || undefined;
           this._showLogList(aSimilarLogs, aLog);
         });
       });
     } else if (item.localName == "richlistitem" && item.getAttribute("is") == "chat-imconv") {
       let convDeck = document.getElementById("conversationsDeck");
       if (!item.convView) {
-        // Create new conversation binding.
         let conv = document.createXULElement("chat-conversation");
         convDeck.appendChild(conv);
         conv.conv = item.conv;
         conv.tab = item;
         conv.setAttribute("contentcontextmenu", "chatConversationContextMenu");
         conv.setAttribute("contenttooltip", "imTooltip");
         item.convView = conv;
         document.getElementById("contextSplitter").hidden = false;
@@ -778,22 +777,22 @@ var chatHandler = {
       }
 
       imServices.logs.getLogsForConversation(item.conv, true).then(aLogs => {
         if (contactlistbox.selectedItem != item)
           return;
         this._showLogList(aLogs);
       });
 
-      let contextPane = document.getElementById("contextPane");
+      let contextPaneBox = document.getElementById("contextPaneFlexibleBox");
       if (item.conv.isChat) {
-        contextPane.setAttribute("chat", "true");
+        contextPaneBox.setAttribute("hidden", "true");
         item.convView.showParticipants();
       } else {
-        contextPane.removeAttribute("chat");
+        contextPaneBox.removeAttribute("hidden");
       }
 
       let button = document.getElementById("goToConversation");
       let bundle = document.getElementById("chatBundle");
       button.label = bundle.getString("goBackToCurrentConversation.button");
       button.disabled = false;
       this.observedContact = null;
     } else if (item.localName == "richlistitem" && item.getAttribute("is") == "chat-contact") {
@@ -806,17 +805,17 @@ var chatHandler = {
         return; // onselect has just been fired again because a status
                 // change caused the chat-contact to move.
                 // Return early to avoid flickering and changing the selected log.
       }
 
       this.showContactInfo(contact);
       this.observedContact = contact;
 
-      document.getElementById("contextPane").removeAttribute("chat");
+      document.getElementById("contextPaneFlexibleBox").removeAttribute("hidden");
 
       imServices.logs.getLogsForContact(contact, true).then(aLogs => {
         if (contactlistbox.selectedItem != item)
           return;
         if (!this._showLogList(aLogs, true)) {
           document.getElementById("conversationsDeck").selectedPanel =
             document.getElementById("logDisplay");
           document.getElementById("logDisplayDeck").selectedPanel =
--- a/mail/components/im/content/chat.css
+++ b/mail/components/im/content/chat.css
@@ -37,20 +37,16 @@ richlistitem[is="chat-imconv"] {
 tooltip[type="im"] {
   -moz-binding: url("chrome://chat/content/imtooltip.xml#tooltip");
 }
 
 #contextPaneFlexibleBox {
   overflow: hidden;
 }
 
-#contextPane:not([chat]) > vbox > .conv-chat {
-  display: none;
-}
-
 #IMSearchInput {
   -moz-binding: url("chrome://messenger/content/search.xml#glodaSearch");
 }
 
 #statusTypeIcon:not([disabled]) {
   cursor: pointer;
 }