Opened 7 years ago

Closed 7 years ago

#10268 closed Bug (fixed)

'Show Blocks' do not recover after 'Source' view

Reported by: Roman Owned by:
Priority: Normal Milestone: CKEditor 4.1.1
Component: General Version: 4.1
Keywords: Cc:

Description

Hi Team,

How reproduce:

  1. Go to http://ckeditor.com/demo#full (version 4.1)
  2. Click on 'Show Bloks', blocks appear
  3. Click on 'Source'
  4. Click on 'Show Bloks', blocks do not appear, but button stay pushed down.

Thanks!

Change History (3)

comment:1 Changed 7 years ago by Roman

Update.

Looks like problem is here http://dev.ckeditor.com/browser/CKEditor/trunk/_source/plugins/showblocks/plugin.js#L139

command.state equal to by somehow CKEDITOR.TRISTATE_DISABLED

 command.state != CKEDITOR.TRISTATE_DISABLED
135                        // Refresh the command on setData.
136	                        editor.on( 'mode', function()
137	                                {
138	                                        if ( command.state != CKEDITOR.TRISTATE_DISABLED )
139	                                                command.refresh( editor );
140	                                });

Test: I added this into custom plugin

            editor.on( 'mode', function() {
                var command = editor.commands.showblocks;

                console.log("command.state = " + command.state, "CKEDITOR.TRISTATE_DISABLED = " + CKEDITOR.TRISTATE_DISABLED);

                if ( command.state != CKEDITOR.TRISTATE_DISABLED ) {
                    command.refresh( editor );
                }
            });

Then I did:

  1. Add to config config.startupOutlineBlocks = true
  2. Refresh the page | command.state = 1, CKEDITOR.TRISTATE_DISABLED = 0
  3. Click on 'Source' | command.state = 1, CKEDITOR.TRISTATE_DISABLED = 0
  4. Click on again 'Source' | command.state = 0, CKEDITOR.TRISTATE_DISABLD = 0
  5. In console CKEDITOR.instances.body.commands.showblocks.state is equal 1

I created wired fix for myself for now, maybe it could be helpful somebody -)

            editor.on('mode', function( evt ) {
                /**
                 * Temporary fix
                 * Issue: http://dev.ckeditor.com/ticket/10268
                 */
                editor.commands.showblocks.refresh( editor );
            });

comment:2 Changed 7 years ago by Jakub Ś

Keywords: Show Blocks Source removed
Status: newconfirmed
Version: 4.1

Problem can be reproduced in all browsers from CKEditor 4.1.

comment:3 Changed 7 years ago by Piotrek Koszuliński

Milestone: CKEditor 4.1.1
Resolution: fixed
Status: confirmedclosed

Fixed by #10249.

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