Skip to content

Instantly share code, notes, and snippets.

@akoppela
Created April 22, 2011 04:21
Show Gist options
  • Save akoppela/936011 to your computer and use it in GitHub Desktop.
Save akoppela/936011 to your computer and use it in GitHub Desktop.
IGC.Widget.Body.Dialog = new Class({
Includes: [
LSD.Native.Body,
LSD.Trait.Fieldset
],
options: {
classes: Array.fast('dialog'),
pseudos: Array.fast('submittable'),
states: Array.fast('hidden'),
nodeType: 1,
element: {
tag: 'section'
},
transformation: {
name: 'pop'
},
events: {
_dialog: {
element: {
'click:relay(.cancel)': 'cancel'
},
self: {
hide: function() {
if (LSD.application) LSD.application.back();
}
}
}
},
has: {
one: {
'form': {
selector: 'form',
chain: {
'submission': function() {
return {name: 'send', target: this.document}
}
}
}
}
}
},
cancel: function() {
this.hide();
this.fireEvent('cancel', arguments);
},
submit: function() {
this.hide();
this.fireEvent('submit', arguments);
},
getData: function() {
return (this.form ? this.form.getData : this.parent).apply(this.form || this, arguments);
},
hidden: true
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment