Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload Widget crash #967

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions plugins/uploadwidget/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,9 @@

loader.on( 'update', function( evt ) {
// Abort if widget was removed.
if ( !widget.wrapper || !widget.wrapper.getParent() ) {
if ( !editor.editable().find( '[data-cke-upload-id="' + id + '"]' ).count() ) {
if (!widget.wrapper || !widget.wrapper.getParent()) {
Copy link
Contributor

@msamsel msamsel Sep 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please adapt your code style to look like in other part of CKEdtor. More information about styling you can find here. It's helpful to install githooks which checks styling when you perform a commit. Information about githooks you can find here

//Uploading should be aborded if editor is already destroyed
if (!CKEDITOR.instances[editor.name] || !editor.editable().find( '[data-cke-upload-id="' + id + '"]' ).count() ) {
loader.abort();
}
evt.removeListener();
Expand Down Expand Up @@ -496,7 +497,10 @@

loader.on( 'abort', function() {
task && task.cancel();
editor.showNotification( editor.lang.uploadwidget.abort, 'info' );
//Uploading should be aborded if editor is already destroyed
if (CKEDITOR.instances[editor.name]) {
editor.showNotification(editor.lang.uploadwidget.abort, 'info');
}
} );

function createAggregator() {
Expand Down