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 @@
(function (window, document, rJS, RSVP, Handlebars, loopEventListener) {
"use strict";
function scroll() {
function scroll(g) {
var gadget = g;
RSVP.Queue()
.push(function () {
return RSVP.delay(0);
})
.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 @@
gadget.props.element.querySelector(".discussion-content").innerHTML = "";
gadget.props.element.querySelector(".discussion-content").appendChild(ul);
scroll();
return scroll(gadget);
});
})
......@@ -259,7 +260,7 @@
})
.declareService(function () {
scroll();
return scroll(this);
});
}(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