Skip to content

Commit

Permalink
Merge pull request #169 from WordPress/revert-168-update/single-remov…
Browse files Browse the repository at this point in the history
…e-window-element

Revert "Single TinyMCE: Drop window element global"
  • Loading branch information
aduth committed Mar 2, 2017
2 parents ca89f74 + 41039e8 commit 2855d14
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 2855d14

Please sign in to comment.