diff --git a/ayanova/src/api/gzform.js b/ayanova/src/api/gzform.js index 570655bc..1ecb1bd1 100644 --- a/ayanova/src/api/gzform.js +++ b/ayanova/src/api/gzform.js @@ -679,21 +679,25 @@ export default { setFormState(newState) { //this returns a promise so any function that needs to wait for this can utilize that return Vue.nextTick(function() { - if (newState.valid != undefined) { + if (newState.valid != null) { newState.vm.formState.valid = newState.valid; } - if (newState.dirty != undefined) { + if (newState.dirty != null) { newState.vm.formState.dirty = newState.dirty; } - if (newState.loading != undefined) { + if (newState.loading != null) { newState.vm.formState.loading = newState.loading; } - if (newState.readOnly != undefined) { + if (newState.readOnly != null) { newState.vm.formState.readOnly = newState.readOnly; } + + if (newState.ready != null) { + newState.vm.formState.ready = newState.ready; + } }); }, //////////////////////////////////// diff --git a/ayanova/src/components/wiki-control.vue b/ayanova/src/components/wiki-control.vue index e51dee8e..613e3e4c 100644 --- a/ayanova/src/components/wiki-control.vue +++ b/ayanova/src/components/wiki-control.vue @@ -800,12 +800,6 @@ export default { - - - -todo: Undo / redo (ctrl-z / ctrl-y) ability? - - may need a library for this one if it's tricky to support levels of undo - todo: wiki controls showing before widget form has loaded causing annoying ability to click but then doesn't work right away - wiki controls (and indeed nothing at all) should show on form until the object is finished loading diff --git a/ayanova/src/views/widget.vue b/ayanova/src/views/widget.vue index 2a28e79f..ba11d39a 100644 --- a/ayanova/src/views/widget.vue +++ b/ayanova/src/views/widget.vue @@ -218,6 +218,20 @@ + + @@ -237,7 +251,7 @@ export default { initForm(vm) .then(() => { vm.rights = window.$gz.role.getRights(window.$gz.type.Widget); - vm.formState.ready = true; + window.$gz.eventBus.$on("menu-click", clickHandler); //id 0 means create a new record don't load one if (vm.$route.params.recordid != 0) { @@ -251,18 +265,23 @@ export default { dirty: false, valid: true, loading: false, - readOnly: readOnly + readOnly: readOnly, + ready: true }); // //bugbug WTF? This doesn't make sense, if it's an attempt to hide delete button then that's wrong // //it's a new record so it can't be deleted so... // vm.rights.delete = false; generateMenu(vm); + vm.formState.ready = true; } }) .catch(err => { - vm.formState.ready = true; window.$gz.errorHandler.handleFormError(err, vm); + vm.formState.ready = true; + }) + .finally(function() { + // vm.formState.ready = true; }); }, beforeRouteUpdate(to, from, next) { @@ -398,6 +417,7 @@ export default { window.$gz.api .get(url) .then(res => { + vm.formState.ready = true; if (res.error) { //Not found? if (res.error.code == "2010") {