add a setting the top and bottom left position

This commit is contained in:
sienori 2017-12-23 00:00:24 +09:00
parent ca4a2c1beb
commit 07dfc32d14

View file

@ -51,14 +51,27 @@ function checkLang() {
//ボタンを表示 //ボタンを表示
function popupButton(e) { function popupButton(e) {
let position; let topPosition = 10;
let leftPosition = 10;
let buttonSize = S.get().buttonSize; let buttonSize = S.get().buttonSize;
if (S.get().buttonPosition == "rightUp") position = (-1 * buttonSize) - 10; switch (S.get().buttonPosition) {
else if (S.get().buttonPosition == "rightDown") position = 10; case "rightUp":
topPosition = (-1 * buttonSize) - 10;
break;
case "rightDown":
break;
case "leftUp":
topPosition = (-1 * buttonSize) - 10;
leftPosition = (-1 * buttonSize) - 10;
break;
case "leftDown":
leftPosition = (-1 * buttonSize) - 10;
break;
}
button.style.left = e.clientX + 10 + 'px'; button.style.left = e.clientX + leftPosition + 'px';
button.style.top = e.clientY + position + 'px'; button.style.top = e.clientY + topPosition + 'px';
button.style.width = S.get().buttonSize + "px"; button.style.width = S.get().buttonSize + "px";
button.style.height = S.get().buttonSize + "px"; button.style.height = S.get().buttonSize + "px";
button.style.display = 'block'; button.style.display = 'block';