Added editing support to the View API (#2279)

* Added edit to view API

* Fixed listener deregistration bug
This commit is contained in:
Andrew Henry
2019-02-13 19:26:26 -08:00
committed by Pegah Sarram
parent d0ab59f9da
commit 853764d863
14 changed files with 123 additions and 66 deletions

View File

@ -39,6 +39,7 @@ export default class Editor extends EventEmitter {
* Initiate an editing session. This will start a transaction during
* which any persist operations will be deferred until either save()
* or finish() are called.
* @private
*/
edit() {
if (this.editing === true) {
@ -59,6 +60,8 @@ export default class Editor extends EventEmitter {
/**
* Save any unsaved changes from this editing session. This will
* end the current transaction.
*
* @private
*/
save() {
return this.getTransactionService().commit().then((result)=>{
@ -72,6 +75,8 @@ export default class Editor extends EventEmitter {
/**
* End the currently active transaction and discard unsaved changes.
*
* @private
*/
cancel() {
this.getTransactionService().cancel();