Ticket #4369: 4369.patch

File 4369.patch, 1.9 KB (added by Tobiasz Cudnik, 15 years ago)
  • _source/plugins/contextmenu/plugin.js

     
    3535                                editor.execCommand( commandName );
    3636                        },
    3737                        this);
    38 
    39                         // Disable context menu for top and bottom editor's UI parts.
    40                         var self = this;
    41                         editor.on( 'themeLoaded', function()
    42                                 {
    43                                         self.addDisabledTarget( this.container );
    44                                 } );
    4538        },
    4639
    4740        _ :
     
    154147                                this );
    155148                },
    156149
    157                 addDisabledTarget : function( element )
    158                 {
    159                         element.on( 'contextmenu', function( event )
    160                                 {
    161                                         // Cancel the browser context menu.
    162                                         if ( !event.data.getTarget().hasClass( 'cke_enable_context_menu' ) )
    163                                                 event.data.preventDefault();
    164                                 } );
    165                 },
    166 
    167150                addListener : function( listenerFn )
    168151                {
    169152                        this._.listeners.push( listenerFn );
  • _source/themes/default/theme.js

     
    8686                         */
    8787                        editor.container = container;
    8888
     89                        // Disable browser context menu for editor's chrome.
     90                        container.disableContextMenu();
     91
    8992                        editor.fireOnce( 'themeLoaded' );
    9093                        editor.fireOnce( 'uiReady' );
    9194                },
  • _source/core/dom/element.js

     
    13801380                getChildCount : function()
    13811381                {
    13821382                        return this.$.childNodes.length;
    1383                 }
     1383                },
     1384
     1385                disableContextMenu : function()
     1386                {
     1387                        this.on( 'contextmenu', function( event )
     1388                                {
     1389                                        // Cancel the browser context menu.
     1390                                        if ( !event.data.getTarget().hasClass( 'cke_enable_context_menu' ) )
     1391                                                event.data.preventDefault();
     1392                                } );
     1393                }
    13841394        });
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy