|
|
@ -34,11 +34,11 @@ |
|
|
|
|
|
|
|
|
|
|
|
if (bounds.height * bounds.scale < html.clientHeight) { |
|
|
|
if (bounds.height * bounds.scale < html.clientHeight) { |
|
|
|
transformY = (html.clientHeight - bounds.height * bounds.scale) / 2; |
|
|
|
transformY = (html.clientHeight - bounds.height * bounds.scale) / 2; |
|
|
|
document.body.style.top = transformY + "px"; |
|
|
|
|
|
|
|
html.style.overflowY = "hidden"; |
|
|
|
html.style.overflowY = "hidden"; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
transformY = 0; |
|
|
|
transformY = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
document.body.style.top = transformY + "px"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.scale = window.devicePixelRatio * scale; |
|
|
|
window.scale = window.devicePixelRatio * scale; |
|
|
@ -183,11 +183,11 @@ |
|
|
|
removeListener(selectHandler); |
|
|
|
removeListener(selectHandler); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function selectHandler () { |
|
|
|
var selectHandler = BI.debounce(function () { |
|
|
|
selected && prepareEnv(); |
|
|
|
selected && prepareEnv(); |
|
|
|
selected ? transformScale() : removeScale(); |
|
|
|
selected ? transformScale() : removeScale(); |
|
|
|
!selected && restoreEnv(); |
|
|
|
!selected && restoreEnv(); |
|
|
|
} |
|
|
|
}, 30); |
|
|
|
|
|
|
|
|
|
|
|
function updateScale () { |
|
|
|
function updateScale () { |
|
|
|
if (html.getBoundingClientRect().width !== document.body.getBoundingClientRect().width) { |
|
|
|
if (html.getBoundingClientRect().width !== document.body.getBoundingClientRect().width) { |
|
|
|