Re: #254 - Adds new tab functionality to Workspace

This commit is contained in:
Alicia Sykes 2021-09-29 20:39:39 +01:00
parent bc100b8143
commit 0bfca16dda
4 changed files with 13 additions and 7 deletions

View File

@ -58,8 +58,8 @@ export default {
this.isOpen = this.isOpen.map((val, ind) => (ind !== index ? false : !val));
},
/* When item clicked, emit a launch event */
launchApp(url) {
this.$emit('launch-app', url);
launchApp(options) {
this.$emit('launch-app', options);
},
/* If an initial URL is specified, then open relevant section */
openDefaultSection() {

View File

@ -17,6 +17,7 @@ export default {
icon: String,
title: String,
url: String,
target: String,
click: Function,
},
components: {
@ -24,7 +25,7 @@ export default {
},
methods: {
itemClicked() {
if (this.url) this.$emit('launch-app', this.url);
if (this.url) this.$emit('launch-app', { url: this.url, target: this.target });
},
},
data() {

View File

@ -6,6 +6,7 @@
:icon="item.icon"
:title="item.title"
:url="item.url"
:target="item.target"
@launch-app="launchApp"
/>
</div>
@ -26,8 +27,8 @@ export default {
SideBarItem,
},
methods: {
launchApp(url) {
this.$emit('launch-app', url);
launchApp(options) {
this.$emit('launch-app', options);
},
},
};

View File

@ -37,8 +37,12 @@ export default {
MultiTaskingWebComtent,
},
methods: {
launchApp(url) {
this.url = url;
launchApp(options) {
if (options.target === 'newtab') {
window.open(options.url, '_blank');
} else {
this.url = options.url;
}
},
setTheme() {
const theme = this.GetTheme();