Opened 6 years ago

Closed 5 years ago

#10028 closed New Feature (fixed)

No need to confirm that "Cancel" button has been pressed

Reported by: Henrik Helmø Larsen Owned by: Marek Lewandowski
Priority: Normal Milestone: CKEditor 4.3
Component: UI : Dialogs Version: 3.0
Keywords: Cc:

Description

I think it is very annoying that you have to (in some cases) confirm that you want to cancel opening a dialog. It would be nice if it could be possible to have a: CKEDITOR.config.ignoreConfirmCancel = true; which never would show the confirm dialog: "Some of the options have been changed. Are you sure to close the dialog?"

The dialog always appears if on the Link-dialog a change has been made in a combobox (dropdown) - for example the "Link Type"-combobox.

Attachments (1)

LinkCancelConfirm.PNG (133.0 KB) - added by Henrik Helmø Larsen 6 years ago.
"Confirm-cancel" dialog being displayed because Link Type has changed

Download all attachments as: .zip

Change History (15)

Changed 6 years ago by Henrik Helmø Larsen

Attachment: LinkCancelConfirm.PNG added

"Confirm-cancel" dialog being displayed because Link Type has changed

comment:1 Changed 6 years ago by Henrik Helmø Larsen

Sorry - forgot to write I am using CKEditor 4.0.1 (using Chrome on a Win 7 Ultimate 64bit machine)

comment:2 Changed 6 years ago by Jakub Ś

Status: newconfirmed
Version: 3.0

Currently there is no option to disable this. It would be nice however to give users choice.

@Helmø code you are looking for is located in ckeditor/plugins/dialog/plugin.js

this.on( 'cancel', function( evt ) {
...

comment:3 Changed 6 years ago by Henrik Helmø Larsen

Exactly - I have added the following code:

this.on( 'cancel', function( evt ) {
  if (!editor.config.ignoreConfirmCancel) {
    iterContents( function( item ) {
      if ( item.isChanged() ) {
        if ( !confirm( editor.lang.common.confirmCancel ) )
          evt.data.hide = false;
            return true;
      }
    });
  }
}, this, null, 0 );

if (!editor.config.ignoreConfirmCancel) being the added code.

And then I have defined config.ignoreConfirmCancel = true; in config.js

comment:4 Changed 5 years ago by Claire Martinez

Any idea when this will be patched in? 4.2.1 perhaps?

comment:5 Changed 5 years ago by Marek Lewandowski

Owner: set to Marek Lewandowski
Status: confirmedreview

Fixed with git:a93d09be787 on dev and 108d0c5f on tests. Branch t/10028.

comment:6 Changed 5 years ago by Marek Lewandowski

Milestone: CKEditor 4.2.2

comment:7 Changed 5 years ago by Henrik Helmø Larsen

Thank you

comment:8 Changed 5 years ago by Piotr Jasiun

For me this change is now ok, but it should wait until next week until Fred will be back, to get green light.

comment:9 Changed 5 years ago by Piotrek Koszuliński

This is a new feature so ideally it would land on 4.3, not 4.2.2.

Plus some things with the doc string:

  • there is no name of an option specified,
  • in official documentation you should not use contractions like "it's", "shouldn't".

comment:10 Changed 5 years ago by Frederico Caldeira Knabben

Milestone: CKEditor 4.2.2CKEditor 4.3

Yes, that's a new feature, so 4.3.

comment:11 Changed 5 years ago by Frederico Caldeira Knabben

Status: reviewreview_failed

The configuration name is not good. If you look at it out of the box, "ignoreConfirmCancel" is quite confusing and has no association with dialogs. I would propose "dialog_noConfirmCancel", to also align to the new naming convention for plugins.

comment:12 Changed 5 years ago by Marek Lewandowski

Status: review_failedreview

Branch t/10028 (dev and tests) updated, requesting for next review.

comment:13 Changed 5 years ago by Piotrek Koszuliński

Status: reviewreview_passed

After some additional fixes in tests and doc str, R+.

comment:14 Changed 5 years ago by Piotrek Koszuliński

Resolution: fixed
Status: review_passedclosed

Merged to major on git:1828df8 on dev and dd65c85 on tests.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy