|
|
@@ -138,12 +138,13 @@ function opennamu_do_footnote_popover(set_name, load_name) {
|
|
|
document.getElementById(set_name + '_load').style.display = "inline-block";
|
|
|
|
|
|
let width = document.getElementById(set_name + '_load').clientWidth;
|
|
|
- let screen_width = screen.availWidth;
|
|
|
+ let screen_width = window.innerWidth;
|
|
|
let left = document.getElementById(set_name).getBoundingClientRect().left;
|
|
|
+ let left_org = document.getElementById(set_name + '_load').getBoundingClientRect().left;
|
|
|
let top = document.getElementById(set_name).getBoundingClientRect().top;
|
|
|
- console.log(width, screen_width, left);
|
|
|
+ console.log(width, screen_width, left, left_org);
|
|
|
console.log(screen_width - (left + width));
|
|
|
- if(screen_width - (left + width) < 30) {
|
|
|
+ if(screen_width - (left + width) < 50) {
|
|
|
console.log("test");
|
|
|
if(left > 350) {
|
|
|
document.getElementById(set_name + '_load').style.left = String(left - 300) + "px";
|
|
|
@@ -151,7 +152,13 @@ function opennamu_do_footnote_popover(set_name, load_name) {
|
|
|
document.getElementById(set_name + '_load').style.left = "0px";
|
|
|
}
|
|
|
|
|
|
- document.getElementById(set_name + '_load').style.top = String(top + 20) + "px";
|
|
|
+ left = document.getElementById(set_name + '_load').getBoundingClientRect().left;
|
|
|
+ width = document.getElementById(set_name + '_load').clientWidth;
|
|
|
+ if(300 > width) {
|
|
|
+ document.getElementById(set_name + '_load').style.left = String(left + (300 - width)) + "px";
|
|
|
+ } else {
|
|
|
+ document.getElementById(set_name + '_load').style.marginTop = "20px";
|
|
|
+ }
|
|
|
}
|
|
|
} else {
|
|
|
document.getElementById(set_name + '_load').style.display = "none";
|