mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-28 16:20:52 +00:00
Disable Table Editing
Native contenteditable execCommands were being tried before the surface was attached to the DOM. This is necessary for disabling native contenteditable object editing and resizing. Change-Id: Idff6a30432396726deb8a38356172380ea12fced
This commit is contained in:
parent
17b33dc94e
commit
9f4a4d9e92
|
@ -66,10 +66,6 @@ ve.ce.Surface = function VeCeSurface( $container, model, surface ) {
|
|||
}, this ) );
|
||||
|
||||
// Initialization
|
||||
try {
|
||||
document.execCommand( 'enableObjectResizing', false, false );
|
||||
document.execCommand( 'enableInlineTableEditing', false, false );
|
||||
} catch ( e ) { /* Silently ignore */ }
|
||||
rangy.init();
|
||||
ve.ce.Surface.clearLocalStorage();
|
||||
this.$.append( this.documentView.getDocumentNode().$ );
|
||||
|
|
|
@ -43,6 +43,12 @@ ve.Surface = function VeSurface( parent, dom, options ) {
|
|||
this.setupCommands();
|
||||
ve.instances.push( this );
|
||||
this.model.startHistoryTracking();
|
||||
|
||||
// Turn off native object editing. This must be tried after the surface has been added to DOM.
|
||||
try {
|
||||
document.execCommand( 'enableObjectResizing', false, false );
|
||||
document.execCommand( 'enableInlineTableEditing', false, false );
|
||||
} catch ( e ) { /* Silently ignore */ }
|
||||
};
|
||||
|
||||
/* Static Members */
|
||||
|
|
Loading…
Reference in a new issue