Opened 12 years ago
Last modified 12 years ago
#9476 confirmed Bug
CKEDITOR.dialog#disableButton not working
Reported by: | Jeff Fournier | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.0 |
Keywords: | HasPatch | Cc: |
Description
It is still possible to click on a dialog button after having disabling it with the disableButton method in CKEDITOR.dialog (http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dialog.html#disableButton).
When "disableButton" is called, the property "disabled" is correctly set to true and a css class is added to the button. But if you click on the button, there's no check to see if it's disabled and the event is still fired.
I think this could be fixed by modifying the code in _source/plugin/dialogui/plugin.js and adding a check for disabled before the onClick is applied.
Like this :
(line 949)
onClick : function( dialog, func ) { this.on( 'click', function() { if(!this._.disabled) { // Some browsers (Chrome, IE8, IE7 compat mode) don't move // focus to clicked button. Force this. this.getElement().focus(); func.apply( this, arguments ); } }); }
By the way, the css class (cke_disabled) added to the button when it's disabled does nothing and the button doesn't look disabled.
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Component: | UI : Dialogs → General |
---|
comment:3 Changed 12 years ago by
Keywords: | HasPatch added |
---|---|
Status: | new → confirmed |
Version: | 3.6.4 → 3.0 |
It looks like cke_disabled is added but click still works.
Problem can be reproduced from CKEditor 3.0.
To reproduce just add this onClick() code to any button in a dialog.