From 9cdb9cc18d7aea9eaf13443413ba051e78e1f89e Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Tue, 16 Nov 2010 15:31:03 -0800 Subject: [PATCH] LinkPreview: clear preview thumbnails & data on form submission/reset --- plugins/LinkPreview/linkpreview.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/plugins/LinkPreview/linkpreview.js b/plugins/LinkPreview/linkpreview.js index 5dca3a8071..641adb7290 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(''); + $('#form_notice') + .append('') + .bind('reset', function() { + LinkPreview.clear(); + }); // Piggyback on the counter update... var origCounter = SN.U.Counter; -- 2.39.5