From: rabuzarus Date: Sat, 2 Feb 2019 01:27:41 +0000 (+0100) Subject: attachment preview: add destroy method to linkPreview.js X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=b065356c287c6dab005fa5d737df9f63504fecd2;p=friendica.git attachment preview: add destroy method to linkPreview.js --- diff --git a/view/js/linkPreview.js b/view/js/linkPreview.js index cbb5e48da3..afbb453de8 100644 --- a/view/js/linkPreview.js +++ b/view/js/linkPreview.js @@ -412,6 +412,23 @@ }); }; + var destroy = function() { + $('#' + selector).unbind(); + $('#preview_' + selector).remove(); + binurl; + block = false; + blockTitle = false; + blockDescription = false; + cache = {}; + images = ""; + isExtern = false; + photoNumber = 0; + firstPosted = false; + isActive = false; + isCrawling = false; + selector = ""; + }; + var trim = function(str) { return str.replace(/^\s+|\s+$/g, ""); }; @@ -431,8 +448,11 @@ return { // make crawlText() accessable from the outside. - crawlText: function (text) { + crawlText: function(text) { crawlText(text); + }, + destroy: function() { + destroy(); } }; };