-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🔀 Merge pull request #146 from Lissy93/FEATURE/multi-tasking-support
[FEATURE] Multi-Tasking Support in Workspace View Closes #144
- Loading branch information
Showing
8 changed files
with
95 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "Dashy", | ||
"version": "1.5.7", | ||
"version": "1.5.8", | ||
"license": "MIT", | ||
"main": "server", | ||
"scripts": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<template> | ||
<div class="multi-taking-view" ref="container"></div> | ||
</template> | ||
|
||
<script> | ||
import Vue from 'vue'; | ||
import WebContent from '@/components/Workspace/WebContent'; | ||
export default { | ||
name: 'WebContent', | ||
props: { | ||
url: String, // The URL of currently visible app | ||
}, | ||
data: () => ({ | ||
openApps: [], // List of all currently open apps | ||
}), | ||
watch: { | ||
/* Update the currently open app, when URL changes */ | ||
url() { this.launchApp(); }, | ||
}, | ||
methods: { | ||
/* Check if app already open or not, and call appropriate opener */ | ||
launchApp() { | ||
if (this.openApps.includes(this.url)) { | ||
this.openExistingApp(); | ||
} else { | ||
this.openApps.push(this.url); | ||
this.appendNewApp(); | ||
} | ||
}, | ||
/* Opens a new app */ | ||
appendNewApp() { | ||
const ComponentClass = Vue.extend(WebContent); | ||
const instance = new ComponentClass({ | ||
propsData: { url: this.url, id: btoa(this.url) }, | ||
}); | ||
instance.$mount(); // pass nothing | ||
this.$refs.container.appendChild(instance.$el); | ||
}, | ||
/* Switches visibility to an already open app */ | ||
openExistingApp() { | ||
Array.from(document.getElementsByClassName('web-content')).forEach((frame) => { | ||
frame.classList.add('hide'); | ||
}); | ||
document.getElementById(btoa(this.url)).classList.remove('hide'); | ||
}, | ||
}, | ||
}; | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
iframe { | ||
position: absolute; | ||
left: var(--side-bar-width); | ||
height: calc(100% - var(--header-height)); | ||
width: calc(100% - var(--side-bar-width)); | ||
border: none; | ||
background: white; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters