Guest User

Untitled

a guest
Mar 8th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1.  
  2. //this.ModBox is an element with id=this.options.id
  3. //after the first toggle() i can remove the element with the esc-key, but the document.removeEvent('keyup') doesn't kill the Event
  4. //a document.removeEvent('keyup') in the console helps...
  5.  
  6. ...
  7. toggle: function(){
  8.  
  9. ($('overlay')) ? $('overlay').remove():this.overlay.injectInside(document.body);
  10. if ($(this.options.id))
  11. {
  12. $(this.options.id).remove();
  13. document.removeEvent('keyup');
  14. alert('asdf');
  15. }
  16. else
  17. {
  18. this.ModBox.injectInside(document.body);
  19. document.addEvent('keyup', function(event) {
  20.  
  21. if (event.key == "esc")
  22. {
  23. this.fireEvent('onSuccess', false);
  24. this.toggle();
  25. }
  26. }.bind(this));
  27. }
  28.  
  29. }
  30. ...
Add Comment
Please, Sign In to add comment