Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save freaktechnik/c6d84b4c78002106af7b to your computer and use it in GitHub Desktop.
Save freaktechnik/c6d84b4c78002106af7b to your computer and use it in GitHub Desktop.
# HG changeset patch
# User Martin Giger <martin@humanoids.be>
# Parent f23b538a3e3bb674e22bab5ef6b8d816531b155f
diff --git a/chat/content/convbrowser.xml b/chat/content/convbrowser.xml
--- a/chat/content/convbrowser.xml
+++ b/chat/content/convbrowser.xml
@@ -773,16 +773,28 @@
// The content area was resized and auto-scroll is enabled,
// make sure the last inserted element is still visible
this._scrollToElement(this._lastElement);
}
]]>
</body>
</method>
+ <method name="browserLoad">
+ <parameter name="event"/>
+ <body>
+ <![CDATA[
+ if (event.target.tagName.toLowerCase() === "img" &&
+ this._autoScrollEnabled && this._lastElement) {
+ this._scrollToElement(this._lastElement);
+ }
+ ]]>
+ </body>
+ </method>
+
<!-- nsIObserver implementation -->
<method name="observe">
<parameter name="aSubject"/>
<parameter name="aTopic"/>
<parameter name="aData"/>
<body>
<![CDATA[
if (aTopic != "nsPref:changed")
@@ -901,16 +913,18 @@
this._nextPendingMessageIndex = 0;
this._pendingMessagesDisplayed = 0;
this._displayPendingMessagesCalls = 0;
this._sessions = [];
if (this.progressBar)
this.progressBar.hidden = true;
Services.obs.notifyObservers(this, "conversation-loaded", null);
+
+ this.contentDocument.getElementById("Chat").addEventListener("load", this.browserLoad.bind(this), true);
}
]]>
</body>
</method>
<method name="onProgressChange">
<parameter name="aProgress"/>
<parameter name="aRequest"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment