generic paper item hover highlight behaviour, + some tweaks

This commit is contained in:
2023-06-07 22:30:39 +02:00
parent c0028a636b
commit caced38845
3 changed files with 130 additions and 121 deletions

View File

@@ -94,6 +94,13 @@ export default {
this.dom.style.top = `${e.clientY+2}px`;
break;
}
},
truncate( str, n, useWordBoundary ){
if (str.length <= n) { return str; }
const subString = str.slice(0, n-1); // the original check
return (useWordBoundary
? subString.slice(0, subString.lastIndexOf(" "))
: subString) + " &hellip;";
}
},
components: {
@@ -123,10 +130,10 @@ export default {
<div v-html="besoin.description"></div>
</section>
<section v-if="infos.type === 'reponse'" class="reponse-map-popup">
<div v-if="reponse.qui"><label>Qui</label><p v-html="reponse.qui"/></div>
<div v-if="reponse.quoi"><label>Quoi</label><p v-html="reponse.quoi"/></div>
<div v-if="reponse.ou"><label>Où</label><p v-html="reponse.ou"/></div>
<div v-if="reponse.avec"><label>Avec</label><p v-html="reponse.avec"/></div>
<div v-if="reponse.qui"><label>Qui</label><p v-html="truncate(reponse.qui, 100, true)"/></div>
<div v-if="reponse.quoi"><label>Quoi</label><p v-html="truncate(reponse.quoi, 100, true)"/></div>
<div v-if="reponse.ou"><label>Où</label><p v-html="truncate(reponse.ou, 100, true)"/></div>
<div v-if="reponse.avec"><label>Avec</label><p v-html="truncate(reponse.avec, 100, true)"/></div>
</section>
</div>
</div>