Skip to content

Commit

Permalink
Revert "Single TinyMCE: Drop window element global"
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth authored Mar 2, 2017
1 parent faae59a commit c4c1950
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions shared/tinymce/toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@
function onClick( callback ) {
return function() {
editor.undoManager.transact( function() {
var element = editor.selection.getSelectedBlocks()[ 0 ];
callback( editor, element );
callback( editor, window.element );
} );
}
}
Expand Down
4 changes: 2 additions & 2 deletions tinymce-single/tinymce/block.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

// Set focussed block. Global variable for now. Top-level node for now.

editor.on( 'nodechange', function() {
element = editor.selection.getSelectedBlocks()[ 0 ];
editor.on( 'nodechange', function( event ) {
element = window.element = event.parents[ event.parents.length - 1 ];
} );

// Global controls
Expand Down

0 comments on commit c4c1950

Please sign in to comment.