saribe / eModal

Easy Modal for bootstrap, is a simple way to create modal dialogs using javascript.
http://saribe.github.io/eModal
271 stars 97 forks source link

callback doesn't fire first time #3

Closed phil-dileo closed 9 years ago

phil-dileo commented 9 years ago

Hey (great project by the way)

I'm seeing an issue where the callback only fires when I call the function the second(+) time.

Here's my code: https://gist.github.com/fa839f059b263b9e7be9.git

Any ideas? I noticed that when I run it the first time, my url goes from: /static-nodes to /static-nodes?# - What's the question mark doing?

Thanks!

saribe commented 9 years ago

Hi Phil,

I can't access the url: Failed to load resource: the server responded with a status of 404 (Not Found)

By your description i can assume that you are using a <a href="#" .../> tag and the click bind is not working as it should be...

Can you post here your issue or in http://codepen.io/ alike?

That will be great Thanks

phil-dileo commented 9 years ago

Sorry about that.

http://codepen.io/anon/pen/bNJKPL.js

It just shows the interesting parts (the menuitem creation with has the onClick to the clone function). The clone() function includes the eModal.prompt().

saribe commented 9 years ago

Hi Phil, the code is ok.

I have completed your codepen: http://codepen.io/anon/pen/EaJpMN?editors=101

It's working, please take a look.

phil-dileo commented 9 years ago

Thanks!