Skip to content

Instantly share code, notes, and snippets.

@Sigmus
Created January 16, 2013 15:36
Show Gist options
  • Save Sigmus/4548026 to your computer and use it in GitHub Desktop.
Save Sigmus/4548026 to your computer and use it in GitHub Desktop.
define(['modal/standard', 'belongs'], function(Modal, Belongs) {
return function(params) {
params.onCreate = params.onCreate || function(json, child) {
if (json.status !== 1) {
alert('Ocorreu um erro!');
return;
}
$.get(params[child.name].url + child.id, function(response) {
params[child.name].$el.append(response);
});
};
Belongs(params)
.listen(
Modal(params)
.hijack()
);
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment