MediaWiki:BibleGet.js: Difference between revisions
no edit summary
Johnrdorazio (talk | contribs) No edit summary |
Johnrdorazio (talk | contribs) No edit summary |
||
Line 13: | Line 13: | ||
let ref = $(this).attr('data-ref'); | let ref = $(this).attr('data-ref'); | ||
let inline = ($(this).attr('data-inline') == "true"); | let inline = ($(this).attr('data-inline') == "true"); | ||
console.log("data-ref = " + ref + " data-inline = " + inline); | |||
if(bibleQuoteCollection.includes(version+"/"+ref)){ | if(bibleQuoteCollection.includes(version+"/"+ref)){ | ||
//we already have an instance of this bible quote, avoid creating new div | //we already have an instance of this bible quote, avoid creating new div | ||
Line 25: | Line 25: | ||
console.log('I found ' + $bGetTIP.length + ' div(s) at the bottom of the page with this bible quote'); | console.log('I found ' + $bGetTIP.length + ' div(s) at the bottom of the page with this bible quote'); | ||
$bGetTIP.removeClass('hidden'); | $bGetTIP.removeClass('hidden'); | ||
let top = $ | let top = $el.offset().top; | ||
let left = $ | let left = $el.offset().left + $el.outerWidth() + 15; | ||
$bGetTIP.css({"top":top,"left":left}); | $bGetTIP.css({"top":top,"left":left}); | ||
if($bGetTIP.hasClass('sticky') || $bGetTIP.is(':offscreen') ){ | if($bGetTIP.hasClass('sticky') || $bGetTIP.is(':offscreen') ){ | ||
Line 100: | Line 100: | ||
$el.on('mouseenter', function(){ | $el.on('mouseenter', function(){ | ||
$bGetTIP.removeClass('hidden'); | $bGetTIP.removeClass('hidden'); | ||
let top = $ | let top = $el.offset().top; | ||
let left = $ | let left = $el.offset().left + $el.outerWidth() + 15; | ||
$bGetTIP.css({"top":top,"left":left}); | $bGetTIP.css({"top":top,"left":left}); | ||
if($bGetTIP.hasClass('sticky') || $bGetTIP.is(':offscreen') ){ | if($bGetTIP.hasClass('sticky') || $bGetTIP.is(':offscreen') ){ |