Closed webmat closed 11 years ago
Yes, this is a very non-trivial undertaking (as everyone who has tried has discovered). The problem is that to get non-blocking confirm dialogs, it always breaks the blocking native version and vice versa. See #196 for related discussion, and my current working async branch, which provides this feature.
If enough people use that branch, I may consider merging it with master. It relies on some undocumented functionality in js/jquery, which is why I haven't pulled it in yet.
Excellent, thanks for your answer. I'll try this branch and report anything I find!
Hey guys,
I'm using $ UJS in a Cordova app (initially PhoneGap), and everything works ok.
However, since $ UJS uses
confirm
, I don't have much control on the title of the popups: exampleCordova offers a notification API with better customizability, but the call is non-blocking, as opposed to
confirm
.So I'm currently working out a sensible way to use Cordova's non-blocking notifications by patching jQuery UJS. As I see it so far, all calls to $.rails.allowAction will probably have to be rewritten to pass callbacks for "Ok" and "Cancel", instead of doing it with an if (example).
Do you guys think that would be an interesting addition to jQuery UJS, or do you think this is out of scope for this project?
I'll come back and give more information on whatever solution I came up with.
Cheers,
Mat