Skip to content

Commit 0bfca16

Browse files
committed
⚡ Re: #254 - Adds new tab functionality to Workspace
1 parent bc100b8 commit 0bfca16

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

src/components/Workspace/SideBar.vue

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ export default {
5858
this.isOpen = this.isOpen.map((val, ind) => (ind !== index ? false : !val));
5959
},
6060
/* When item clicked, emit a launch event */
61-
launchApp(url) {
62-
this.$emit('launch-app', url);
61+
launchApp(options) {
62+
this.$emit('launch-app', options);
6363
},
6464
/* If an initial URL is specified, then open relevant section */
6565
openDefaultSection() {

src/components/Workspace/SideBarItem.vue

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@ export default {
1717
icon: String,
1818
title: String,
1919
url: String,
20+
target: String,
2021
click: Function,
2122
},
2223
components: {
2324
Icon,
2425
},
2526
methods: {
2627
itemClicked() {
27-
if (this.url) this.$emit('launch-app', this.url);
28+
if (this.url) this.$emit('launch-app', { url: this.url, target: this.target });
2829
},
2930
},
3031
data() {

src/components/Workspace/SideBarSection.vue

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
:icon="item.icon"
77
:title="item.title"
88
:url="item.url"
9+
:target="item.target"
910
@launch-app="launchApp"
1011
/>
1112
</div>
@@ -26,8 +27,8 @@ export default {
2627
SideBarItem,
2728
},
2829
methods: {
29-
launchApp(url) {
30-
this.$emit('launch-app', url);
30+
launchApp(options) {
31+
this.$emit('launch-app', options);
3132
},
3233
},
3334
};

src/views/Workspace.vue

+6-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,12 @@ export default {
3737
MultiTaskingWebComtent,
3838
},
3939
methods: {
40-
launchApp(url) {
41-
this.url = url;
40+
launchApp(options) {
41+
if (options.target === 'newtab') {
42+
window.open(options.url, '_blank');
43+
} else {
44+
this.url = options.url;
45+
}
4246
},
4347
setTheme() {
4448
const theme = this.GetTheme();

0 commit comments

Comments
 (0)