jyoungblood / smoke.js

framework-agnostic styled alert system for javascript
http://smoke.js.org/
930 stars 107 forks source link

Confirm doesn't have to get a callback. #10

Closed LeonFedotov closed 13 years ago

LeonFedotov commented 13 years ago

Oh wait, I'm not sure... How can we implement that bhaivior: if(confirm('question')) {

}

like that:

smoke.confirm('question', function (b) { return b?(function () {

}()):false;);

?

LeonFedotov commented 13 years ago

ok ok got the idea, and added some improvements, tell me what you think ^_^

jyoungblood commented 13 years ago

dude these are some sweet improvements. i'll merge when i get the chance to update the documentation. thanks a lot!

LeonFedotov commented 13 years ago

^_^ glad you like, i use smoke on an internal project thank you :)

jyoungblood commented 13 years ago

added (with some modifications) to the project. thanks again, man.

LeonFedotov commented 13 years ago

Ive just read trough cool changes, i noticed you didn't add the scoping, i would add them even as an option - i would want to avoid doing stuff like so: var that = this; smoke.confirm('sure?' , function () { (function() { /do something/ }).call(that); }); but its up to you so im happy...

savedev commented 11 years ago

Hello. Thanks for your smoke.js.

Sorry but i don't understand how i can return true or false froma smoke.confirm.

For example, i need to do this inside a Javascript function

smoke.confirm('confirm delete ?',function(e){ if (e){ return true; }else{ return false; } });

But it doesn't work

could help me ?

thanks in advance