Enable dev and compact basic mode.

This commit is contained in:
Kasen IO 2020-04-04 21:24:06 -04:00
parent 70a0d50ede
commit 1bea2870f0

View file

@ -26,9 +26,11 @@
<v-app-bar <v-app-bar
app app
> >
<v-app-bar-nav-icon @click="drawer = true"></v-app-bar-nav-icon> <v-app-bar-nav-icon @click="drawer = true"></v-app-bar-nav-icon>
<v-toolbar-title>Inventory</v-toolbar-title> <v-toolbar-title>Inventory</v-toolbar-title>
</v-app-bar> </v-app-bar>
<v-navigation-drawer <v-navigation-drawer
@ -39,9 +41,18 @@
<v-list <v-list
nav nav
> >
<v-list-item-group <v-list-item-group>
<v-list-item @click="compactToggle = !compactToggle">
<v-switch
@click="compactToggle = !compactToggle"
v-model="compactToggle"
:label="`Compact`"
></v-switch>
</v-list-item>
>
<v-list-item @click="addDialog.show = true"> <v-list-item @click="addDialog.show = true">
<v-list-item-icon> <v-list-item-icon>
<v-icon>mdi-plus</v-icon> <v-icon>mdi-plus</v-icon>
@ -73,12 +84,12 @@
max-width="344" max-width="344"
outlined outlined
> >
<v-list-item three-line> <v-list-item one-line>
<v-list-item-content class="pb-1 pt-2"> <v-list-item-content class="pb-1 pt-2">
<div class="overline" style="font-size: 0.825rem !important;">{{item.type}}</div> <div class="overline" style="font-size: 0.825rem !important;">{{item.type}}</div>
<v-list-item-title class="subtitle-1 mb-1">{{item.name}}</v-list-item-title> <v-list-item-title class="subtitle-1 mb-1">{{item.name}}</v-list-item-title>
<v-list-item-subtitle>{{item.url}}</v-list-item-subtitle> <v-list-item-subtitle v-show="!compactToggle">{{item.url}}</v-list-item-subtitle>
</v-list-item-content> </v-list-item-content>
<v-menu bottom left> <v-menu bottom left>
@ -468,6 +479,16 @@
var vue_this; var vue_this;
function browserDevelopment() {
if (typeof EventBridge !== 'undefined') {
return false; // We are in the browser, probably for development purposes.
} else {
return true; // We are in Vircadia.
}
}
if (!browserDevelopment()) {
EventBridge.scriptEventReceived.connect(function(receivedCommand) { EventBridge.scriptEventReceived.connect(function(receivedCommand) {
receivedCommand = JSON.parse(receivedCommand); receivedCommand = JSON.parse(receivedCommand);
// alert("RECEIVED COMMAND:" + receivedCommand.command) // alert("RECEIVED COMMAND:" + receivedCommand.command)
@ -491,6 +512,8 @@ EventBridge.scriptEventReceived.connect(function(receivedCommand) {
} }
}); });
}
new Vue({ new Vue({
el: '#inventoryApp', el: '#inventoryApp',
vuetify: new Vuetify(), vuetify: new Vuetify(),
@ -612,6 +635,7 @@ new Vue({
}, },
], ],
sortBy: "alphabetical", sortBy: "alphabetical",
compactToggle: true,
darkTheme: true, darkTheme: true,
drawer: false, drawer: false,
}), }),
@ -798,8 +822,11 @@ new Vue({
"data": data "data": data
}; };
// alert(JSON.stringify(JSONtoSend)); if (!browserDevelopment()) {
EventBridge.emitWebEvent(JSON.stringify(JSONtoSend)); EventBridge.emitWebEvent(JSON.stringify(JSONtoSend));
} else {
alert(JSON.stringify(JSONtoSend));
}
}, },
}, },
watch: { watch: {