Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //this.ModBox is an element with id=this.options.id
- //after the first toggle() i can remove the element with the esc-key, but the document.removeEvent('keyup') doesn't kill the Event
- //a document.removeEvent('keyup') in the console helps...
- ...
- toggle: function(){
- ($('overlay')) ? $('overlay').remove():this.overlay.injectInside(document.body);
- if ($(this.options.id))
- {
- $(this.options.id).remove();
- document.removeEvent('keyup');
- alert('asdf');
- }
- else
- {
- this.ModBox.injectInside(document.body);
- document.addEvent('keyup', function(event) {
- if (event.key == "esc")
- {
- this.fireEvent('onSuccess', false);
- this.toggle();
- }
- }.bind(this));
- }
- }
- ...
Add Comment
Please, Sign In to add comment