From 2c212d74977bb23acd908e815513466ea897c7fe Mon Sep 17 00:00:00 2001 From: Aleksander Nowodzinski Date: Tue, 19 Feb 2013 12:28:16 +0100 Subject: [PATCH] Added possibility to prevent preview window from being open via contentPreview event. --- plugins/preview/plugin.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/preview/plugin.js b/plugins/preview/plugin.js index 667cad3a5d1..52200695926 100644 --- a/plugins/preview/plugin.js +++ b/plugins/preview/plugin.js @@ -57,7 +57,10 @@ iLeft = Math.round( screen.width * 0.1 ); } catch ( e ) {} - editor.fire( 'contentPreview', eventData = { dataValue: sHTML } ); + // (#9907) Allow data manipulation before preview is displayed. + // Also don't open the preview window when event cancelled. + if ( !editor.fire( 'contentPreview', eventData = { dataValue: sHTML } ) ) + return false; var sOpenUrl = ''; if ( isCustomDomain ) {