attachment preview: add destroy method to linkPreview.js

pull/6577/head
rabuzarus 2019-02-02 02:27:41 +01:00
rodzic 132e0b83c4
commit b065356c28
1 zmienionych plików z 21 dodań i 1 usunięć

Wyświetl plik

@ -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) { var trim = function(str) {
return str.replace(/^\s+|\s+$/g, ""); return str.replace(/^\s+|\s+$/g, "");
}; };
@ -431,8 +448,11 @@
return { return {
// make crawlText() accessable from the outside. // make crawlText() accessable from the outside.
crawlText: function (text) { crawlText: function(text) {
crawlText(text); crawlText(text);
},
destroy: function() {
destroy();
} }
}; };
}; };