MediaWiki:BibleGet.js: differenze tra le versioni

nessun oggetto della modifica
(Creata pagina con "//avoid duplicate bibleQuote divs let bibleQuoteCollection = []; let domCheckInterval = []; let ajaxCount = 0; let BibleQuotesDomElements = []; (function($,mw){ $(document).r...")
 
Nessun oggetto della modifica
Riga 31: Riga 31:
let rect = $bGetTIP[0].getBoundingClientRect();
let rect = $bGetTIP[0].getBoundingClientRect();
let excessHeight = (rect.y + rect.height) - window.innerHeight;
let excessHeight = (rect.y + rect.height) - window.innerHeight;
let excessWidth = (rect.x + rect.width) - window.innerWidth;
//if this amount is less than the distance from the top of the screen,
//if this amount is less than the distance from the top of the screen,
// then let's just move our div up by that much
// then let's just move our div up by that much
if(!$bGetTIP.hasClass('sticky') && excessHeight < rect.y){
if(!$bGetTIP.hasClass('sticky')){
let newTop = top - excessHeight;
if(excessHeight > 0 && excessHeight < rect.y){
$bGetTIP.css({"top":newTop});
let newTop = top - excessHeight;
$bGetTIP.css({"top":newTop});
}
if(excessWidth > 0 && excessWidth < rect.x){
let newLeft = left - excessWidth;
$bGetTIP.css({"left":newLeft});
}
} else {
} else {
if(!$bGetTIP.hasClass('sticky')){  
if(!$bGetTIP.hasClass('sticky')){