loadingio / loading-bar

Flexible, light weighted and super fast Progress Bar Library
MIT License
407 stars 75 forks source link

Progress bar appears twice #6

Open ceremcem opened 7 years ago

ceremcem commented 7 years ago

Livescript code for initialization ldBar:

bar = new ldBar '#myselector', do
    "stroke": '#f00'

HTML part (in pug):

div(id="myselector")

Result:

image

ceremcem commented 7 years ago

These lines resolves the issue, but also breaks "no Javascript initialization" "feature".

dennisaskeland commented 7 years ago

I'm having this issue as well. Any plans to release a patch to fix this?

ceremcem commented 7 years ago

Yes, of course. I'll probably cover this one in this PR but it's a decision up to @zbryikt to drop "no javascript initialization" feature.

Anyway, did you try disabling that feature, which resolves the problem for now?

ceremcem commented 7 years ago

You may also want to try out this precompiled one and see if it resolves your case or not.

dennisaskeland commented 7 years ago

@ceremcem that precompiled one worked like a charm, thanks!

ceremcem commented 7 years ago

You're welcome :+1:

zbryikt commented 7 years ago

hi guys, sorry for taking so long to reply here.

Initialization by JS will add a 'ldBar' class to target element, while no JS init runs after document is ready, so if we run JS initialization before document is ready then there will be another bar generated by no JS init code.

but no Javascript initialization is probably still needed, so I added a check to see if there is already an ldBar instance created. related commit here: 6c83d77f3