Skip to content

Commit

Permalink
Fix switching between block types (paragraph, quote and heading) (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad authored Feb 21, 2017
1 parent 8606884 commit 33db39f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -468,12 +468,9 @@ function attachTypeSwitcherActions() {
} );

Object.keys( typeToTag ).forEach( function( type ) {
var selector = '.switch-block__block .type-icon-' + type;
var button = queryFirst( selector );
var label = queryFirst( selector + ' + label' );

var iconSelector = '.switch-block__block .type-icon-' + type;
var button = queryFirst( iconSelector ).parentNode;
button.addEventListener( 'click', switchBlockType, false );
label.addEventListener( 'click', switchBlockType, false );

function switchBlockType( event ) {
if ( ! selectedBlock ) {
Expand Down

0 comments on commit 33db39f

Please sign in to comment.