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

Commit

Permalink
Changed: Use bind().toMany() binding chain from ObservableMixin.
Browse files Browse the repository at this point in the history
  • Loading branch information
jodator committed Feb 1, 2018
1 parent 529c0be commit 77da5c8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/heading.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import HeadingEngine from './headingengine';
import Plugin from '@ckeditor/ckeditor5-core/src/plugin';
import Model from '@ckeditor/ckeditor5-ui/src/model';

import bindOneToMany from '@ckeditor/ckeditor5-ui/src/bindings/bindonetomany';
import { createDropdown, addListViewToDropdown } from '@ckeditor/ckeditor5-ui/src/dropdown/utils';

import Collection from '@ckeditor/ckeditor5-utils/src/collection';
Expand Down Expand Up @@ -82,11 +81,11 @@ export default class Heading extends Plugin {

addListViewToDropdown( dropdownView, dropdownItems );

bindOneToMany( dropdownView, 'isEnabled', commands, 'isEnabled', ( ...areEnabled ) => {
dropdownView.bind( 'isEnabled' ).toMany( commands, 'isEnabled', ( ...areEnabled ) => {
return areEnabled.some( isEnabled => isEnabled );
} );

bindOneToMany( dropdownView, 'label', commands, 'value', ( ...areActive ) => {
dropdownView.bind( 'label' ).toMany( commands, 'value', ( ...areActive ) => {
const index = areActive.findIndex( value => value );

// If none of the commands is active, display default title.
Expand Down

0 comments on commit 77da5c8

Please sign in to comment.