Ticket #4269: 4269.patch

File 4269.patch, 3.1 KB (added by Tobiasz Cudnik, 15 years ago)
  • _source/plugins/dialogui/plugin.js

     
    214214                                                me.getInputElement().on( 'keydown', function( evt )
    215215                                                        {
    216216                                                                if ( evt.data.getKeystroke() == 13 )
     217                                                                {
    217218                                                                        keyPressedOnMe = true;
     219                                                                        evt.data.preventDefault( true );
     220                                                                }
    218221                                                        } );
    219222
    220223                                                // Lower the priority this 'keyup' since 'ok' will close the dialog.(#3749)
     
    224227                                                                {
    225228                                                                        dialog.getButton( 'ok' ) && dialog.getButton( 'ok' ).click();
    226229                                                                        keyPressedOnMe = false;
     230                                                                        evt.data.preventDefault( true );
    227231                                                                }
    228232                                                        }, null, null, 1000 );
     233
     234                                                // Prevent enter key from bubbling up. (#4269)
     235                                                // Needed for FF, Safari, Opera.
     236                                                me.getInputElement().on( 'keypress', function( evt )
     237                                                        {
     238                                                                if ( evt.data.getKeystroke() == 13 )
     239                                                                        evt.data.preventDefault( true );
     240                                                        } );
    229241                                        } );
    230242
    231243                                /** @ignore */
  • _source/plugins/dialog/plugin.js

     
    623623
    624624                                CKEDITOR.document.on( 'keydown', accessKeyDownHandler );
    625625                                CKEDITOR.document.on( 'keyup', accessKeyUpHandler );
     626
     627                                // Prevent Esc key from bubbling up. (#4269)
     628                                for ( var event in { keyup: 1, keydown : 1, keypress : 1 })
     629                                        CKEDITOR.document.on( event, preventEscBubbling );
    626630                        }
    627631                        else
    628632                        {
     
    749753                                // Remove access key handlers.
    750754                                CKEDITOR.document.removeListener( 'keydown', accessKeyDownHandler );
    751755                                CKEDITOR.document.removeListener( 'keyup', accessKeyUpHandler );
     756                                CKEDITOR.document.removeListener( 'keypress', accessKeyUpHandler );
    752757
     758                                // Prevent Esc key from bubbling up. (#4269)
     759                                for ( var event in { keyup: 1, keydown : 1, keypress : 1 })
     760                                        CKEDITOR.document.removeListener( event, preventEscBubbling );
     761
    753762                                var editor = this._.editor;
    754763                                editor.focus();
    755764
     
    18361845        {
    18371846        };
    18381847
     1848        var preventEscBubbling = function( e )
     1849        {
     1850                e.data.getKeystroke() == 27 && e.data.preventDefault( true );
     1851        };
     1852
    18391853        (function()
    18401854        {
    18411855                CKEDITOR.ui.dialog =
  • CHANGES.html

     
    4747                <li><a href="http://dev.fckeditor.net/ticket/3898">#3898</a> : Added validation for URL presentance in Image dialog.</li>
    4848                <li><a href="http://dev.fckeditor.net/ticket/3528">#3528</a> : Fixed Context Menu issue when triggered using Shift+F10.</li>
    4949                <li><a href="http://dev.fckeditor.net/ticket/4028">#4028</a> : Maximize control's tool tip was wrong once it is maximized.</li>
     50                <li><a href="http://dev.fckeditor.net/ticket/4269">#4269</a> : "Esc" and "Enter" keystrokes are not handled when a dialogue box is opened which causes the form post automatically.</li>
    5051        </ul>
    5152        <h3>
    5253                CKEditor 3.0</h3>
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy