Ticket #8463 (closed Bug: fixed)
WebKit: Cut/Copy don't go on "enabled" state
| Reported by: | fredck | Owned by: | Reinmar |
|---|---|---|---|
| Priority: | Normal | Milestone: | CKEditor 3.6.4 |
| Component: | UI : Toolbar | Version: | 3.5.1 |
| Keywords: | WebKit | Cc: | nmaxim@… |
Description
Original message from our contact form, Ticket REF : 3815-QDFX-1500.
I found that 'cut' and 'copy' icons do not go to enabled state after you select text in editor (chrome v. 14.0.835.202 m windows). After exploring this I found that there is a problem with queryCommandEnabled function in clipboard plugin, so I propose a solution to you.
function stateFromNamedCommand( command, editor )
{
// IE Bug: queryCommandEnabled('paste') fires also
'beforepaste(copy/cut)',
// guard to distinguish from the ordinary sources( either
// keyboard paste or execCommand ) (#4874).
CKEDITOR.env.ie && ( depressBeforeEvent = 1 );
var retval = CKEDITOR.TRISTATE_OFF;
try {retval = editor.document.$.queryCommandEnabled( command ) ||
CKEDITOR.env.webkit && editor.getSelection().getRanges()[0].startOffset !=
editor.getSelection().getRanges()[0].endOffset ? CKEDITOR.TRISTATE_OFF :
CKEDITOR.TRISTATE_DISABLED;}catch( er ){}
depressBeforeEvent = 0;
return retval;
}
Attachments
Change History
comment:1 Changed 19 months ago by j.swiderski
- Status changed from new to confirmed
- Version set to 3.5.1
comment:2 Changed 15 months ago by Reinmar
That bug is visible from rev [6311] because in this revision states of buttons had been bound to what stateFromNamedComand is returning. This function was buggy even before that.
comment:5 Changed 11 months ago by Reinmar
- Owner set to Reinmar
- Status changed from confirmed to review
This issue is already fixed in dev version of next major release (inaccessible for you).
I ported correct patch to version 3.6.3 - you can apply it if you want, or wait for new major or bugfixing release.
comment:9 Changed 11 months ago by garry.yao
- Keywords HasPatch removed
- Status changed from review to review_passed
- Component changed from General to UI : Toolbar
comment:10 Changed 11 months ago by Reinmar
- Status changed from review_passed to closed
- Resolution set to fixed
Fixed with [7504].
comment:12 Changed 10 months ago by j.swiderski
#9143 - there is still a problem when you select content with cursor placed underneath this content.

Reproducible from CKEditor 3.5.1 rev [6311]