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