summaryrefslogtreecommitdiff
path: root/plugins/shorten_expanded
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-09-21 08:14:55 +0300
committerAndrew Dolgov <[email protected]>2018-09-21 08:14:55 +0300
commitdf0115fc7a443669f3326f5abb49eb9754b59263 (patch)
tree920d9e99350557a3d9e9cbe8465e855a664bb0db /plugins/shorten_expanded
parent1cf69d435d7b31c803d956692020c3d5f74df90d (diff)
shorten_expanded: also hide embedded attachments behind wrapper
Diffstat (limited to 'plugins/shorten_expanded')
-rw-r--r--plugins/shorten_expanded/init.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/plugins/shorten_expanded/init.js b/plugins/shorten_expanded/init.js
index ffec6271d..24d72b0a1 100644
--- a/plugins/shorten_expanded/init.js
+++ b/plugins/shorten_expanded/init.js
@@ -30,15 +30,19 @@ require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) {
window.setTimeout(function() {
if (row) {
- if (row.offsetHeight >= _shorten_expanded_threshold * window.innerHeight) {
- var content = row.select(".cdmContentInner")[0];
+ var c_inner = row.select(".cdmContentInner")[0];
+ var c_inter = row.select(".cdmIntermediate")[0];
- if (content) {
- content.innerHTML = "<div class='contentSizeWrapper'>" +
- content.innerHTML + "</div><button class='expandPrompt' onclick='return expandSizeWrapper(\""+row.id+"\")' "+
- "href='#'>" + __("Click to expand article") + "</button>";
+ if (c_inner && c_inter &&
+ row.offsetHeight >= _shorten_expanded_threshold * window.innerHeight) {
- }
+ c_inter.parentNode.removeChild(c_inter);
+
+ c_inner.innerHTML = "<div class='contentSizeWrapper'>" +
+ c_inner.innerHTML +
+ c_inter.innerHTML + "</div>" +
+ "<button class='expandPrompt' onclick='return expandSizeWrapper(\""+row.id+"\")' href='#'>" +
+ __("Click to expand article") + "</button>";
}
}
}, 150);