daily pastebin goal
4%
SHARE
TWEET

Untitled

a guest Mar 8th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     ...
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top