Skip to content

Instantly share code, notes, and snippets.

@shanimal
Created August 17, 2016 05:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shanimal/d975416e6e85116bd2a90a43d2401d6a to your computer and use it in GitHub Desktop.
Save shanimal/d975416e6e85116bd2a90a43d2401d6a to your computer and use it in GitHub Desktop.
$('#myParentElement').one('click','a.myClass',function(){
/* this code will execute only once */
$('#myParentElement a.myClass').editable().click();
});
@itzmukeshy7
Copy link

We are also adding a class to element we are applying plugin and before applying plugin we are remove that class.

@itzmukeshy7
Copy link

itzmukeshy7 commented Aug 17, 2016

This is the code:

$('#myParentElement').one('click','a.myClass',function(){ /* this code will execute only once */ $('#myParentElement a.myClass.editable').removeClass('editable').editable(); });

@shanimal
Copy link
Author

You don't need to add the editable class, .one will only happen once anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment