Risolto uno dei bug del resize window, spostata funzione minimap

This commit is contained in:
Luca Trupiano 2023-03-20 18:08:05 +01:00
parent 7c3480a8ab
commit 20ef7062c0
3 changed files with 41 additions and 29 deletions

View File

@ -441,7 +441,10 @@
</div>
<div class="d-table-row w-100">
<div class="visInfo w-100 d-flex" style="flex-direction: column;">
<div id='displayinfo' class="pt-3 px-3">Visualizza info <br><br><br><br><br></div>
<div id='displayinfo' class="pt-3 px-3">Visualizza info <br>
<button class="btn btn-sm btn-outline-primary px-1 pt-1 pb-0" id="incrFontSize" style="display: none">
<ion-icon name="add-circle"></ion-icon>
</button></div>
</div>
</div>
</div>

View File

@ -29,7 +29,6 @@ $(document).ready(function() {
listaPeriodiRisultato = [];
listaClausoleRisultato=[]
var resultSentences = new Set()
var minimapScrolling = false;
//var displayId = 'displaycanto'
var cantiche=["Inferno", "Purgatorio","Paradiso"]
var loadedCanti=new Set();
@ -129,20 +128,6 @@ $(" ."+formaClass).hover(function(idx, element) {
lsentid=$(this).attr('class').split(' ')[0]
lisid=tmplisid
});
//$("#" + displayId).scroll(function() {
$(displayCantoWrapperId).scroll(function() {
if (minimapScrolling) {
minimapScrolling = false
}
else {
trackScrollCanto()
}
});
/*
@ -764,7 +749,7 @@ function resetFrasi(){
}
function cleanSearchResult() {
let updateMap=false
$("#headingZero").closest('.card').css("display", "none");
$("#collapseZero").collapse('hide');
$("#vistaFrasi").empty()
@ -797,18 +782,12 @@ function resetFrasi(){
listaPeriodiRisultato=[]
listaClausoleRisultato=[]
resultSentences=new Set()
if(cantoDisplayed=='#vistaFrasi'){
if(cantoDisplayed=='#vistaFrasi')
cantoDisplayed=prevCantoDisplayed
updateMap=true
}
$(cantoDisplayed).attr('style', 'display: d-flex;');
//manageMM (cantoDisplayed)
currPage = 0;
if (updateMap)
drawMinimap(cantoDisplayed)
drawMinimap(cantoDisplayed, true)
}
function manageMM(name){

View File

@ -17,9 +17,19 @@ $(document).ready(function() {
function doneResizing(){
$("#displayminimap").empty();;
drawMinimap(currentMinimap);
$('#displayminimap').css('height', 'auto');
drawMinimap(currentMinimap, false);
}
$(displayCantoWrapperId).scroll(function() {
if (minimapScrolling) {
minimapScrolling = false
}
else {
trackScrollCanto()
}
});
// Evento: click sul cambio stile
$('.stileLink').on('click', function() {
var newStyle = $(this)[0].id;
@ -56,6 +66,19 @@ $(document).ready(function() {
});
$("#incrFontSize").click(function() {
newFontSize = incSize($('#displaycanto').css("font-size"), 10, 18, 58)
newH4FontSize = incSize($('#displaycanto h4').css("font-size"), 12, 24, 72)
//newLiFontSize = incSize($('#displaycanto li::marker').css("font-size"), 6, 12, 32)
$('#displaycanto').css("font-size", newFontSize);
$('#displaycanto h4').css("font-size", newH4FontSize);
//$('#displaycanto li::marker').css("font-size", newLiFontSize);
drawMinimap(currentMinimap);
$('iframe').contents().find('.blog-main').css("font-size", newFontSize);
$('iframe').contents().find('.blog-main h4').css("font-size", newH4FontSize);
});
// Funzioni di gestione del comportamento dei bottoni collapse
$('#collapseLogic').on('hidden.bs.collapse', function (e) {
if (e.target.id == "collapseLogic") {
@ -573,7 +596,8 @@ $(document).ready(function() {
const bgImgUrl1 = "./images/fefeff.png";
const bgImgUrl2 = "./images/f8f9fa.png";
// Variabili e costanti funzionali
// Variabili e costanti funzionali
var minimapScrolling = false;
var tabID = 0;
var claListLen = 0;
var condListLen = 0;
@ -1319,7 +1343,6 @@ $(document).ready(function() {
function managePage() {
if (currPage == 0){
//numeroPagine = Math.ceil(listarisultati.length/nRisultatiPerPag);
numeroPagine = Math.ceil(numeroContesti/nRisultatiPerPag);
$("#paginaLista option").remove();
for (let i = 1; i <= numeroPagine; i++) {
@ -1359,5 +1382,12 @@ $(document).ready(function() {
latestPhraseId = "";
}
};
function incSize(currentSize, incr, min, max) {
//fSize = (parseFloat(currentSize) + incr) % max + min;
fSize = Math.max((parseFloat(currentSize) + incr) % max, min);
//console.log("fSize: "+fSize);
return (fSize) + 'px';
};
});