Add display toggle

This commit is contained in:
Sauli Anto
2019-09-17 15:47:58 +03:00
parent 13a10dcfdd
commit a89cadeac5
5 changed files with 50 additions and 9 deletions

View File

@@ -62,10 +62,11 @@ export default class MathUI extends Plugin {
const formView = new MainFormView( editor.locale, engine );
formView.mathInputView.bind( 'value' ).to( mathCommand, 'value' );
formView.displayButtonView.bind( 'displayIsOn' ).to( mathCommand, 'display');
// Listen to 'submit' button click
// Listen to submit button click
this.listenTo( formView, 'submit', () => {
editor.execute( 'math', formView.equation );
editor.execute( 'math', formView.equation, formView.displayButtonView.isOn );
this._closeFormView();
} );
@@ -101,6 +102,7 @@ export default class MathUI extends Plugin {
}
this._form.equation = mathCommand.value || '';
this._form.displayButtonView.isOn = mathCommand.display || false;
}
_hideUI() {