Headlines.move: use requestAnimationFrame in CDM :(
This commit is contained in:
parent
8dc6b48ebd
commit
2deb9c555e
|
@ -832,8 +832,10 @@ define(["dojo/_base/declare"], function (declare) {
|
|||
if (mode === "next") {
|
||||
if (next_id) {
|
||||
if (App.isCombinedMode()) {
|
||||
window.requestAnimationFrame(() => {
|
||||
Article.setActive(next_id);
|
||||
Article.cdmMoveToId(next_id, {event: event, noscroll: noscroll});
|
||||
});
|
||||
} else {
|
||||
Article.view(next_id, noexpand);
|
||||
}
|
||||
|
@ -841,7 +843,7 @@ define(["dojo/_base/declare"], function (declare) {
|
|||
} else if (mode === "prev") {
|
||||
if (prev_id || current_id) {
|
||||
if (App.isCombinedMode()) {
|
||||
|
||||
window.requestAnimationFrame(() => {
|
||||
const row = $("RROW-" + current_id);
|
||||
const ctr = $("headlines-frame");
|
||||
const delta_px = Math.max(row.offsetTop, ctr.scrollTop) - Math.min(row.offsetTop, ctr.scrollTop);
|
||||
|
@ -853,7 +855,7 @@ define(["dojo/_base/declare"], function (declare) {
|
|||
Article.setActive(prev_id);
|
||||
Article.cdmMoveToId(prev_id, {force: noscroll, event: event, noscroll: noscroll});
|
||||
}
|
||||
|
||||
});
|
||||
} else if (prev_id) {
|
||||
Article.view(prev_id, noexpand);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue