create post edit view change
This commit is contained in:
@@ -30,7 +30,9 @@ import ModalView from 'views/modal';
|
||||
|
||||
class CreatePostModalView extends ModalView {
|
||||
|
||||
templateContent = '<div class="record">{{{record}}}</div>'
|
||||
templateContent = `
|
||||
<div class="record no-side-margin">{{{record}}}</div>
|
||||
`
|
||||
|
||||
shortcutKeys = {
|
||||
'Control+Enter': 'post',
|
||||
|
||||
@@ -105,47 +105,11 @@ class EditStreamView extends BaseRecordView {
|
||||
}
|
||||
}
|
||||
|
||||
data() {
|
||||
const data = super.data();
|
||||
|
||||
data.interactiveMode = this.options.interactiveMode;
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
setup() {
|
||||
super.setup();
|
||||
|
||||
this.seed = this.model.clone();
|
||||
|
||||
if (this.options.interactiveMode) {
|
||||
this.events['focus textarea[data-name="post"]'] = () => {
|
||||
this.enablePostingMode();
|
||||
};
|
||||
|
||||
this.addHandler('keydown', 'textarea[data-name="post"]', /** KeyboardEvent */e => {
|
||||
if (Espo.Utils.getKeyFromKeyEvent(e) === 'Control+Enter') {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
|
||||
this.post();
|
||||
}
|
||||
|
||||
// Don't hide to be able to focus on the upload button.
|
||||
/*if (e.code === 'Tab') {
|
||||
let $text = $(e.currentTarget);
|
||||
|
||||
if ($text.val() === '') {
|
||||
this.disablePostingMode();
|
||||
}
|
||||
}*/
|
||||
});
|
||||
|
||||
this.events['click button.post'] = () => {
|
||||
this.post();
|
||||
};
|
||||
}
|
||||
|
||||
const optionList = ['self'];
|
||||
|
||||
this.model.set('type', 'Post');
|
||||
@@ -280,17 +244,6 @@ class EditStreamView extends BaseRecordView {
|
||||
|
||||
afterSave() {
|
||||
Espo.Ui.success(this.translate('Posted'));
|
||||
|
||||
if (this.options.interactiveMode) {
|
||||
this.model.clear();
|
||||
this.model.set('targetType', 'self');
|
||||
this.model.set('type', 'Post');
|
||||
|
||||
this.disablePostingMode();
|
||||
this.enablePostButton();
|
||||
|
||||
this.getFieldView('post').$element.prop('rows', 1);
|
||||
}
|
||||
}
|
||||
|
||||
afterNotValid() {
|
||||
|
||||
Reference in New Issue
Block a user