From a1ffc116196e023491ff2c3c7b24f48924ea4fd1 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 13 May 2020 12:28:48 +0300 Subject: [PATCH] only enable unpack observer in expanded mode --- js/Headlines.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/Headlines.js b/js/Headlines.js index e1d80c4ac..cd6868f6f 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -368,6 +368,8 @@ define(["dojo/_base/declare"], function (declare) { Article.cdmMoveToId(id, {noscroll: true}); else Article.view(id); + + Article.unpack(row); } if (hl.selected) this.select("all", id); @@ -375,7 +377,9 @@ define(["dojo/_base/declare"], function (declare) { }); $$(".cdm .header-sticky-guard").each((e) => { this.sticky_header_observer.observe(e) }); - $$("#headlines-frame > div[id*=RROW].cdm").each((e) => { this.unpack_observer.observe(e) }); + + if (App.getInitParam("cdm_expanded")) + $$("#headlines-frame > div[id*=RROW].cdm").each((e) => { this.unpack_observer.observe(e) }); }, render: function (headlines, hl) { @@ -686,7 +690,9 @@ define(["dojo/_base/declare"], function (declare) { } $$(".cdm .header-sticky-guard").each((e) => { this.sticky_header_observer.observe(e) }); - $$("#headlines-frame > div[id*=RROW].cdm").each((e) => { this.unpack_observer.observe(e) }); + + if (App.getInitParam("cdm_expanded")) + $$("#headlines-frame > div[id*=RROW].cdm").each((e) => { this.unpack_observer.observe(e) }); } else { console.error("Invalid object received: " + transport.responseText);