10000 refactor(modals): rely on NS defaults rather than NSVue ones · designemail/nativescript-vue@592d7c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 592d7c5

Browse files
committed
refactor(modals): rely on NS defaults rather than NSVue ones
1 parent 9ba14d5 commit 592d7c5

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

platform/nativescript/plugins/modal-plugin.js

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ export default {
2929
})
3030

3131
Vue.prototype.$showModal = function(component, options) {
32-
const defaultOptions = {
33-
fullscreen: false,
34-
animated: true,
35-
stretched: false
36-
}
37-
// build options object with defaults
38-
options = Object.assign({}, defaultOptions, options)
39-
4032
return new Promise(resolve => {
4133
let resolved = false
4234
const closeCb = data => {
@@ -52,6 +44,12 @@ export default {
5244
navEntryInstance.$destroy()
5345
}
5446

47+
// build options object with defaults
48+
options = Object.assign({}, options, {
49+
context: null,
50+
closeCallback: closeCb
51+
})
52+
5553
const navEntryInstance = new Vue({
5654
name: 'ModalEntry',
5755
parent: this.$root,
@@ -65,13 +63,7 @@ export default {
6563
})
6664
const modalPage = navEntryInstance.$mount().$el.nativeView
6765

68-
this.$el.nativeView.showModal(modalPage, {
69-
context: null,
70-
closeCallback: closeCb,
71-
fullscreen: options.fullscreen,
72-
animated: options.animated,
73-
stretched: options.stretched
74-
})
66+
this.$el.nativeView.showModal(modalPage, options)
7567
})
7668
}
7769
}

0 commit comments

Comments
 (0)
0