1 var _shorten_expanded_threshold = 1.5; //window heights
3 function expandSizeWrapper(id) {
10 var content = row.select(".contentSizeWrapper")[0];
11 var 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 if (getInitParam('cdm_expanded')) {
31 window.setTimeout(function() {
33 if (row.offsetHeight >= _shorten_expanded_threshold * window.innerHeight) {
34 var content = row.select(".cdmContentInner")[0];
37 content.innerHTML = "<div class='contentSizeWrapper'>" +
38 content.innerHTML + "</div><button class='expandPrompt' onclick='return expandSizeWrapper(\""+row.id+"\")' "+
39 "href='#'>" + __("Click to expand article") + "</button>";