diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/LinkPreview/linkpreview.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/LinkPreview/linkpreview.js b/plugins/LinkPreview/linkpreview.js index 5dca3a807..641adb729 100644 --- a/plugins/LinkPreview/linkpreview.js +++ b/plugins/LinkPreview/linkpreview.js @@ -161,6 +161,14 @@ } LinkPreview.links = links; + }, + + /** + * Clear out any link preview data. + */ + clear: function() { + LinkPreview.links = []; + $('#link-preview').empty(); } }; @@ -169,7 +177,11 @@ if (params.width) oEmbed.width = params.width; if (params.height) oEmbed.height = params.height; - $('#form_notice').append('<div id="link-preview" class="thumbnails"></div>'); + $('#form_notice') + .append('<div id="link-preview" class="thumbnails"></div>') + .bind('reset', function() { + LinkPreview.clear(); + }); // Piggyback on the counter update... var origCounter = SN.U.Counter; |