Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Merge pull request #1598 from ckeditor/t/1597
Browse files Browse the repository at this point in the history
Fix: Renamed the event during selection attributes conversion. `attribute:key` becomes to `attribute:key:$text`. Closes #1597.
  • Loading branch information
scofalik authored Dec 13, 2018
2 parents c33c49c + 8e34405 commit fd7734e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/conversion/downcastdispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ export default class DowncastDispatcher {

// Do not fire event if the attribute has been consumed.
if ( this.conversionApi.consumable.test( selection, 'attribute:' + data.attributeKey ) ) {
this.fire( 'attribute:' + data.attributeKey, data, this.conversionApi );
this.fire( 'attribute:' + data.attributeKey + ':$text', data, this.conversionApi );
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/conversion/downcastdispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ describe( 'DowncastDispatcher', () => {

dispatcher.convertSelection( doc.selection, model.markers, [] );

expect( dispatcher.fire.calledWith( 'attribute:bold' ) ).to.be.true;
expect( dispatcher.fire.calledWith( 'attribute:bold:$text' ) ).to.be.true;
} );

it( 'should not fire attributes events if attribute has been consumed', () => {
Expand Down

0 comments on commit fd7734e

Please sign in to comment.