tab switch bugfix; remove floating div
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
:disabled="!orderChanged" @click="resetOrder">Reset</v-btn>
|
||||
<v-btn id="share-btn" variant="text" prepend-icon="mdi-share" v-if="co.orders.length>0"
|
||||
:disabled="sharing"
|
||||
@click="shareOrder">{{sharing?'Preparing...':'Share'}}</v-btn>
|
||||
@click="shareOrder">{{sharing?'Preparing...':'Share Order'}}</v-btn>
|
||||
<v-tooltip activator="#share-btn" :text="shareError?'Error copying share link :(':'Copied share link!'" v-model="showSharedTooltip"
|
||||
:open-on-hover="false" :open-on-click="false"
|
||||
/>
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
@click="()=>{if (props.builder.breakout!==undefined) props.builder.breakout=!props.builder.breakout}">{{ name }}</v-btn>
|
||||
<div class="description w-100 text-center">{{description}}</div>
|
||||
</div>
|
||||
-->
|
||||
<!--
|
||||
<floating-div id="rungs" v-if="endpoints[0]">
|
||||
-->
|
||||
<v-text-field type="number" v-model="rungs"
|
||||
density="compact" hide-details class="mx-1 my-2" variant="outlined"
|
||||
@@ -16,9 +19,11 @@
|
||||
:color="color"
|
||||
min="1" :max="MAX_RUNGS"
|
||||
:disabled="rungsDisabled"
|
||||
style="width: 6.6em; max-height: 2.5em; height: 2.5em"
|
||||
id="rungs"
|
||||
/>
|
||||
<!--
|
||||
</floating-div>
|
||||
-->
|
||||
<one-time-hint name="rungs" activator="#rungs" after="choose-builder"
|
||||
text="↓ Try increasing rungs!" location="top"
|
||||
:when="rungs===1&&endpoints[0]!==null"
|
||||
@@ -50,10 +55,16 @@
|
||||
</div>
|
||||
<div v-if="rungs>1" class="mx-2 d-flex justify-start">
|
||||
<div class="d-flex align-center mt-2">
|
||||
<!--
|
||||
<floating-div id="slider" v-if="endpoints[0]">
|
||||
-->
|
||||
<div id="balance-slider">
|
||||
<v-slider v-if="rungs>1" :direction="orientation?'vertical':'horizontal'" min="-100" max="100" v-model="balance100"
|
||||
class="no-slider-bg ml-2 mr-4" hide-details/>
|
||||
</div>
|
||||
<!--
|
||||
</floating-div>
|
||||
-->
|
||||
<one-time-hint name="balance-slider" activator="#balance-slider" after="rungs"
|
||||
text="↓ Slide the amount balance ↓" location="top"
|
||||
:when="balance100===0"
|
||||
@@ -93,6 +104,7 @@ import {
|
||||
import {logicalXOR} from "@/common.js";
|
||||
import OneTimeHint from "@/components/OneTimeHint.vue";
|
||||
import {track} from "@/track.js";
|
||||
import FloatingDiv from "@/components/FloatingDiv.vue";
|
||||
|
||||
const co = useChartOrderStore()
|
||||
const endpoints = defineModel('modelValue') // 2-item list of points/values
|
||||
@@ -119,7 +131,9 @@ const flippedSign = computed(()=>props.flip?-1:1)
|
||||
|
||||
const balance100 = computed( {
|
||||
get() {return flippedSign.value*props.builder.balance*100},
|
||||
set(v) {props.builder.balance = flippedSign.value*v/100; }
|
||||
set(v) {
|
||||
if (v<-60) v = -60;
|
||||
props.builder.balance = flippedSign.value*v/100; }
|
||||
} )
|
||||
|
||||
// validity checks
|
||||
@@ -236,11 +250,7 @@ const values = computed(()=>{
|
||||
const weights = computed(() => {
|
||||
// const balance = props.flip ? -props.builder.balance : props.builder.balance
|
||||
const most = 0.998
|
||||
let balance = -props.builder.balance
|
||||
if (balance <= -1)
|
||||
balance = -most
|
||||
else if (balance >= 1)
|
||||
balance = most
|
||||
let balance = Math.min(most, Math.max(-most, -props.builder.balance))
|
||||
const ws = linearWeights(props.builder.rungs, balance)
|
||||
if (props.setWeights)
|
||||
props.setWeights(ws)
|
||||
|
||||
@@ -9,10 +9,9 @@
|
||||
|
||||
<script setup>
|
||||
import {computed} from "vue";
|
||||
import {useRoute} from "vue-router";
|
||||
import {router} from "@/router/router.js";
|
||||
|
||||
const props = defineProps(['icon', 'route', 'tooltip', 'href', 'target'])
|
||||
const router = useRoute();
|
||||
const isCurrent = computed(() => router.name === props.route)
|
||||
|
||||
function click() {
|
||||
@@ -29,7 +28,7 @@ function click() {
|
||||
}
|
||||
else
|
||||
// noinspection JSIgnoredPromiseFromCall
|
||||
router1.push({name: props.route})
|
||||
router.push({name: props.route})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user