First commit
This commit is contained in:
39
application/demo/edit/news.edit.button.js
Normal file
39
application/demo/edit/news.edit.button.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import button from '/elements/button.js';
|
||||
|
||||
export default class editButton extends button {
|
||||
|
||||
label = "Save";
|
||||
|
||||
async click( event, object ){
|
||||
|
||||
var result = await this.parent.parent.save();
|
||||
|
||||
// reset id so you can create a new row again
|
||||
var editNewsDialog = this.parent.parent;
|
||||
|
||||
editNewsDialog.id = false;
|
||||
|
||||
// reset title
|
||||
editNewsDialog.newsTitleRow.title.value = "";
|
||||
|
||||
// reset body
|
||||
editNewsDialog.newsBodyRow.body.value = "";
|
||||
|
||||
editNewsDialog.hide();
|
||||
|
||||
this.parents("newsPages").newsPage.sync();
|
||||
|
||||
if( this.parents("newsItemPage").newsListTable ) {
|
||||
|
||||
this.parents("newsItemPage").newsListTable.body.update();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user