﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
12566	onClick event on fileButton causes an error after upload for minified version	Brett Profitt		"When uploading an image through the Image plugin with a custom filebrowserUploadUrl set, the following code causes an error (Uncaught TypeError: Cannot read property 'getDialog' of undefined on ckeditor.js:689) ONLY with the minified version:

{{{#!js
CKEDITOR.on('dialogDefinition', function (ev) {
	var dialogName = ev.data.name;
	var dialogDefinition = ev.data.definition;

	if (dialogName === 'image') {
		var uploadTab = dialogDefinition.getContents('Upload');

		for (var i = 0; i < uploadTab.elements.length; i++) {
			var el = uploadTab.elements[i];

			if (el.type !== 'fileButton') {
				continue;
			}

			el.onClick = function() {
				console.log('click');
			};
		}
	}
});
}}}

The error doesn't occur until after the server replies. This is what the reply looks like (with variables set correctly):

{{{#!php
<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction($ckeditor_func_num, '{$params['url']}');</script>
}}}"	Bug	closed	Normal		General		invalid		
