attachment preview: add destroy method to linkPreview.js

This commit is contained in:
rabuzarus 2019-02-02 02:27:41 +01:00
parent 132e0b83c4
commit b065356c28
1 changed files with 21 additions and 1 deletions

View File

@ -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();
}
};
};