-
-
Save jmarnold/1572865 to your computer and use it in GitHub Desktop.
var correlationPolicy = { | |
matches: function (continuation) { | |
return continuation.correlationId != null && continuation.correlationId != ''; | |
}, | |
execute: function (continuation) { | |
if (continuation.errors && continuation.errors.length != 0) { | |
return; | |
} | |
var dialog = $('#' + continuation.correlationId).parents('.dialog'); | |
if (dialog.size() != 0) { | |
dialog.dialog('close'); | |
} | |
} | |
}; |
Automatically close a dialog if the continuation is successful, yes. We're doing a quick check in the correlatedSubmit to make sure the form has an ID, but we could also verify that it's a unique form, as well. Our fubu conventions ensure that they're unique.
look at you!
already ahead of me
https://github.com/DarthFubuMVC/jquery-continuations/blob/master/jquery.continuations.js#L160
We use the same form lookup to show the validation summary from fubuvalidation
yep,
if validation got smarter you could highlight the actual input element that failed rather than
a summary at the top
Guess what we already do?
should have know,
its good stuff it fits in really nicely with how blue works too
i'll have some feedback and contributions when finish supa picka
automatically close dialogs?
I see... this doesn't go through amplify
watch out for ajaxed in forms with the same id what will bite you