1 var _shorten_expanded_threshold
= 1.5; //window heights
3 function expandSizeWrapper(id
) {
10 const content
= row
.select(".contentSizeWrapper")[0];
11 const link
= row
.select(".expandPrompt")[0];
13 if (content
) content
.removeClassName("contentSizeWrapper");
14 if (link
) Element
.hide(link
);
18 exception_error("expandSizeWrapper", e
);
25 require(['dojo/_base/kernel', 'dojo/ready'], function (dojo
, ready
) {
28 PluginHost
.register(PluginHost
.HOOK_ARTICLE_RENDERED_CDM
, function(row
) {
29 window
.setTimeout(function() {
31 const c_inner
= row
.select(".content-inner")[0];
32 const c_inter
= row
.select(".intermediate")[0];
34 if (c_inner
&& c_inter
&&
35 row
.offsetHeight
>= _shorten_expanded_threshold
* window
.innerHeight
) {
37 c_inter
.parentNode
.removeChild(c_inter
);
39 c_inner
.innerHTML
= "<div class='contentSizeWrapper'>" +
41 c_inter
.innerHTML
+ "</div>" +
42 "<button class='expandPrompt' onclick='return expandSizeWrapper(\""+row
.id
+"\")' href='#'>" +
43 __("Click to expand article") + "</button>";