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

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, "");
};
@ -433,6 +450,9 @@
// make crawlText() accessable from the outside.
crawlText: function(text) {
crawlText(text);
},
destroy: function() {
destroy();
}
};
};