dundalek / markmap

Visualize markdown documents as mindmaps
MIT License
1.7k stars 175 forks source link

Not working in firefox #5

Closed trond7 closed 7 years ago

trond7 commented 8 years ago

Latest version is not working on firefox. It is working fine in crome. No js errors in console Added a screendump that shows how it looks.

The demo at: http://kb.knomaton.org/multi-agent-systems/ Works fine in firefox.

Installed with npm on 2016-04-08

I am using Firefox SRD 38.7.0 on mac and the map is not displayed. The same problem on my ubuntu machine (cant remember firefox version)

screen shot 2016-04-08 at 12 49 34
guinetn commented 8 years ago

Hi trond7

Fix it by changing 2 lines in view.mindmap.js(129):

// 'SVGElement.offsetWidth' is deprecated in chrome > M50 // state.height = svg.node().offsetHeight; // state.width = svg.node().offsetWidth;
state.width = svg.node().getBoundingClientRect().width; state.height = svg.node().getBoundingClientRect().height;

dundalek commented 7 years ago

Fixed via https://github.com/dundalek/markmap/pull/7 published to npm as v0.3.2