-import {onChildEvent, onEnterPress, onSelect} from '../services/dom';
+import {onChildEvent, onEnterPress, onSelect} from '../services/dom.ts';
import {Component} from './component';
export class CodeEditor extends Component {
this.hide();
}
- async open(code, language, saveCallback, cancelCallback) {
+ async open(code, language, direction, saveCallback, cancelCallback) {
this.languageInput.value = language;
this.saveCallback = saveCallback;
this.cancelCallback = cancelCallback;
await this.show();
this.languageInputChange(language);
this.editor.setContent(code);
+ this.setDirection(direction);
}
async show() {
});
}
+ setDirection(direction) {
+ const target = this.editorInput.parentElement;
+ if (direction) {
+ target.setAttribute('dir', direction);
+ } else {
+ target.removeAttribute('dir');
+ }
+ }
+
hide() {
this.getPopup().hide();
this.addHistory();