Last active
December 27, 2015 16:29
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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