mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Define DomElement.isInvisible(), to check if the given element is not displaying.
This commit is contained in:
parent
570fa4fbeb
commit
eec7209a5c
1 changed files with 10 additions and 1 deletions
|
@ -57,7 +57,16 @@ var DomElement = new function() {
|
|||
);
|
||||
},
|
||||
|
||||
// Checks if element is visibile in current viewport
|
||||
/**
|
||||
* Checks if element is invisibile (display: none, ...)
|
||||
*/
|
||||
isInvisible: function(el) {
|
||||
return DomElement.getSize(el).equals([0, 0]);
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks if element is visibile in current viewport
|
||||
*/
|
||||
isVisible: function(el) {
|
||||
// See if the scrolled bounds intersect with the windows rectangle
|
||||
// which always starts at 0, 0
|
||||
|
|
Loading…
Reference in a new issue