#101 init function added

master
Agriya Dev5 2021-05-21 13:17:49 +05:30
parent 57d28c58c4
commit 5a87301f90
2 changed files with 10 additions and 4 deletions

View File

@ -87,9 +87,11 @@ class EditorStartup {
document.body.append(newSeEditPrefsDialog);
// canvas menu added to DOM
const dialogBox = document.createElement('se-cmenu_canvas-dialog');
dialogBox.setAttribute('id', 'se-cmenu_canvas');
dialogBox.setAttribute('i18next-tools-cut', this.i18next.t('tools.cut'));
dialogBox.setAttribute('id', 'se-cmenu_canvas');
// dialogBox.setAttribute('toolscut', this.i18next.t('tools.cut'));
document.body.append(dialogBox);
dialogBox.init(this.i18next);
console.log(dialogBox);
// alertDialog added to DOM
const alertBox = document.createElement('se-alert-dialog');
alertBox.setAttribute('id', 'se-alert-dialog');

View File

@ -145,12 +145,16 @@ export class SeCMenuDialog extends HTMLElement {
this.$moveDownLink = this._shadowRoot.querySelector('#se-move-down');
this.$moveBackLink = this._shadowRoot.querySelector('#se-move-back');
}
init (i18next) {
var textnode = document.createTextNode(newValue);
this._shadowRoot.querySelector('#se-cut').prepend(textnode);
}
/**
* @function observedAttributes
* @returns {any} observed
*/
static get observedAttributes () {
return [ 'disableallmenu', 'enablemenuitems', 'disablemenuitems', 'i18next-tools-cut' ];
return [ 'disableallmenu', 'enablemenuitems', 'disablemenuitems', 'toolscut' ];
}
/**
* @function attributeChangedCallback
@ -185,7 +189,7 @@ export class SeCMenuDialog extends HTMLElement {
selEle.parentElement.classList.add('disabled');
});
break;
case 'i18next-tools-cut':
case 'toolscut':
var textnode = document.createTextNode(newValue);
this._shadowRoot.querySelector('#se-cut').prepend(textnode);
break;