diff options
| author | Alon Levy <alon@pobox.com> | 2015-03-13 01:41:26 +0200 |
|---|---|---|
| committer | Alon Levy <alon@pobox.com> | 2015-03-13 01:41:26 +0200 |
| commit | dc4187c42fa1a85d2958a558940156ffcdf4f9a3 (patch) | |
| tree | f4b6a0e8114db480c68f0ed70537939a081e2517 /src | |
| parent | fd9db4ca9bde08e04cbf8da8ae8f85a0153702b6 (diff) | |
history: broken wheel recording, specifically when scrolling in node_info, silence for now
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/history.js | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/client/history.js b/src/client/history.js index 58334690..8bd571fb 100644 --- a/src/client/history.js +++ b/src/client/history.js @@ -64,9 +64,16 @@ function svg_extract_translate_and_scale(e) { // See: http://stackoverflow.com/questions/10349811/how-to-manipulate-translate-transforms-on-a-svg-element-with-javascript-in-chrom // Using the regexp option right now, did only firefox testing 36 - var str = e.attributes['transform'].value; - var parts = /translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(str); - var scale = /scale\(\s*([^\s)]+)\)/.exec(str); + var transform = e.attributes['transform']; + + if (undefined === transform) { + return; + } + + var str = transform.value, + parts = /translate\(\s*([^\s,)]+)[ ,]([^\s,)]+)/.exec(str), + scale = /scale\(\s*([^\s)]+)\)/.exec(str); + if (scale) { var x = parts[1], y = parts[2]; return {scale:+scale[1], translate: [+x, +y]}; @@ -84,7 +91,8 @@ History.prototype.record_zoom = function(d) var transform = svg_extract_translate_and_scale(this.transform_element); if (transform === undefined) { - console.log('record_zoom: bug: transform_element has no transform attribute'); + //console.log('record_zoom: bug: transform_element has no transform attribute'); + //FIXME: broken for now, don't spam console return; } this.record(ACTION_ZOOM, {transform: transform}); |
