diff --git a/plugins/tiddlywiki/dynaview/dynaview.js b/plugins/tiddlywiki/dynaview/dynaview.js index f724b9105..8e6226a98 100644 --- a/plugins/tiddlywiki/dynaview/dynaview.js +++ b/plugins/tiddlywiki/dynaview/dynaview.js @@ -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); + } } })();