Commit 5e3d4592 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

erp5_web_jabber_client: Fix Scroll down on dialog page

parent b880f266
...@@ -3,13 +3,14 @@ ...@@ -3,13 +3,14 @@
(function (window, document, rJS, RSVP, Handlebars, loopEventListener) { (function (window, document, rJS, RSVP, Handlebars, loopEventListener) {
"use strict"; "use strict";
function scroll() { function scroll(g) {
var gadget = g;
RSVP.Queue() RSVP.Queue()
.push(function () { .push(function () {
return RSVP.delay(0); return RSVP.delay(0);
}) })
.push(function () { .push(function () {
window.scrollTo(0, document.body.scrollHeight || document.documentElement.scrollHeight); window.scrollTo(0, gadget.props.element.scrollHeight || document.body.scrollHeight || document.documentElement.scrollHeight);
}); });
} }
...@@ -176,7 +177,7 @@ ...@@ -176,7 +177,7 @@
gadget.props.element.querySelector(".discussion-content").innerHTML = ""; gadget.props.element.querySelector(".discussion-content").innerHTML = "";
gadget.props.element.querySelector(".discussion-content").appendChild(ul); gadget.props.element.querySelector(".discussion-content").appendChild(ul);
scroll(); return scroll(gadget);
}); });
}) })
...@@ -259,7 +260,7 @@ ...@@ -259,7 +260,7 @@
}) })
.declareService(function () { .declareService(function () {
scroll(); return scroll(this);
}); });
}(window, document, rJS, RSVP, Handlebars, loopEventListener)); }(window, document, rJS, RSVP, Handlebars, loopEventListener));
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment