Commit a2040834 authored by Elouan Le Bars's avatar Elouan Le Bars

[REF] format code

parent cee389f7
......@@ -24,7 +24,7 @@
@click="plus"
@mousedown="longPlus"
@mouseleave="stopLongClick"
@mouseup="stopLongClick"
@mouseup="stopLongClick"
>
+
</button>
......@@ -68,34 +68,34 @@ export default {
this.$emit("input", this.newValue);
}
},
longPlus: function() {
if(!this.interval){
this.interval = setInterval(() => this.plus(), 100)
longPlus: function () {
if (!this.interval) {
this.interval = setInterval(() => this.plus(), 100);
}
},
longMinus: function() {
if(!this.interval){
this.interval = setInterval(() => this.minus(), 100)
longMinus: function () {
if (!this.interval) {
this.interval = setInterval(() => this.minus(), 100);
}
},
stopLongClick: function() {
clearInterval(this.interval)
this.interval = false
stopLongClick: function () {
clearInterval(this.interval);
this.interval = false;
},
input: function(event) {
input: function (event) {
if (parseInt(event.target.value) > this.min) {
this.$emit('input', parseInt(event.target.value))
this.$emit("input", parseInt(event.target.value));
} else {
this.$emit('input', this.min)
event.target.value = this.min
this.$emit("input", this.min);
event.target.value = this.min;
}
if (parseInt(event.target.value) < this.max) {
this.$emit('input', parseInt(event.target.value))
this.$emit("input", parseInt(event.target.value));
} else {
this.$emit('input', this.max)
event.target.value = this.max
this.$emit("input", this.max);
event.target.value = this.max;
}
}
},
},
created: function () {
this.newValue = this.parsedValue;
......
......@@ -16,9 +16,10 @@
</span>
<IncrementButton
v-model="scenario.numberOfParticipants"
:max=30
:max="30"
class="align-right participants-no-btn"
/><br /><hr>
/><br />
<hr />
</div>
<div class="scenario-line">
<span class="scenario-line-caption">
......@@ -26,9 +27,10 @@
</span>
<IncrementButton
v-model="scenario.meetingDuration"
:max=999
:max="999"
class="align-right"
/><br /><hr>
/><br />
<hr />
</div>
</div>
</div>
......@@ -41,10 +43,16 @@
:key="h.name"
>
<span class="scenario-line-caption">
<p>{{ h.french }}
<Tooltip v-if="h.helper" class="helper">{{ h.helper }}</Tooltip></p>
<p>
{{ h.french }}
</p>
</span>
<IncrementButton v-model="h.qty" :max=99 class="align-right" /><br /><hr>
<IncrementButton
v-model="h.qty"
:max="99"
class="align-right"
/><br />
<hr />
</div>
</div>
</div>
......@@ -87,7 +95,7 @@
<span class="scenario-line-caption">
<IncrementButton
v-model="j.distance"
:max=99
:max="99"
class="scenario-line-button-journey"
/>
<p>km en</p>
......@@ -107,7 +115,8 @@
>
-
</button>
<br /><hr>
<br />
<hr />
</span>
</div>
</div>
......@@ -150,7 +159,6 @@ function initialScenario() {
{
name: "LOGITECH_KIT",
french: "Kits de vidéo-conférence",
helper: "Un kit complet.",
qty: 0,
},
{
......@@ -168,7 +176,7 @@ function initialScenario() {
name: "",
},
journey: [],
}
};
}
export default {
......@@ -216,8 +224,8 @@ export default {
mounted() {
var cookie = JSON.parse(localStorage.getItem(this.title));
if (cookie) {
this.active = cookie[0]
this.scenario = cookie[1]
this.active = cookie[0];
this.scenario = cookie[1];
}
this.$root.$on("retrieveScenarios", (data) => {
if (this.active) {
......@@ -226,8 +234,11 @@ export default {
});
},
updated() {
localStorage.setItem(this.title, JSON.stringify([this.active, this.scenario]));
}
localStorage.setItem(
this.title,
JSON.stringify([this.active, this.scenario])
);
},
};
</script>
......
......@@ -22,7 +22,7 @@ export default {};
color: #838383;
}
.scenario-line-caption-tooltip:hover {
cursor:default;
cursor: default;
}
/* Tooltip text */
.scenario-line-caption-tooltip .scenario-line-caption-tooltip-text {
......
......@@ -23,28 +23,28 @@ export const software_options = [
export const journey_options = [
{
name: 'BIKE_ONE_PERSON_ONE_KM',
french: 'vélo',
name: "BIKE_ONE_PERSON_ONE_KM",
french: "vélo",
},
{
name: 'CAR_HEAT_ENGINE_ONE_KM',
french: 'Voiture thermique',
name: "CAR_HEAT_ENGINE_ONE_KM",
french: "Voiture thermique",
},
{
name: 'CAR_ELECTRIC_ONE_KM',
french: 'Voiture électrique',
name: "CAR_ELECTRIC_ONE_KM",
french: "Voiture électrique",
},
{
name: 'BUS_CITY_ONE_PERSON_KM',
french: 'Bus',
name: "BUS_CITY_ONE_PERSON_KM",
french: "Bus",
},
{
name: 'TRAMWAY_ONE_PERSON_KM',
french: 'Tramway',
name: "TRAMWAY_ONE_PERSON_KM",
french: "Tramway",
},
{
name: 'TRAIN_REGIONAL_ONE_PERSON_KM',
french: 'TER',
name: "TRAIN_REGIONAL_ONE_PERSON_KM",
french: "TER",
},
{
name: "TRAIN_HIGH_SPEED_ONE_PERSON_KM",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment