mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-26 17:06:51 +00:00
Dynaview: Update viewport state refreshing (#3128)
To prevent repeated updates
This commit is contained in:
parent
042e9185a9
commit
4435afc726
@ -100,8 +100,12 @@ function checkVisibility() {
|
||||
function saveViewportDimensions() {
|
||||
var viewportWidth = window.innerWidth || document.documentElement.clientWidth,
|
||||
viewportHeight = window.innerHeight || document.documentElement.clientHeight;
|
||||
$tw.wiki.setText("$:/state/viewport/width",undefined,undefined,viewportWidth.toString(),undefined);
|
||||
$tw.wiki.setText("$:/state/viewport/height",undefined,undefined,viewportHeight.toString(),undefined);
|
||||
if($tw.wiki.getTiddlerText("$:/state/viewport/width") !== viewportWidth.toString()) {
|
||||
$tw.wiki.setText("$:/state/viewport/width",undefined,undefined,viewportWidth.toString(),undefined);
|
||||
}
|
||||
if($tw.wiki.getTiddlerText("$:/state/viewport/height") !== viewportHeight.toString()) {
|
||||
$tw.wiki.setText("$:/state/viewport/height",undefined,undefined,viewportHeight.toString(),undefined);
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
|
Loading…
Reference in New Issue
Block a user