Skip to content

Instantly share code, notes, and snippets.

@op1ekun
Last active December 27, 2015 16:29
Show Gist options
  • Save op1ekun/7354889 to your computer and use it in GitHub Desktop.
Save op1ekun/7354889 to your computer and use it in GitHub Desktop.
How to capture "aui-editable" widget's "stopEditing" only once? The problem was that the "stopEditing" fired every time used clicked outside of the widget (which is not good if you want to send an AJAX request on blur event). Alloy UI v1.0.1
// editable is an aui-widget instance
editable.after('startEditing', function(ev1){
// some code here
// subscribe here, event will fire multiple times,
// but captured only once,
// it will be reattached next time the widget is editted
editable.once('stopEditing', function(ev2) {
// sent AJAX here!
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment