Issues #186: fix, The sidevar needs to close when the button is pressed.
This commit is contained in:
@@ -123,6 +123,8 @@ export default {
|
|||||||
* Save button' modal
|
* Save button' modal
|
||||||
*/
|
*/
|
||||||
async saveModal() {
|
async saveModal() {
|
||||||
|
// 傳給 Map,通知 Sidebar 要關閉。
|
||||||
|
this.$emitter.emit('saveModal', false);
|
||||||
// 先判斷有沒有 filter Id,有就儲存 return,沒有就往下走
|
// 先判斷有沒有 filter Id,有就儲存 return,沒有就往下走
|
||||||
// 沒有 filter Id, 有暫存 tempFilterId Id 可以另存新檔
|
// 沒有 filter Id, 有暫存 tempFilterId Id 可以另存新檔
|
||||||
if(this.createFilterId) {
|
if(this.createFilterId) {
|
||||||
|
|||||||
@@ -349,6 +349,19 @@ export default {
|
|||||||
|
|
||||||
// 執行完後才取消 loading
|
// 執行完後才取消 loading
|
||||||
this.isLoading = false;
|
this.isLoading = false;
|
||||||
|
// 存檔 Modal 打開時,側邊欄要關閉
|
||||||
|
this.$emitter.on('saveModal', boolean => {
|
||||||
|
this.sidebarView = boolean;
|
||||||
|
this.sidebarFilter = boolean;
|
||||||
|
this.sidebarTraces = boolean;
|
||||||
|
this.sidebarState = boolean;
|
||||||
|
});
|
||||||
|
this.$emitter.on('leaveFilter', boolean => {
|
||||||
|
this.sidebarView = boolean;
|
||||||
|
this.sidebarFilter = boolean;
|
||||||
|
this.sidebarTraces = boolean;
|
||||||
|
this.sidebarState = boolean;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -60,6 +60,8 @@ export default {
|
|||||||
beforeRouteUpdate(to, from, next) {
|
beforeRouteUpdate(to, from, next) {
|
||||||
// 離開 Discover 頁時判斷是否有無資料和需要存檔
|
// 離開 Discover 頁時判斷是否有無資料和需要存檔
|
||||||
if ((from.name === 'Map') && this.tempFilterId) {
|
if ((from.name === 'Map') && this.tempFilterId) {
|
||||||
|
// 傳給 Map,通知 Sidebar 要關閉。
|
||||||
|
this.$emitter.emit('leaveFilter', false);
|
||||||
leaveFilter(next, this.allMapDataStore.addFilterId, to.path)
|
leaveFilter(next, this.allMapDataStore.addFilterId, to.path)
|
||||||
} else {
|
} else {
|
||||||
next();
|
next();
|
||||||
|
|||||||
Reference in New Issue
Block a user