bitovi / documentcss

A documentation/guide portal for the Live Style Guide feature of DocumentJS
https://documentcss.com/
MIT License
72 stars 7 forks source link

Changing Demo Tabs doesn't work #64

Open gloomicious opened 5 years ago

gloomicious commented 5 years ago

I am having an issue with displaying the styleguide properly. When trying to change the Demo Tab from e.g. HTML to JS, I keep getting an error.

Uncaught TypeError: e.data is not a function
    at d..tab click (static.js:3)
    at HTMLLIElement.eval (static.js:3)
    at HTMLDivElement.d (static.js:3)

I tried to set up several new projects with different approaches, but the error still keeps appearing. To me it seems like it's a problem with the generated static.js file I'm not supposed to change manually. Has anyone experienced this error before? Would appreciate any help!

gloomicious commented 5 years ago

I found a fix, changing the function in the generated static.js file resolved the error. All I need was to convert e to jQuery Object.

".tab click": function(e, t) { this.showTab(e.data("tab")) } to ".tab click": function(e, t) { this.showTab($(e).data("tab")) }

However, this isn't a final fix since the changes in static.js are lost when the styleguide is regenerated. Therefore I have to edit the generated file after every time the styleguide is generated manually - which definetely is annoying and obviously not intended to. Would be great to have a permanent fix to this.