From 5dda34dcc707afa0cab1bca9ba33572c019e7fc9 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 14 Apr 2018 20:05:57 +0200 Subject: trying to fix viewport woes --- index.html | 1 + 1 file changed, 1 insertion(+) (limited to 'index.html') diff --git a/index.html b/index.html index c822bb2..59bb2f1 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,7 @@ asciiblaster + -- cgit v1.2.3-70-g09d2 From 2816501f853c09fda63c239ed37f3fc614ff3c7a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 15 Apr 2018 12:15:47 +0200 Subject: fix scale --- index.html | 1 - js/ui/keys.js | 50 +++++++++++++++++++++++++------------------------- 2 files changed, 25 insertions(+), 26 deletions(-) (limited to 'index.html') diff --git a/index.html b/index.html index 59bb2f1..c822bb2 100644 --- a/index.html +++ b/index.html @@ -3,7 +3,6 @@ asciiblaster - diff --git a/js/ui/keys.js b/js/ui/keys.js index c157671..3cd6168 100644 --- a/js/ui/keys.js +++ b/js/ui/keys.js @@ -204,32 +204,32 @@ var keys = (function(){ } } - function cancelZoom() { - var d = document, - viewport, - content, - maxScale = ',maximum-scale=', - maxScaleRegex = /,*maximum\-scale\=\d*\.*\d*/; - - // this should be a focusable DOM Element - if (!this.addEventListener || !d.querySelector) { - return; - } - - viewport = d.querySelector('meta[name="viewport"]'); - content = viewport.content; - - function changeViewport(event) { - // http://nerd.vasilis.nl/prevent-ios-from-zooming-onfocus/ - viewport.content = content + (event.type == 'blur' ? (content.match(maxScaleRegex, '') ? '' : maxScale + 10) : maxScale + 1); - } - - // We could use DOMFocusIn here, but it's deprecated. - this.addEventListener('focus', changeViewport, true); - this.addEventListener('blur', changeViewport, false); - } + // function cancelZoom() { + // var d = document, + // viewport, + // content, + // maxScale = ',maximum-scale=', + // maxScaleRegex = /,*maximum\-scale\=\d*\.*\d*/; + + // // this should be a focusable DOM Element + // if (!this.addEventListener || !d.querySelector) { + // return; + // } + + // viewport = d.querySelector('meta[name="viewport"]'); + // content = viewport.content; + + // function changeViewport(event) { + // // http://nerd.vasilis.nl/prevent-ios-from-zooming-onfocus/ + // viewport.content = content + (event.type == 'blur' ? (content.match(maxScaleRegex, '') ? '' : maxScale + 10) : maxScale + 1); + // } + + // // We could use DOMFocusIn here, but it's deprecated. + // this.addEventListener('focus', changeViewport, true); + // this.addEventListener('blur', changeViewport, false); + // } - cancelZoom.bind(cursor_input)(); + // cancelZoom.bind(cursor_input)(); return keys })() -- cgit v1.2.3-70-g09d2 From f1a446b5eb783bafc16ad5c6167b3876e7860dc6 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sun, 15 Apr 2018 12:34:51 +0200 Subject: cursor input --- index.html | 1 + js/app.js | 3 +++ 2 files changed, 4 insertions(+) (limited to 'index.html') diff --git a/index.html b/index.html index c822bb2..8f42f4f 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,7 @@ asciiblaster + diff --git a/js/app.js b/js/app.js index 729f0d0..6afbbcc 100644 --- a/js/app.js +++ b/js/app.js @@ -69,6 +69,9 @@ function bind () { } }) window.addEventListener("touchend", function(){ + if (current_tool.name === "text") { + if (is_desktop) cursor_input.focus() + } dragging = false }) -- cgit v1.2.3-70-g09d2