You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
432 B
31 lines
432 B
14 years ago
|
/*
|
||
|
---
|
||
|
|
||
|
name: EventStack.OuterClick
|
||
|
|
||
|
description: Helps you escape from clicks outside of a certain area.
|
||
|
|
||
|
authors: Christoph Pojer (@cpojer)
|
||
|
|
||
|
license: MIT-style license.
|
||
|
|
||
|
requires: [EventStack]
|
||
|
|
||
|
provides: EventStack.OuterClick
|
||
|
|
||
|
...
|
||
|
*/
|
||
|
|
||
|
EventStack.OuterClick = new Class({
|
||
|
|
||
|
Extends: EventStack,
|
||
|
|
||
|
options: {
|
||
|
event: 'click',
|
||
|
condition: function(event, element){
|
||
|
return element && !element.contains(event.target);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
});
|