@afeefa/vue-app 0.0.148 → 0.0.150
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.150
|
package/package.json
CHANGED
@@ -74,7 +74,7 @@ export default class EditForm extends Vue {
|
|
74
74
|
* Using the created() method would result in already having set
|
75
75
|
* the default date, hence not detecting a valid "change" anymore.
|
76
76
|
*
|
77
|
-
* comment 14.12. -> this should not be necessary if components do not alter models
|
77
|
+
* comment 14.12.22 -> this should not be necessary if components do not alter models
|
78
78
|
*/
|
79
79
|
// @Watch('modelToEdit', {immediate: true})
|
80
80
|
// @Watch('modelToEdit')
|
@@ -42,7 +42,7 @@
|
|
42
42
|
:changed="changed"
|
43
43
|
:valid="valid"
|
44
44
|
angular
|
45
|
-
:has="{reset: !!modelToEdit.id}"
|
45
|
+
:has="{reset: reset && !!modelToEdit.id}"
|
46
46
|
@save="$emit('save', modelToEdit, ignoreChangesOnClose, close)"
|
47
47
|
@reset="$refs.form.reset()"
|
48
48
|
/>
|
@@ -60,7 +60,7 @@ import { Component, Vue, Watch } from '@a-vue'
|
|
60
60
|
import { DialogEvent } from '@a-vue/events'
|
61
61
|
|
62
62
|
@Component({
|
63
|
-
props: ['model', 'createModelToEdit', 'show']
|
63
|
+
props: ['model', 'createModelToEdit', 'show', {reset: true}]
|
64
64
|
})
|
65
65
|
export default class EditModal extends Vue {
|
66
66
|
show_ = false
|
@@ -144,9 +144,11 @@ class RouteConfigPlugin {
|
|
144
144
|
|
145
145
|
const options = {
|
146
146
|
mode: 'history',
|
147
|
-
scrollBehavior (
|
147
|
+
scrollBehavior (to, from, savedPosition) {
|
148
148
|
if (savedPosition) {
|
149
149
|
return savedPosition
|
150
|
+
} else if (to.path === from.path) { // don't scroll just query changes === probably list navigation
|
151
|
+
return {}
|
150
152
|
} else {
|
151
153
|
return { x: 0, y: 0 }
|
152
154
|
}
|
@@ -43,7 +43,6 @@ import { DialogEvent } from '@a-vue/events'
|
|
43
43
|
})
|
44
44
|
export default class EditPage extends Vue {
|
45
45
|
unregisterRouterHook = null
|
46
|
-
ignoreChangesOnRouteChange_ = false
|
47
46
|
|
48
47
|
created () {
|
49
48
|
this.unregisterRouterHook = this.$router.beforeEach(async (to, from, next) => {
|
@@ -70,9 +69,7 @@ export default class EditPage extends Vue {
|
|
70
69
|
* hook to allow to leave a just created (saved) model
|
71
70
|
*/
|
72
71
|
ignoreChangesOnRouteChange () {
|
73
|
-
|
74
|
-
console.info('TODO switch form to forceUnchanged')
|
75
|
-
this.ignoreChangesOnRouteChange_ = true
|
72
|
+
this.$refs.form.forceUnchanged()
|
76
73
|
}
|
77
74
|
}
|
78
75
|
</script>
|