From 71fc6d45bd761a9d2715faa68f2b8c0271ee7169 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Mon, 3 Dec 2018 13:38:13 +0300 Subject: refactor error reporting to AppBase; keep exception_error() for now as a shim --- plugins/shorten_expanded/init.js | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'plugins/shorten_expanded/init.js') diff --git a/plugins/shorten_expanded/init.js b/plugins/shorten_expanded/init.js index d9995e8ac..a5424ea38 100644 --- a/plugins/shorten_expanded/init.js +++ b/plugins/shorten_expanded/init.js @@ -1,29 +1,20 @@ var _shorten_expanded_threshold = 1.5; //window heights function expandSizeWrapper(id) { - try { - const row = $(id); + const row = $(id); - console.log(row); + if (row) { + const content = row.select(".contentSizeWrapper")[0]; + const link = row.select(".expandPrompt")[0]; - if (row) { - const content = row.select(".contentSizeWrapper")[0]; - const link = row.select(".expandPrompt")[0]; - - if (content) content.removeClassName("contentSizeWrapper"); - if (link) Element.hide(link); - - } - } catch (e) { - exception_error("expandSizeWrapper", e); + if (content) content.removeClassName("contentSizeWrapper"); + if (link) Element.hide(link); } return false; - } require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { - ready(function() { PluginHost.register(PluginHost.HOOK_ARTICLE_RENDERED_CDM, function(row) { window.setTimeout(function() { @@ -48,5 +39,4 @@ require(['dojo/_base/kernel', 'dojo/ready'], function (dojo, ready) { return true; }); }); - }); -- cgit v1.2.3