import comment from '../comment.js'; import saveButton from './comment.saveButton.js'; import commentEditTitle from './comment.edit.title.js'; import commentEditBody from './comment.edit.body.js'; import commentEditAuthor from './comment.edit.author.js'; import header from '/elements/header.js'; import collection from '/unify/collection.js'; import userLabel from './comment.userLabel.js'; import deleteButton from './comment.deleteButton.js'; import editButton from './comment.editButton.js'; import information from './comment.information.js'; export default class editComment extends comment{ layers = 1; display = "flex"; debug = true; flexFlow = "column"; gridTemplate = " '_information ' " + " 'body ' " + " 'body ' " + " 'saveButton ' "; _information = new information(); body = new commentEditBody(); title = new commentEditTitle(); saveButton = new saveButton(); width = "-webkit-fill-available"; #ifdef ANDROID width = "100vw" borderRadius = 18 margin = 4 #ifdef LIGHT background = "white"; #endif #endif create() { this.title.hide(); this.author.disable = true; if( !this.id ) { this.body.useCustomElement = true; } } enableWRITE() { this._information._editButton.show(); } disableWRITE() { this._information._editButton.hide(); this.body.useCustomElement = false; this.saveButton.hide(); } enableDELETE() { this._information._deleteButton.show(); } disableDELETE() { this._information._deleteButton.hide(); } permission() { this.allow( this.author, "WRITE" ); this.allow( this.author, "DELETE" ); } }