Guest User

Untitled

a guest
Jul 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. $('.edit').editable('ajax/save.php?editnotetext', {
  2. type : 'mce',
  3. submit : '<button class="save_button">Save</button>',
  4. cancel : '<button class="cancel_button">Cancel</button>',
  5. event: 'dblclick',
  6. placeholder : 'Doubleclick to edit...',
  7. indicator : 'Saving...',
  8. tooltip : 'Doubleclick to edit...',
  9. onblur: 'custom',
  10. callback : function(){
  11. console.log('unlocked');
  12. $.post('ajax/save.php?unlocknotetext', {"id" : $(this).attr('id')});
  13. },
  14. onreset : function(){
  15. console.log('unlocked');
  16. //myId = $(this).attr('id');
  17. //alert(myId); this shows up as undefined!
  18. //alert("onreset works!");
  19. $.post('ajax/save.php?unlocknotetext', {"id" : $(this).attr('id')});
  20. }
  21.  
  22. });
  23.  
  24. $('.edit').each(function() {
  25. var $this = $(this);
  26. $this.editable(... /* use $this instead of $(this) here*/)
  27. });
  28.  
  29. curr_form = this[0]; //form object
  30. par = curr_form.parentNode; //parent,container object
  31. alert(par.id);
Add Comment
Please, Sign In to add comment