-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
125 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* @flow */ | ||
'use strict'; | ||
|
||
export const VISIBILITY = { | ||
VISIBLE: 0, | ||
HIDDEN: 1, | ||
COLLAPSE: 2 | ||
}; | ||
|
||
export type Visibility = $Values<typeof VISIBILITY>; | ||
|
||
export const parseVisibility = (visibility: string): Visibility => { | ||
switch (visibility) { | ||
case 'hidden': | ||
return VISIBILITY.HIDDEN; | ||
case 'collapse': | ||
return VISIBILITY.COLLAPSE; | ||
case 'visible': | ||
default: | ||
return VISIBILITY.VISIBLE; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,30 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Visible elements tests</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<script type="text/javascript" src="../test.js"></script> | ||
<style> | ||
div{ | ||
border:2px solid black; | ||
} | ||
</style> | ||
<head> | ||
<title>Visible elements tests</title> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<script type="text/javascript" src="../test.js"></script> | ||
<style> | ||
div{ | ||
border:2px solid black; | ||
} | ||
.none { | ||
display:none | ||
} | ||
</style> | ||
|
||
</head> | ||
<body> | ||
<h1>Display:none and visible:hidden tests</h1> | ||
<div>This should be visible </div> | ||
<div style="display:none">display:none, This should be <b>hidden</b></div> | ||
<div style="visibility:hidden">visibility:hidden, This should be <b>hidden</b></div> | ||
<hr /> | ||
<div style="display:none">display:none, This should be <b>hidden</b></div> | ||
<div style="visibility:hidden">visibility:hidden, This should be <b>hidden</b></div> | ||
</head> | ||
<body> | ||
<div> | ||
<h1>Display:none and visible:hidden tests</h1> | ||
<div>This should be visible </div> | ||
<div class="none">display:none, This should be <b>hidden</b></div> | ||
<div style="visibility:hidden">visibility:hidden, This should be <b>hidden</b></div> | ||
<hr /> | ||
<div class="none">display:none, This should be <b>hidden</b></div> | ||
<div style="visibility:hidden">visibility:hidden, This should be <b>hidden</b></div> | ||
</div> | ||
|
||
</body> | ||
|
||
</body> | ||
</html> |