Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
dbaffd43
Commit
dbaffd43
authored
9 years ago
by
fat
Browse files
Options
Download
Plain Diff
Merge pull request
#116
from twbs/fat-es6Alert
es6 - wip
parents
06b1d498
6b2b0ed3
Changes
93
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
js/tests/visual/carousel.html
+5
-5
js/tests/visual/carousel.html
js/tests/visual/collapse.html
+2
-2
js/tests/visual/collapse.html
js/tests/visual/dropdown.html
+21
-27
js/tests/visual/dropdown.html
js/tests/visual/modal.html
+12
-9
js/tests/visual/modal.html
js/tests/visual/popover.html
+6
-4
js/tests/visual/popover.html
js/tests/visual/scrollspy.html
+9
-18
js/tests/visual/scrollspy.html
js/tests/visual/tab.html
+19
-19
js/tests/visual/tab.html
js/tests/visual/tooltip.html
+5
-4
js/tests/visual/tooltip.html
js/tooltip.js
+0
-514
js/tooltip.js
js/transition.js
+0
-59
js/transition.js
package.json
+8
-1
package.json
scss/_popover.scss
+86
-64
scss/_popover.scss
scss/_tooltip.scss
+53
-45
scss/_tooltip.scss
with
226 additions
and
771 deletions
+226
-771
js/tests/visual/carousel.html
+
5
-
5
View file @
dbaffd43
...
@@ -29,13 +29,13 @@
...
@@ -29,13 +29,13 @@
<li
data-target=
"#carousel-example-generic"
data-slide-to=
"2"
class=
""
></li>
<li
data-target=
"#carousel-example-generic"
data-slide-to=
"2"
class=
""
></li>
</ol>
</ol>
<div
class=
"carousel-inner"
>
<div
class=
"carousel-inner"
>
<div
class=
"item active"
>
<div
class=
"
carousel-
item active"
>
<img
alt=
"First slide"
src=
"http://37.media.tumblr.com/tumblr_m8tay0JcfG1qa42jro1_1280.jpg"
>
<img
alt=
"First slide"
src=
"http://37.media.tumblr.com/tumblr_m8tay0JcfG1qa42jro1_1280.jpg"
>
</div>
</div>
<div
class=
"item"
>
<div
class=
"
carousel-
item"
>
<img
alt=
"Second slide"
src=
"http://37.media.tumblr.com/tumblr_m8tazfiVYJ1qa42jro1_1280.jpg"
>
<img
alt=
"Second slide"
src=
"http://37.media.tumblr.com/tumblr_m8tazfiVYJ1qa42jro1_1280.jpg"
>
</div>
</div>
<div
class=
"item"
>
<div
class=
"
carousel-
item"
>
<img
alt=
"Third slide"
src=
"http://38.media.tumblr.com/tumblr_m8tb2rVsD31qa42jro1_1280.jpg"
>
<img
alt=
"Third slide"
src=
"http://38.media.tumblr.com/tumblr_m8tb2rVsD31qa42jro1_1280.jpg"
>
</div>
</div>
</div>
</div>
...
@@ -51,8 +51,8 @@
...
@@ -51,8 +51,8 @@
<!-- JavaScript Includes -->
<!-- JavaScript Includes -->
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../../
transition
.js"
></script>
<script
src=
"../../
dist/util
.js"
></script>
<script
src=
"../../carousel.js"
></script>
<script
src=
"../../
dist/
carousel.js"
></script>
</body>
</body>
</html>
</html>
This diff is collapsed.
Click to expand it.
js/tests/visual/collapse.html
+
2
-
2
View file @
dbaffd43
...
@@ -71,8 +71,8 @@
...
@@ -71,8 +71,8 @@
<!-- JavaScript Includes -->
<!-- JavaScript Includes -->
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../../
transition
.js"
></script>
<script
src=
"../../
dist/util
.js"
></script>
<script
src=
"../../collapse.js"
></script>
<script
src=
"../../
dist/
collapse.js"
></script>
</body>
</body>
</html>
</html>
This diff is collapsed.
Click to expand it.
js/tests/visual/dropdown.html
+
21
-
27
View file @
dbaffd43
...
@@ -22,21 +22,15 @@
...
@@ -22,21 +22,15 @@
<h1>
Dropdown
<small>
Bootstrap Visual Test
</small></h1>
<h1>
Dropdown
<small>
Bootstrap Visual Test
</small></h1>
</div>
</div>
<nav
id=
"navbar-example"
class=
"navbar navbar-default navbar-static"
role=
"navigation"
>
<nav
id=
"navbar-example"
class=
"navbar navbar-default navbar-static
-top
"
role=
"navigation"
>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<div
class=
"navbar-header"
>
<button
class=
"navbar-toggler hidden-sm-up"
type=
"button"
data-toggle=
"collapse"
data-target=
"#exCollapsingNavbar2"
>
<button
class=
"navbar-toggle collapsed"
type=
"button"
data-toggle=
"collapse"
data-target=
".bs-example-js-navbar-collapse"
>
☰
<span
class=
"sr-only"
>
Toggle navigation
</span>
</button>
<span
class=
"icon-bar"
></span>
<div
class=
"collapse navbar-toggleable-xs"
id=
"exCollapsingNavbar2"
>
<span
class=
"icon-bar"
></span>
<ul
class=
"nav navbar-nav pull-left"
>
<span
class=
"icon-bar"
></span>
<li
class=
"dropdown nav-item"
>
</button>
<a
id=
"drop1"
href=
"#"
role=
"button"
class=
"dropdown-toggle nav-link"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<a
class=
"navbar-brand"
href=
"#"
>
Project Name
</a>
</div>
<div
class=
"collapse navbar-collapse bs-example-js-navbar-collapse"
>
<ul
class=
"nav navbar-nav"
>
<li
class=
"dropdown"
>
<a
id=
"drop1"
href=
"#"
role=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop1"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop1"
>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Another action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Another action
</a></li>
...
@@ -45,8 +39,8 @@
...
@@ -45,8 +39,8 @@
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Separated link
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Separated link
</a></li>
</ul>
</ul>
</li>
</li>
<li
class=
"dropdown"
>
<li
class=
"dropdown
nav-item
"
>
<a
href=
"#"
id=
"drop2"
role=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown 2
<b
class=
"caret"
></b></a>
<a
href=
"#"
id=
"drop2"
role=
"button"
class=
"dropdown-toggle
nav-link
"
data-toggle=
"dropdown"
>
Dropdown 2
<b
class=
"caret"
></b></a>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop2"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop2"
>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Another action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Another action
</a></li>
...
@@ -56,9 +50,9 @@
...
@@ -56,9 +50,9 @@
</ul>
</ul>
</li>
</li>
</ul>
</ul>
<ul
class=
"nav navbar-nav
navbar
-right"
>
<ul
class=
"nav navbar-nav
pull
-right"
>
<li
id=
"fat-menu"
class=
"dropdown"
>
<li
id=
"fat-menu"
class=
"dropdown
nav-item
"
>
<a
href=
"#"
id=
"drop3"
role=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown 3
<b
class=
"caret"
></b></a>
<a
href=
"#"
id=
"drop3"
role=
"button"
class=
"dropdown-toggle
nav-link
"
data-toggle=
"dropdown"
>
Dropdown 3
<b
class=
"caret"
></b></a>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop3"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop3"
>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Another action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Another action
</a></li>
...
@@ -73,9 +67,9 @@
...
@@ -73,9 +67,9 @@
</nav>
</nav>
<ul
class=
"nav nav-pills"
>
<ul
class=
"nav nav-pills"
>
<li
class=
"active"
><a
href=
"#"
>
Regular link
</a></li>
<li
class=
"active
nav-item
"
><a
href=
"#"
class=
"nav-link"
>
Regular link
</a></li>
<li
class=
"dropdown"
>
<li
class=
"dropdown
nav-item
"
>
<a
id=
"drop4"
role=
"button"
data-toggle=
"dropdown"
href=
"#"
>
Dropdown
<b
class=
"caret"
></b></a>
<a
id=
"drop4"
class=
"nav-link"
role=
"button"
data-toggle=
"dropdown"
href=
"#"
>
Dropdown
<b
class=
"caret"
></b></a>
<ul
id=
"menu1"
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop4"
>
<ul
id=
"menu1"
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop4"
>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Another action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Another action
</a></li>
...
@@ -84,8 +78,8 @@
...
@@ -84,8 +78,8 @@
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Separated link
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Separated link
</a></li>
</ul>
</ul>
</li>
</li>
<li
class=
"dropdown"
>
<li
class=
"dropdown
nav-item
"
>
<a
id=
"drop5"
role=
"button"
data-toggle=
"dropdown"
href=
"#"
>
Dropdown 2
<b
class=
"caret"
></b></a>
<a
id=
"drop5"
class=
"nav-link"
role=
"button"
data-toggle=
"dropdown"
href=
"#"
>
Dropdown 2
<b
class=
"caret"
></b></a>
<ul
id=
"menu2"
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop5"
>
<ul
id=
"menu2"
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"drop5"
>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Another action
</a></li>
<li
role=
"presentation"
><a
role=
"menuitem"
tabindex=
"-1"
href=
"https://twitter.com/fat"
>
Another action
</a></li>
...
@@ -100,9 +94,9 @@
...
@@ -100,9 +94,9 @@
<!-- JavaScript Includes -->
<!-- JavaScript Includes -->
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../../
transition
.js"
></script>
<script
src=
"../../
dist/util
.js"
></script>
<script
src=
"../../dropdown.js"
></script>
<script
src=
"../../
dist/
dropdown.js"
></script>
<script
src=
"../../collapse.js"
></script>
<script
src=
"../../
dist/
collapse.js"
></script>
</body>
</body>
</html>
</html>
This diff is collapsed.
Click to expand it.
js/tests/visual/modal.html
+
12
-
9
View file @
dbaffd43
...
@@ -141,20 +141,23 @@
...
@@ -141,20 +141,23 @@
<!-- JavaScript Includes -->
<!-- JavaScript Includes -->
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../../transition.js"
></script>
<script
src=
"../../modal.js"
></script>
<script
src=
"../../dist/util.js"
></script>
<script
src=
"../../dist/modal.js"
></script>
<script
src=
"../../dist/collapse.js"
></script>
<!-- <script src="../../transition.js"></script>
<script src="../../tooltip.js"></script>
<script src="../../tooltip.js"></script>
<script
src=
"../../popover.js"
></script>
<script src="../../popover.js"></script> -->
<script
src=
"../../collapse.js"
></script>
<!-- JavaScript Test -->
<!-- JavaScript Test -->
<script>
<script>
$
(
function
()
{
$
(
function
()
{
$
(
'
.js-popover
'
).
popover
()
//
$('.js-popover').popover()
$
(
'
.js-tooltip
'
).
tooltip
()
//
$('.js-tooltip').tooltip()
$
(
'
#tall-toggle
'
).
click
(
function
()
{
//
$('#tall-toggle').click(function () {
$
(
'
#tall
'
).
toggle
()
//
$('#tall').toggle()
})
//
})
})
})
</script>
</script>
...
...
This diff is collapsed.
Click to expand it.
js/tests/visual/popover.html
+
6
-
4
View file @
dbaffd43
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Popover
</title>
<title>
Popover
</title>
<link
rel=
"stylesheet"
href=
"../../../dist/css/bootstrap.
min.
css"
>
<link
rel=
"stylesheet"
href=
"../../../dist/css/bootstrap.css"
>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
...
@@ -39,9 +39,11 @@
...
@@ -39,9 +39,11 @@
<!-- JavaScript Includes -->
<!-- JavaScript Includes -->
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../../transition.js"
></script>
<script
src=
"../vendor/tether.min.js"
></script>
<script
src=
"../../tooltip.js"
></script>
<script
src=
"../../dist/util.js"
></script>
<script
src=
"../../popover.js"
></script>
<script
src=
"../../dist/tooltip.js"
></script>
<script
src=
"../../dist/popover.js"
></script>
<!-- JavaScript Test -->
<!-- JavaScript Test -->
<script>
<script>
...
...
This diff is collapsed.
Click to expand it.
js/tests/visual/scrollspy.html
+
9
-
18
View file @
dbaffd43
...
@@ -24,21 +24,12 @@
...
@@ -24,21 +24,12 @@
<nav
class=
"navbar navbar-default navbar-fixed-top"
role=
"navigation"
>
<nav
class=
"navbar navbar-default navbar-fixed-top"
role=
"navigation"
>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<div
class=
"navbar-header"
>
<div
class=
"js-navbar-scrollspy"
>
<button
class=
"navbar-toggle collapsed"
type=
"button"
data-toggle=
"collapse"
data-target=
".js-navbar-scrollspy"
>
<span
class=
"sr-only"
>
Toggle navigation
</span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
<span
class=
"icon-bar"
></span>
</button>
<a
class=
"navbar-brand"
href=
"#"
>
Project Name
</a>
</div>
<div
class=
"collapse navbar-collapse js-navbar-scrollspy"
>
<ul
class=
"nav navbar-nav"
>
<ul
class=
"nav navbar-nav"
>
<li
class=
"
"
><a
href=
"#fat"
>
@fat
</a></li>
<li
class=
"
nav-item active"
><a
class=
"nav-link"
href=
"#fat"
>
@fat
</a></li>
<li
class=
"
"
><a
href=
"#mdo"
>
@mdo
</a></li>
<li
class=
"
nav-item"
><a
class=
"nav-link"
href=
"#mdo"
>
@mdo
</a></li>
<li
class=
"dropdown"
>
<li
class=
"dropdown
nav-item
"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<a
href=
"#"
class=
"dropdown-toggle
nav-link
"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<ul
class=
"dropdown-menu"
role=
"menu"
>
<ul
class=
"dropdown-menu"
role=
"menu"
>
<li
class=
""
><a
href=
"#one"
tabindex=
"-1"
>
one
</a></li>
<li
class=
""
><a
href=
"#one"
tabindex=
"-1"
>
one
</a></li>
<li><a
href=
"#two"
tabindex=
"-1"
>
two
</a></li>
<li><a
href=
"#two"
tabindex=
"-1"
>
two
</a></li>
...
@@ -100,10 +91,10 @@
...
@@ -100,10 +91,10 @@
<!-- JavaScript Includes -->
<!-- JavaScript Includes -->
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../../
transition
.js"
></script>
<script
src=
"../../
dist/util
.js"
></script>
<script
src=
"../../scrollspy.js"
></script>
<script
src=
"../../
dist/
scrollspy.js"
></script>
<script
src=
"../../dropdown.js"
></script>
<script
src=
"../../
dist/
dropdown.js"
></script>
<script
src=
"../../collapse.js"
></script>
<script
src=
"../../
dist/
collapse.js"
></script>
</body>
</body>
</html>
</html>
This diff is collapsed.
Click to expand it.
js/tests/visual/tab.html
+
19
-
19
View file @
dbaffd43
...
@@ -35,10 +35,10 @@
...
@@ -35,10 +35,10 @@
<h4>
Tabs without fade
</h4>
<h4>
Tabs without fade
</h4>
<ul
id=
"myTab"
class=
"nav nav-tabs"
>
<ul
id=
"myTab"
class=
"nav nav-tabs"
>
<li
class=
"active"
><a
href=
"#home"
data-toggle=
"tab"
>
Home
</a></li>
<li
class=
"active
nav-item
"
><a
href=
"#home"
class=
"nav-link"
data-toggle=
"tab"
>
Home
</a></li>
<li><a
href=
"#profile"
data-toggle=
"tab"
>
Profile
</a></li>
<li
class=
"nav-item"
><a
href=
"#profile"
data-toggle=
"tab"
class=
"nav-link"
>
Profile
</a></li>
<li
class=
"dropdown"
>
<li
class=
"dropdown
nav-item
"
>
<a
href=
"#"
id=
"myTabDrop1"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<a
href=
"#"
id=
"myTabDrop1"
class=
"dropdown-toggle
nav-link
"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"myTabDrop1"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"myTabDrop1"
>
<li><a
href=
"#dropdown1"
tabindex=
"-1"
data-toggle=
"tab"
>
@fat
</a></li>
<li><a
href=
"#dropdown1"
tabindex=
"-1"
data-toggle=
"tab"
>
@fat
</a></li>
<li><a
href=
"#dropdown2"
tabindex=
"-1"
data-toggle=
"tab"
>
@mdo
</a></li>
<li><a
href=
"#dropdown2"
tabindex=
"-1"
data-toggle=
"tab"
>
@mdo
</a></li>
...
@@ -67,10 +67,10 @@
...
@@ -67,10 +67,10 @@
<h4>
Tabs with fade
</h4>
<h4>
Tabs with fade
</h4>
<ul
id=
"myTab1"
class=
"nav nav-tabs"
>
<ul
id=
"myTab1"
class=
"nav nav-tabs"
>
<li
class=
"active
"
><a
href=
"#home1"
data-toggle=
"tab"
>
Home
</a></li>
<li
class=
"active
nav-item"
><a
class=
"nav-link"
href=
"#home1"
data-toggle=
"tab"
>
Home
</a></li>
<li
><a
href=
"#profile1"
data-toggle=
"tab"
>
Profile
</a></li>
<li
class=
"nav-item"
><a
class=
"nav-link"
href=
"#profile1"
data-toggle=
"tab"
>
Profile
</a></li>
<li
class=
"dropdown"
>
<li
class=
"dropdown
nav-item
"
>
<a
href=
"#"
id=
"myTabDrop2"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<a
href=
"#"
id=
"myTabDrop2"
class=
"dropdown-toggle
nav-link
"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"myTabDrop2"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"myTabDrop2"
>
<li><a
href=
"#dropdown1-1"
tabindex=
"-1"
data-toggle=
"tab"
>
@fat
</a></li>
<li><a
href=
"#dropdown1-1"
tabindex=
"-1"
data-toggle=
"tab"
>
@fat
</a></li>
<li><a
href=
"#dropdown1-2"
tabindex=
"-1"
data-toggle=
"tab"
>
@mdo
</a></li>
<li><a
href=
"#dropdown1-2"
tabindex=
"-1"
data-toggle=
"tab"
>
@mdo
</a></li>
...
@@ -99,10 +99,10 @@
...
@@ -99,10 +99,10 @@
<h4>
Tabs without fade (no initially active pane)
</h4>
<h4>
Tabs without fade (no initially active pane)
</h4>
<ul
id=
"myTab2"
class=
"nav nav-tabs"
>
<ul
id=
"myTab2"
class=
"nav nav-tabs"
>
<li
><a
href=
"#home2"
data-toggle=
"tab"
>
Home
</a></li>
<li
class=
"nav-item"
><a
class=
"nav-link"
href=
"#home2"
data-toggle=
"tab"
>
Home
</a></li>
<li
><a
href=
"#profile2"
data-toggle=
"tab"
>
Profile
</a></li>
<li
class=
"nav-item"
><a
class=
"nav-link"
href=
"#profile2"
data-toggle=
"tab"
>
Profile
</a></li>
<li
class=
"dropdown"
>
<li
class=
"dropdown
nav-item
"
>
<a
href=
"#"
id=
"myTabDrop3"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<a
href=
"#"
id=
"myTabDrop3"
class=
"dropdown-toggle
nav-link
"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"myTabDrop3"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"myTabDrop3"
>
<li><a
href=
"#dropdown2-1"
tabindex=
"-1"
data-toggle=
"tab"
>
@fat
</a></li>
<li><a
href=
"#dropdown2-1"
tabindex=
"-1"
data-toggle=
"tab"
>
@fat
</a></li>
<li><a
href=
"#dropdown2-2"
tabindex=
"-1"
data-toggle=
"tab"
>
@mdo
</a></li>
<li><a
href=
"#dropdown2-2"
tabindex=
"-1"
data-toggle=
"tab"
>
@mdo
</a></li>
...
@@ -131,10 +131,10 @@
...
@@ -131,10 +131,10 @@
<h4>
Tabs with fade (no initially active pane)
</h4>
<h4>
Tabs with fade (no initially active pane)
</h4>
<ul
id=
"myTab3"
class=
"nav nav-tabs"
>
<ul
id=
"myTab3"
class=
"nav nav-tabs"
>
<li
><a
href=
"#home3"
data-toggle=
"tab"
>
Home
</a></li>
<li
class=
"nav-item"
><a
class=
"nav-link"
href=
"#home3"
data-toggle=
"tab"
>
Home
</a></li>
<li
><a
href=
"#profile3"
data-toggle=
"tab"
>
Profile
</a></li>
<li
class=
"nav-item"
><a
class=
"nav-link"
href=
"#profile3"
data-toggle=
"tab"
>
Profile
</a></li>
<li
class=
"dropdown"
>
<li
class=
"dropdown
nav-item
"
>
<a
href=
"#"
id=
"myTabDrop4"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<a
href=
"#"
id=
"myTabDrop4"
class=
"dropdown-toggle
nav-link
"
data-toggle=
"dropdown"
>
Dropdown
<b
class=
"caret"
></b></a>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"myTabDrop4"
>
<ul
class=
"dropdown-menu"
role=
"menu"
aria-labelledby=
"myTabDrop4"
>
<li><a
href=
"#dropdown3-1"
tabindex=
"-1"
data-toggle=
"tab"
>
@fat
</a></li>
<li><a
href=
"#dropdown3-1"
tabindex=
"-1"
data-toggle=
"tab"
>
@fat
</a></li>
<li><a
href=
"#dropdown3-2"
tabindex=
"-1"
data-toggle=
"tab"
>
@mdo
</a></li>
<li><a
href=
"#dropdown3-2"
tabindex=
"-1"
data-toggle=
"tab"
>
@mdo
</a></li>
...
@@ -164,9 +164,9 @@
...
@@ -164,9 +164,9 @@
<!-- JavaScript Includes -->
<!-- JavaScript Includes -->
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../../
transition
.js"
></script>
<script
src=
"../../
dist/util
.js"
></script>
<script
src=
"../../tab.js"
></script>
<script
src=
"../../
dist/
tab.js"
></script>
<script
src=
"../../dropdown.js"
></script>
<script
src=
"../../
dist/
dropdown.js"
></script>
</body>
</body>
</html>
</html>
This diff is collapsed.
Click to expand it.
js/tests/visual/tooltip.html
+
5
-
4
View file @
dbaffd43
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"IE=edge"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
Tooltip
</title>
<title>
Tooltip
</title>
<link
rel=
"stylesheet"
href=
"../../../dist/css/bootstrap.
min.
css"
>
<link
rel=
"stylesheet"
href=
"../../../dist/css/bootstrap.css"
>
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
<h1>
Tooltip
<small>
Bootstrap Visual Test
</small></h1>
<h1>
Tooltip
<small>
Bootstrap Visual Test
</small></h1>
</div>
</div>
<p
class=
"muted"
style=
"margin-bottom: 0;"
>
Tight pants next level keffiyeh
<a
href=
"#"
data-toggle=
"tooltip"
title=
""
data-original-
title=
"Default tooltip"
>
you probably
</a>
haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel
<a
href=
"#"
data-toggle=
"tooltip"
title=
""
data-original-
title=
"Another tooltip"
>
have a
</a>
terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan
<a
href=
"#"
data-toggle=
"tooltip"
title=
""
data-original-
title=
"Another one here too"
>
whatever keytar
</a>
, scenester farm-to-table banksy Austin
<a
href=
"#"
data-toggle=
"tooltip"
title=
""
data-original-
title=
"The last tip!"
>
twitter handle
</a>
freegan cred raw denim single-origin coffee viral.
<p
class=
"muted"
style=
"margin-bottom: 0;"
>
Tight pants next level keffiyeh
<a
href=
"#"
data-toggle=
"tooltip"
title=
"Default tooltip"
>
you probably
</a>
haven't heard of them. Photo booth beard raw denim letterpress vegan messenger bag stumptown. Farm-to-table seitan, mcsweeney's fixie sustainable quinoa 8-bit american apparel
<a
href=
"#"
data-toggle=
"tooltip"
title=
"Another tooltip"
>
have a
</a>
terry richardson vinyl chambray. Beard stumptown, cardigans banh mi lomo thundercats. Tofu biodiesel williamsburg marfa, four loko mcsweeney's cleanse vegan chambray. A really ironic artisan
<a
href=
"#"
data-toggle=
"tooltip"
title=
"Another one here too"
>
whatever keytar
</a>
, scenester farm-to-table banksy Austin
<a
href=
"#"
data-toggle=
"tooltip"
title=
"The last tip!"
>
twitter handle
</a>
freegan cred raw denim single-origin coffee viral.
</p>
</p>
<hr>
<hr>
<p>
<p>
...
@@ -36,8 +36,9 @@
...
@@ -36,8 +36,9 @@
<!-- JavaScript Includes -->
<!-- JavaScript Includes -->
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../vendor/jquery.min.js"
></script>
<script
src=
"../../transition.js"
></script>
<script
src=
"../vendor/tether.min.js"
></script>
<script
src=
"../../tooltip.js"
></script>
<script
src=
"../../dist/util.js"
></script>
<script
src=
"../../dist/tooltip.js"
></script>
<!-- JavaScript Test -->
<!-- JavaScript Test -->
<script>
<script>
...
...
This diff is collapsed.
Click to expand it.
js/tooltip.js
deleted
100644 → 0
+
0
-
514
View file @
06b1d498
/* ========================================================================
* Bootstrap: tooltip.js v3.3.4
* http://getbootstrap.com/javascript/#tooltip
* Inspired by the original jQuery.tipsy by Jason Frame
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+
function
(
$
)
{
'
use strict
'
;
// TOOLTIP PUBLIC CLASS DEFINITION
// ===============================
var
Tooltip
=
function
(
element
,
options
)
{
this
.
type
=
null
this
.
options
=
null
this
.
enabled
=
null
this
.
timeout
=
null
this
.
hoverState
=
null
this
.
$element
=
null
this
.
inState
=
null
this
.
init
(
'
tooltip
'
,
element
,
options
)
}
Tooltip
.
VERSION
=
'
3.3.4
'
Tooltip
.
TRANSITION_DURATION
=
150
Tooltip
.
DEFAULTS
=
{
animation
:
true
,
placement
:
'
top
'
,
selector
:
false
,
template
:
'
<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>
'
,
trigger
:
'
hover focus
'
,
title
:
''
,
delay
:
0
,
html
:
false
,
container
:
false
,
viewport
:
{
selector
:
'
body
'
,
padding
:
0
}
}
Tooltip
.
prototype
.
init
=
function
(
type
,
element
,
options
)
{
this
.
enabled
=
true
this
.
type
=
type
this
.
$element
=
$
(
element
)
this
.
options
=
this
.
getOptions
(
options
)
this
.
$viewport
=
this
.
options
.
viewport
&&
$
(
$
.
isFunction
(
this
.
options
.
viewport
)
?
this
.
options
.
viewport
.
call
(
this
,
this
.
$element
)
:
(
this
.
options
.
viewport
.
selector
||
this
.
options
.
viewport
))
this
.
inState
=
{
click
:
false
,
hover
:
false
,
focus
:
false
}
if
(
this
.
$element
[
0
]
instanceof
document
.
constructor
&&
!
this
.
options
.
selector
)
{
throw
new
Error
(
'
`selector` option must be specified when initializing
'
+
this
.
type
+
'
on the window.document object!
'
)
}
var
triggers
=
this
.
options
.
trigger
.
split
(
'
'
)
for
(
var
i
=
triggers
.
length
;
i
--
;)
{
var
trigger
=
triggers
[
i
]
if
(
trigger
==
'
click
'
)
{
this
.
$element
.
on
(
'
click.
'
+
this
.
type
,
this
.
options
.
selector
,
$
.
proxy
(
this
.
toggle
,
this
))
}
else
if
(
trigger
!=
'
manual
'
)
{
var
eventIn
=
trigger
==
'
hover
'
?
'
mouseenter
'
:
'
focusin
'
var
eventOut
=
trigger
==
'
hover
'
?
'
mouseleave
'
:
'
focusout
'
this
.
$element
.
on
(
eventIn
+
'
.
'
+
this
.
type
,
this
.
options
.
selector
,
$
.
proxy
(
this
.
enter
,
this
))
this
.
$element
.
on
(
eventOut
+
'
.
'
+
this
.
type
,
this
.
options
.
selector
,
$
.
proxy
(
this
.
leave
,
this
))
}
}
this
.
options
.
selector
?
(
this
.
_options
=
$
.
extend
({},
this
.
options
,
{
trigger
:
'
manual
'
,
selector
:
''
}))
:
this
.
fixTitle
()
}
Tooltip
.
prototype
.
getDefaults
=
function
()
{
return
Tooltip
.
DEFAULTS
}
Tooltip
.
prototype
.
getOptions
=
function
(
options
)
{
options
=
$
.
extend
({},
this
.
getDefaults
(),
this
.
$element
.
data
(),
options
)
if
(
options
.
delay
&&
typeof
options
.
delay
==
'
number
'
)
{
options
.
delay
=
{
show
:
options
.
delay
,
hide
:
options
.
delay
}
}
return
options
}
Tooltip
.
prototype
.
getDelegateOptions
=
function
()
{
var
options
=
{}
var
defaults
=
this
.
getDefaults
()
this
.
_options
&&
$
.
each
(
this
.
_options
,
function
(
key
,
value
)
{
if
(
defaults
[
key
]
!=
value
)
options
[
key
]
=
value
})
return
options
}
Tooltip
.
prototype
.
enter
=
function
(
obj
)
{
var
self
=
obj
instanceof
this
.
constructor
?
obj
:
$
(
obj
.
currentTarget
).
data
(
'
bs.
'
+
this
.
type
)
if
(
!
self
)
{
self
=
new
this
.
constructor
(
obj
.
currentTarget
,
this
.
getDelegateOptions
())
$
(
obj
.
currentTarget
).
data
(
'
bs.
'
+
this
.
type
,
self
)
}
if
(
obj
instanceof
$
.
Event
)
{
self
.
inState
[
obj
.
type
==
'
focusin
'
?
'
focus
'
:
'
hover
'
]
=
true
}
if
(
self
.
tip
().
hasClass
(
'
in
'
)
||
self
.
hoverState
==
'
in
'
)
{
self
.
hoverState
=
'
in
'
return
}
clearTimeout
(
self
.
timeout
)
self
.
hoverState
=
'
in
'
if
(
!
self
.
options
.
delay
||
!
self
.
options
.
delay
.
show
)
return
self
.
show
()
self
.
timeout
=
setTimeout
(
function
()
{
if
(
self
.
hoverState
==
'
in
'
)
self
.
show
()
},
self
.
options
.
delay
.
show
)
}
Tooltip
.
prototype
.
isInStateTrue
=
function
()
{
for
(
var
key
in
this
.
inState
)
{
if
(
this
.
inState
[
key
])
return
true
}
return
false
}
Tooltip
.
prototype
.
leave
=
function
(
obj
)
{
var
self
=
obj
instanceof
this
.
constructor
?
obj
:
$
(
obj
.
currentTarget
).
data
(
'
bs.
'
+
this
.
type
)
if
(
!
self
)
{
self
=
new
this
.
constructor
(
obj
.
currentTarget
,
this
.
getDelegateOptions
())
$
(
obj
.
currentTarget
).
data
(
'
bs.
'
+
this
.
type
,
self
)
}
if
(
obj
instanceof
$
.
Event
)
{
self
.
inState
[
obj
.
type
==
'
focusout
'
?
'
focus
'
:
'
hover
'
]
=
false
}
if
(
self
.
isInStateTrue
())
return
clearTimeout
(
self
.
timeout
)
self
.
hoverState
=
'
out
'
if
(
!
self
.
options
.
delay
||
!
self
.
options
.
delay
.
hide
)
return
self
.
hide
()
self
.
timeout
=
setTimeout
(
function
()
{
if
(
self
.
hoverState
==
'
out
'
)
self
.
hide
()
},
self
.
options
.
delay
.
hide
)
}
Tooltip
.
prototype
.
show
=
function
()
{
var
e
=
$
.
Event
(
'
show.bs.
'
+
this
.
type
)
if
(
this
.
hasContent
()
&&
this
.
enabled
)
{
this
.
$element
.
trigger
(
e
)
var
inDom
=
$
.
contains
(
this
.
$element
[
0
].
ownerDocument
.
documentElement
,
this
.
$element
[
0
])
if
(
e
.
isDefaultPrevented
()
||
!
inDom
)
return
var
that
=
this
var
$tip
=
this
.
tip
()
var
tipId
=
this
.
getUID
(
this
.
type
)
this
.
setContent
()
$tip
.
attr
(
'
id
'
,
tipId
)
this
.
$element
.
attr
(
'
aria-describedby
'
,
tipId
)
if
(
this
.
options
.
animation
)
$tip
.
addClass
(
'
fade
'
)
var
placement
=
typeof
this
.
options
.
placement
==
'
function
'
?
this
.
options
.
placement
.
call
(
this
,
$tip
[
0
],
this
.
$element
[
0
])
:
this
.
options
.
placement
var
autoToken
=
/
\s?
auto
?\s?
/i
var
autoPlace
=
autoToken
.
test
(
placement
)
if
(
autoPlace
)
placement
=
placement
.
replace
(
autoToken
,
''
)
||
'
top
'
$tip
.
detach
()
.
css
({
top
:
0
,
left
:
0
,
display
:
'
block
'
})
.
addClass
(
placement
)
.
data
(
'
bs.
'
+
this
.
type
,
this
)
this
.
options
.
container
?
$tip
.
appendTo
(
this
.
options
.
container
)
:
$tip
.
insertAfter
(
this
.
$element
)
this
.
$element
.
trigger
(
'
inserted.bs.
'
+
this
.
type
)
var
pos
=
this
.
getPosition
()
var
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualHeight
=
$tip
[
0
].
offsetHeight
if
(
autoPlace
)
{
var
orgPlacement
=
placement
var
viewportDim
=
this
.
getPosition
(
this
.
$viewport
)
placement
=
placement
==
'
bottom
'
&&
pos
.
bottom
+
actualHeight
>
viewportDim
.
bottom
?
'
top
'
:
placement
==
'
top
'
&&
pos
.
top
-
actualHeight
<
viewportDim
.
top
?
'
bottom
'
:
placement
==
'
right
'
&&
pos
.
right
+
actualWidth
>
viewportDim
.
width
?
'
left
'
:
placement
==
'
left
'
&&
pos
.
left
-
actualWidth
<
viewportDim
.
left
?
'
right
'
:
placement
$tip
.
removeClass
(
orgPlacement
)
.
addClass
(
placement
)
}
var
calculatedOffset
=
this
.
getCalculatedOffset
(
placement
,
pos
,
actualWidth
,
actualHeight
)
this
.
applyPlacement
(
calculatedOffset
,
placement
)
var
complete
=
function
()
{
var
prevHoverState
=
that
.
hoverState
that
.
$element
.
trigger
(
'
shown.bs.
'
+
that
.
type
)
that
.
hoverState
=
null
if
(
prevHoverState
==
'
out
'
)
that
.
leave
(
that
)
}
$
.
support
.
transition
&&
this
.
$tip
.
hasClass
(
'
fade
'
)
?
$tip
.
one
(
'
bsTransitionEnd
'
,
complete
)
.
emulateTransitionEnd
(
Tooltip
.
TRANSITION_DURATION
)
:
complete
()
}
}
Tooltip
.
prototype
.
applyPlacement
=
function
(
offset
,
placement
)
{
var
$tip
=
this
.
tip
()
var
width
=
$tip
[
0
].
offsetWidth
var
height
=
$tip
[
0
].
offsetHeight
// manually read margins because getBoundingClientRect includes difference
var
marginTop
=
parseInt
(
$tip
.
css
(
'
margin-top
'
),
10
)
var
marginLeft
=
parseInt
(
$tip
.
css
(
'
margin-left
'
),
10
)
// we must check for NaN for ie 8/9
if
(
isNaN
(
marginTop
))
marginTop
=
0
if
(
isNaN
(
marginLeft
))
marginLeft
=
0
offset
.
top
+=
marginTop
offset
.
left
+=
marginLeft
// $.fn.offset doesn't round pixel values
// so we use setOffset directly with our own function B-0
$
.
offset
.
setOffset
(
$tip
[
0
],
$
.
extend
({
using
:
function
(
props
)
{
$tip
.
css
({
top
:
Math
.
round
(
props
.
top
),
left
:
Math
.
round
(
props
.
left
)
})
}
},
offset
),
0
)
$tip
.
addClass
(
'
in
'
)
// check to see if placing tip in new offset caused the tip to resize itself
var
actualWidth
=
$tip
[
0
].
offsetWidth
var
actualHeight
=
$tip
[
0
].
offsetHeight
if
(
placement
==
'
top
'
&&
actualHeight
!=
height
)
{
offset
.
top
=
offset
.
top
+
height
-
actualHeight
}
var
delta
=
this
.
getViewportAdjustedDelta
(
placement
,
offset
,
actualWidth
,
actualHeight
)
if
(
delta
.
left
)
offset
.
left
+=
delta
.
left
else
offset
.
top
+=
delta
.
top
var
isVertical
=
/top|bottom/
.
test
(
placement
)
var
arrowDelta
=
isVertical
?
delta
.
left
*
2
-
width
+
actualWidth
:
delta
.
top
*
2
-
height
+
actualHeight
var
arrowOffsetPosition
=
isVertical
?
'
offsetWidth
'
:
'
offsetHeight
'
$tip
.
offset
(
offset
)
this
.
replaceArrow
(
arrowDelta
,
$tip
[
0
][
arrowOffsetPosition
],
isVertical
)
}
Tooltip
.
prototype
.
replaceArrow
=
function
(
delta
,
dimension
,
isVertical
)
{
this
.
arrow
()
.
css
(
isVertical
?
'
left
'
:
'
top
'
,
50
*
(
1
-
delta
/
dimension
)
+
'
%
'
)
.
css
(
isVertical
?
'
top
'
:
'
left
'
,
''
)
}
Tooltip
.
prototype
.
setContent
=
function
()
{
var
$tip
=
this
.
tip
()
var
title
=
this
.
getTitle
()
$tip
.
find
(
'
.tooltip-inner
'
)[
this
.
options
.
html
?
'
html
'
:
'
text
'
](
title
)
$tip
.
removeClass
(
'
fade in top bottom left right
'
)
}
Tooltip
.
prototype
.
hide
=
function
(
callback
)
{
var
that
=
this
var
$tip
=
$
(
this
.
$tip
)
var
e
=
$
.
Event
(
'
hide.bs.
'
+
this
.
type
)
function
complete
()
{
if
(
that
.
hoverState
!=
'
in
'
)
$tip
.
detach
()
that
.
$element
.
removeAttr
(
'
aria-describedby
'
)
.
trigger
(
'
hidden.bs.
'
+
that
.
type
)
callback
&&
callback
()
}
this
.
$element
.
trigger
(
e
)
if
(
e
.
isDefaultPrevented
())
return
$tip
.
removeClass
(
'
in
'
)
$
.
support
.
transition
&&
$tip
.
hasClass
(
'
fade
'
)
?
$tip
.
one
(
'
bsTransitionEnd
'
,
complete
)
.
emulateTransitionEnd
(
Tooltip
.
TRANSITION_DURATION
)
:
complete
()
this
.
hoverState
=
null
return
this
}
Tooltip
.
prototype
.
fixTitle
=
function
()
{
var
$e
=
this
.
$element
if
(
$e
.
attr
(
'
title
'
)
||
typeof
$e
.
attr
(
'
data-original-title
'
)
!=
'
string
'
)
{
$e
.
attr
(
'
data-original-title
'
,
$e
.
attr
(
'
title
'
)
||
''
).
attr
(
'
title
'
,
''
)
}
}
Tooltip
.
prototype
.
hasContent
=
function
()
{
return
this
.
getTitle
()
}
Tooltip
.
prototype
.
getPosition
=
function
(
$element
)
{
$element
=
$element
||
this
.
$element
var
el
=
$element
[
0
]
var
isBody
=
el
.
tagName
==
'
BODY
'
var
elRect
=
el
.
getBoundingClientRect
()
if
(
elRect
.
width
==
null
)
{
// width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093
elRect
=
$
.
extend
({},
elRect
,
{
width
:
elRect
.
right
-
elRect
.
left
,
height
:
elRect
.
bottom
-
elRect
.
top
})
}
var
elOffset
=
isBody
?
{
top
:
0
,
left
:
0
}
:
$element
.
offset
()
var
scroll
=
{
scroll
:
isBody
?
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
:
$element
.
scrollTop
()
}
var
outerDims
=
isBody
?
{
width
:
$
(
window
).
width
(),
height
:
$
(
window
).
height
()
}
:
null
return
$
.
extend
({},
elRect
,
scroll
,
outerDims
,
elOffset
)
}
Tooltip
.
prototype
.
getCalculatedOffset
=
function
(
placement
,
pos
,
actualWidth
,
actualHeight
)
{
return
placement
==
'
bottom
'
?
{
top
:
pos
.
top
+
pos
.
height
,
left
:
pos
.
left
+
pos
.
width
/
2
-
actualWidth
/
2
}
:
placement
==
'
top
'
?
{
top
:
pos
.
top
-
actualHeight
,
left
:
pos
.
left
+
pos
.
width
/
2
-
actualWidth
/
2
}
:
placement
==
'
left
'
?
{
top
:
pos
.
top
+
pos
.
height
/
2
-
actualHeight
/
2
,
left
:
pos
.
left
-
actualWidth
}
:
/* placement == 'right' */
{
top
:
pos
.
top
+
pos
.
height
/
2
-
actualHeight
/
2
,
left
:
pos
.
left
+
pos
.
width
}
}
Tooltip
.
prototype
.
getViewportAdjustedDelta
=
function
(
placement
,
pos
,
actualWidth
,
actualHeight
)
{
var
delta
=
{
top
:
0
,
left
:
0
}
if
(
!
this
.
$viewport
)
return
delta
var
viewportPadding
=
this
.
options
.
viewport
&&
this
.
options
.
viewport
.
padding
||
0
var
viewportDimensions
=
this
.
getPosition
(
this
.
$viewport
)
if
(
/right|left/
.
test
(
placement
))
{
var
topEdgeOffset
=
pos
.
top
-
viewportPadding
-
viewportDimensions
.
scroll
var
bottomEdgeOffset
=
pos
.
top
+
viewportPadding
-
viewportDimensions
.
scroll
+
actualHeight
if
(
topEdgeOffset
<
viewportDimensions
.
top
)
{
// top overflow
delta
.
top
=
viewportDimensions
.
top
-
topEdgeOffset
}
else
if
(
bottomEdgeOffset
>
viewportDimensions
.
top
+
viewportDimensions
.
height
)
{
// bottom overflow
delta
.
top
=
viewportDimensions
.
top
+
viewportDimensions
.
height
-
bottomEdgeOffset
}
}
else
{
var
leftEdgeOffset
=
pos
.
left
-
viewportPadding
var
rightEdgeOffset
=
pos
.
left
+
viewportPadding
+
actualWidth
if
(
leftEdgeOffset
<
viewportDimensions
.
left
)
{
// left overflow
delta
.
left
=
viewportDimensions
.
left
-
leftEdgeOffset
}
else
if
(
rightEdgeOffset
>
viewportDimensions
.
right
)
{
// right overflow
delta
.
left
=
viewportDimensions
.
left
+
viewportDimensions
.
width
-
rightEdgeOffset
}
}
return
delta
}
Tooltip
.
prototype
.
getTitle
=
function
()
{
var
title
var
$e
=
this
.
$element
var
o
=
this
.
options
title
=
$e
.
attr
(
'
data-original-title
'
)
||
(
typeof
o
.
title
==
'
function
'
?
o
.
title
.
call
(
$e
[
0
])
:
o
.
title
)
return
title
}
Tooltip
.
prototype
.
getUID
=
function
(
prefix
)
{
do
prefix
+=
~~
(
Math
.
random
()
*
1000000
)
while
(
document
.
getElementById
(
prefix
))
return
prefix
}
Tooltip
.
prototype
.
tip
=
function
()
{
if
(
!
this
.
$tip
)
{
this
.
$tip
=
$
(
this
.
options
.
template
)
if
(
this
.
$tip
.
length
!=
1
)
{
throw
new
Error
(
this
.
type
+
'
`template` option must consist of exactly 1 top-level element!
'
)
}
}
return
this
.
$tip
}
Tooltip
.
prototype
.
arrow
=
function
()
{
return
(
this
.
$arrow
=
this
.
$arrow
||
this
.
tip
().
find
(
'
.tooltip-arrow
'
))
}
Tooltip
.
prototype
.
enable
=
function
()
{
this
.
enabled
=
true
}
Tooltip
.
prototype
.
disable
=
function
()
{
this
.
enabled
=
false
}
Tooltip
.
prototype
.
toggleEnabled
=
function
()
{
this
.
enabled
=
!
this
.
enabled
}
Tooltip
.
prototype
.
toggle
=
function
(
e
)
{
var
self
=
this
if
(
e
)
{
self
=
$
(
e
.
currentTarget
).
data
(
'
bs.
'
+
this
.
type
)
if
(
!
self
)
{
self
=
new
this
.
constructor
(
e
.
currentTarget
,
this
.
getDelegateOptions
())
$
(
e
.
currentTarget
).
data
(
'
bs.
'
+
this
.
type
,
self
)
}
}
if
(
e
)
{
self
.
inState
.
click
=
!
self
.
inState
.
click
if
(
self
.
isInStateTrue
())
self
.
enter
(
self
)
else
self
.
leave
(
self
)
}
else
{
self
.
tip
().
hasClass
(
'
in
'
)
?
self
.
leave
(
self
)
:
self
.
enter
(
self
)
}
}
Tooltip
.
prototype
.
destroy
=
function
()
{
var
that
=
this
clearTimeout
(
this
.
timeout
)
this
.
hide
(
function
()
{
that
.
$element
.
off
(
'
.
'
+
that
.
type
).
removeData
(
'
bs.
'
+
that
.
type
)
if
(
that
.
$tip
)
{
that
.
$tip
.
detach
()
}
that
.
$tip
=
null
that
.
$arrow
=
null
that
.
$viewport
=
null
})
}
// TOOLTIP PLUGIN DEFINITION
// =========================
function
Plugin
(
option
)
{
return
this
.
each
(
function
()
{
var
$this
=
$
(
this
)
var
data
=
$this
.
data
(
'
bs.tooltip
'
)
var
options
=
typeof
option
==
'
object
'
&&
option
if
(
!
data
&&
/destroy|hide/
.
test
(
option
))
return
if
(
!
data
)
$this
.
data
(
'
bs.tooltip
'
,
(
data
=
new
Tooltip
(
this
,
options
)))
if
(
typeof
option
==
'
string
'
)
data
[
option
]()
})
}
var
old
=
$
.
fn
.
tooltip
$
.
fn
.
tooltip
=
Plugin
$
.
fn
.
tooltip
.
Constructor
=
Tooltip
// TOOLTIP NO CONFLICT
// ===================
$
.
fn
.
tooltip
.
noConflict
=
function
()
{
$
.
fn
.
tooltip
=
old
return
this
}
}(
jQuery
);
This diff is collapsed.
Click to expand it.
js/transition.js
deleted
100644 → 0
+
0
-
59
View file @
06b1d498
/* ========================================================================
* Bootstrap: transition.js v3.3.4
* http://getbootstrap.com/javascript/#transitions
* ========================================================================
* Copyright 2011-2015 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
* ======================================================================== */
+
function
(
$
)
{
'
use strict
'
;
// CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/)
// ============================================================
function
transitionEnd
()
{
var
el
=
document
.
createElement
(
'
bootstrap
'
)
var
transEndEventNames
=
{
WebkitTransition
:
'
webkitTransitionEnd
'
,
MozTransition
:
'
transitionend
'
,
OTransition
:
'
oTransitionEnd otransitionend
'
,
transition
:
'
transitionend
'
}
for
(
var
name
in
transEndEventNames
)
{
if
(
el
.
style
[
name
]
!==
undefined
)
{
return
{
end
:
transEndEventNames
[
name
]
}
}
}
return
false
// explicit for ie8 ( ._.)
}
// http://blog.alexmaccaw.com/css-transitions
$
.
fn
.
emulateTransitionEnd
=
function
(
duration
)
{
var
called
=
false
var
$el
=
this
$
(
this
).
one
(
'
bsTransitionEnd
'
,
function
()
{
called
=
true
})
var
callback
=
function
()
{
if
(
!
called
)
$
(
$el
).
trigger
(
$
.
support
.
transition
.
end
)
}
setTimeout
(
callback
,
duration
)
return
this
}
$
(
function
()
{
$
.
support
.
transition
=
transitionEnd
()
if
(
!
$
.
support
.
transition
)
return
$
.
event
.
special
.
bsTransitionEnd
=
{
bindType
:
$
.
support
.
transition
.
end
,
delegateType
:
$
.
support
.
transition
.
end
,
handle
:
function
(
e
)
{
if
(
$
(
e
.
target
).
is
(
this
))
return
e
.
handleObj
.
handler
.
apply
(
this
,
arguments
)
}
}
})
}(
jQuery
);
This diff is collapsed.
Click to expand it.
package.json
+
8
-
1
View file @
dbaffd43
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
"
glob
"
:
"
~5.0.3
"
,
"
glob
"
:
"
~5.0.3
"
,
"
grunt
"
:
"
~0.4.5
"
,
"
grunt
"
:
"
~0.4.5
"
,
"
grunt-autoprefixer
"
:
"
~2.2.0
"
,
"
grunt-autoprefixer
"
:
"
~2.2.0
"
,
"
grunt-babel
"
:
"
^5.0.0
"
,
"
grunt-banner
"
:
"
~0.3.1
"
,
"
grunt-banner
"
:
"
~0.3.1
"
,
"
grunt-contrib-clean
"
:
"
~0.6.0
"
,
"
grunt-contrib-clean
"
:
"
~0.6.0
"
,
"
grunt-contrib-compress
"
:
"
~0.13.0
"
,
"
grunt-contrib-compress
"
:
"
~0.13.0
"
,
...
@@ -54,11 +55,13 @@
...
@@ -54,11 +55,13 @@
"
grunt-html
"
:
"
~4.0.1
"
,
"
grunt-html
"
:
"
~4.0.1
"
,
"
grunt-jekyll
"
:
"
~0.4.2
"
,
"
grunt-jekyll
"
:
"
~0.4.2
"
,
"
grunt-jscs
"
:
"
~1.8.0
"
,
"
grunt-jscs
"
:
"
~1.8.0
"
,
"
grunt-line-remover
"
:
"
0.0.2
"
,
"
grunt-postcss
"
:
"
^0.3.0
"
,
"
grunt-postcss
"
:
"
^0.3.0
"
,
"
grunt-sass
"
:
"
^1.0.0
"
,
"
grunt-sass
"
:
"
^1.0.0
"
,
"
grunt-saucelabs
"
:
"
~8.6.0
"
,
"
grunt-saucelabs
"
:
"
~8.6.0
"
,
"
grunt-scss-lint
"
:
"
^0.3.4
"
,
"
grunt-scss-lint
"
:
"
^0.3.4
"
,
"
grunt-sed
"
:
"
~0.1.1
"
,
"
grunt-sed
"
:
"
~0.1.1
"
,
"
grunt-stamp
"
:
"
^0.1.0
"
,
"
load-grunt-tasks
"
:
"
~3.1.0
"
,
"
load-grunt-tasks
"
:
"
~3.1.0
"
,
"
markdown-it
"
:
"
^4.0.1
"
,
"
markdown-it
"
:
"
^4.0.1
"
,
"
mq4-hover-shim
"
:
"
^0.1.0
"
,
"
mq4-hover-shim
"
:
"
^0.1.0
"
,
...
@@ -85,6 +88,10 @@
...
@@ -85,6 +88,10 @@
"exports"
:
"$"
"exports"
:
"$"
}
}
},
},
"files"
:
[
"css"
,
"fonts"
,
"js"
]
"files"
:
[
"css"
,
"fonts"
,
"js"
]
}
}
}
}
This diff is collapsed.
Click to expand it.
scss/_popover.scss
+
86
-
64
View file @
dbaffd43
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
top
:
0
;
top
:
0
;
left
:
0
;
left
:
0
;
z-index
:
$zindex-popover
;
z-index
:
$zindex-popover
;
display
:
none
;
display
:
block
;
max-width
:
$popover-max-width
;
max-width
:
$popover-max-width
;
padding
:
1px
;
padding
:
1px
;
// Reset font and text properties given new insertion method
// Reset font and text properties given new insertion method
...
@@ -24,14 +24,94 @@
...
@@ -24,14 +24,94 @@
border
:
1px
solid
$popover-border-color
;
border
:
1px
solid
$popover-border-color
;
@include
border-radius
(
$border-radius-lg
);
@include
border-radius
(
$border-radius-lg
);
@include
box-shadow
(
0
5px
10px
rgba
(
0
,
0
,
0
,.
2
));
@include
box-shadow
(
0
5px
10px
rgba
(
0
,
0
,
0
,.
2
));
// Popover directions
&
.popover-top
,
&
.bs-tether-element-attached-bottom
{
margin-top
:
-
$popover-arrow-width
;
.popover-arrow
{
bottom
:
-
$popover-arrow-outer-width
;
left
:
50%
;
margin-left
:
-
$popover-arrow-outer-width
;
border-top-color
:
$popover-arrow-outer-color
;
border-bottom-width
:
0
;
&
:after
{
bottom
:
1px
;
margin-left
:
-
$popover-arrow-width
;
content
:
""
;
border-top-color
:
$popover-arrow-color
;
border-bottom-width
:
0
;
}
}
}
&
.popover-right
,
&
.bs-tether-element-attached-left
{
margin-left
:
$popover-arrow-width
;
.popover-arrow
{
top
:
50%
;
left
:
-
$popover-arrow-outer-width
;
margin-top
:
-
$popover-arrow-outer-width
;
border-right-color
:
$popover-arrow-outer-color
;
border-left-width
:
0
;
&
:after
{
bottom
:
-
$popover-arrow-width
;
left
:
1px
;
content
:
""
;
border-right-color
:
$popover-arrow-color
;
border-left-width
:
0
;
}
}
}
&
.popover-bottom
,
&
.bs-tether-element-attached-top
{
margin-top
:
$popover-arrow-width
;
.popover-arrow
{
top
:
-
$popover-arrow-outer-width
;
left
:
50%
;
margin-left
:
-
$popover-arrow-outer-width
;
border-top-width
:
0
;
border-bottom-color
:
$popover-arrow-outer-color
;
&
:after
{
top
:
1px
;
margin-left
:
-
$popover-arrow-width
;
content
:
""
;
border-top-width
:
0
;
border-bottom-color
:
$popover-arrow-color
;
}
}
}
&
.popover-left
,
&
.bs-tether-element-attached-right
{
margin-left
:
-
$popover-arrow-width
;
.popover-arrow
{
top
:
50%
;
right
:
-
$popover-arrow-outer-width
;
margin-top
:
-
$popover-arrow-outer-width
;
border-right-width
:
0
;
border-left-color
:
$popover-arrow-outer-color
;
&
:after
{
right
:
1px
;
bottom
:
-
$popover-arrow-width
;
content
:
""
;
border-right-width
:
0
;
border-left-color
:
$popover-arrow-color
;
}
}
}
}
}
// Offset the popover to account for the popover arrow
.popover-top
{
margin-top
:
-
$popover-arrow-width
;
}
.popover-right
{
margin-left
:
$popover-arrow-width
;
}
.popover-bottom
{
margin-top
:
$popover-arrow-width
;
}
.popover-left
{
margin-left
:
-
$popover-arrow-width
;
}
// Offset the popover to account for the popover arrow
.popover-title
{
.popover-title
{
padding
:
8px
14px
;
padding
:
8px
14px
;
margin
:
0
;
// reset heading margin
margin
:
0
;
// reset heading margin
...
@@ -68,61 +148,3 @@
...
@@ -68,61 +148,3 @@
content
:
""
;
content
:
""
;
border-width
:
$popover-arrow-width
;
border-width
:
$popover-arrow-width
;
}
}
.popover-top
>
.popover-arrow
{
bottom
:
-
$popover-arrow-outer-width
;
left
:
50%
;
margin-left
:
-
$popover-arrow-outer-width
;
border-top-color
:
$popover-arrow-outer-color
;
border-bottom-width
:
0
;
&
:after
{
bottom
:
1px
;
margin-left
:
-
$popover-arrow-width
;
content
:
""
;
border-top-color
:
$popover-arrow-color
;
border-bottom-width
:
0
;
}
}
.popover-right
>
.popover-arrow
{
top
:
50%
;
left
:
-
$popover-arrow-outer-width
;
margin-top
:
-
$popover-arrow-outer-width
;
border-right-color
:
$popover-arrow-outer-color
;
border-left-width
:
0
;
&
:after
{
bottom
:
-
$popover-arrow-width
;
left
:
1px
;
content
:
""
;
border-right-color
:
$popover-arrow-color
;
border-left-width
:
0
;
}
}
.popover-bottom
>
.popover-arrow
{
top
:
-
$popover-arrow-outer-width
;
left
:
50%
;
margin-left
:
-
$popover-arrow-outer-width
;
border-top-width
:
0
;
border-bottom-color
:
$popover-arrow-outer-color
;
&
:after
{
top
:
1px
;
margin-left
:
-
$popover-arrow-width
;
content
:
""
;
border-top-width
:
0
;
border-bottom-color
:
$popover-arrow-color
;
}
}
.popover-left
>
.popover-arrow
{
top
:
50%
;
right
:
-
$popover-arrow-outer-width
;
margin-top
:
-
$popover-arrow-outer-width
;
border-right-width
:
0
;
border-left-color
:
$popover-arrow-outer-color
;
&
:after
{
right
:
1px
;
bottom
:
-
$popover-arrow-width
;
content
:
""
;
border-right-width
:
0
;
border-left-color
:
$popover-arrow-color
;
}
}
This diff is collapsed.
Click to expand it.
scss/_tooltip.scss
+
53
-
45
View file @
dbaffd43
...
@@ -16,23 +16,59 @@
...
@@ -16,23 +16,59 @@
opacity
:
0
;
opacity
:
0
;
&
.in
{
opacity
:
$tooltip-opacity
;
}
&
.in
{
opacity
:
$tooltip-opacity
;
}
}
.tooltip-top
{
&
.tooltip-top
,
padding
:
$tooltip-arrow-width
0
;
&
.bs-tether-element-attached-bottom
{
margin-top
:
-3px
;
padding
:
$tooltip-arrow-width
0
;
}
margin-top
:
-3px
;
.tooltip-right
{
padding
:
0
$tooltip-arrow-width
;
.tooltip-arrow
{
margin-left
:
3px
;
bottom
:
0
;
}
left
:
50%
;
.tooltip-bottom
{
margin-left
:
-
$tooltip-arrow-width
;
padding
:
$tooltip-arrow-width
0
;
border-width
:
$tooltip-arrow-width
$tooltip-arrow-width
0
;
margin-top
:
3px
;
border-top-color
:
$tooltip-arrow-color
;
}
}
.tooltip-left
{
}
padding
:
0
$tooltip-arrow-width
;
&
.tooltip-right
,
margin-left
:
-3px
;
&
.bs-tether-element-attached-left
{
padding
:
0
$tooltip-arrow-width
;
margin-left
:
3px
;
.tooltip-arrow
{
top
:
50%
;
left
:
0
;
margin-top
:
-
$tooltip-arrow-width
;
border-width
:
$tooltip-arrow-width
$tooltip-arrow-width
$tooltip-arrow-width
0
;
border-right-color
:
$tooltip-arrow-color
;
}
}
&
.tooltip-bottom
,
&
.bs-tether-element-attached-top
{
padding
:
$tooltip-arrow-width
0
;
margin-top
:
3px
;
.tooltip-arrow
{
top
:
0
;
left
:
50%
;
margin-left
:
-
$tooltip-arrow-width
;
border-width
:
0
$tooltip-arrow-width
$tooltip-arrow-width
;
border-bottom-color
:
$tooltip-arrow-color
;
}
}
&
.tooltip-left
,
&
.bs-tether-element-attached-right
{
padding
:
0
$tooltip-arrow-width
;
margin-left
:
-3px
;
.tooltip-arrow
{
top
:
50%
;
right
:
0
;
margin-top
:
-
$tooltip-arrow-width
;
border-width
:
$tooltip-arrow-width
0
$tooltip-arrow-width
$tooltip-arrow-width
;
border-left-color
:
$tooltip-arrow-color
;
}
}
}
}
// Wrapper for the tooltip content
// Wrapper for the tooltip content
...
@@ -53,32 +89,4 @@
...
@@ -53,32 +89,4 @@
height
:
0
;
height
:
0
;
border-color
:
transparent
;
border-color
:
transparent
;
border-style
:
solid
;
border-style
:
solid
;
}
}
.tooltip-top
.tooltip-arrow
{
\ No newline at end of file
bottom
:
0
;
left
:
50%
;
margin-left
:
-
$tooltip-arrow-width
;
border-width
:
$tooltip-arrow-width
$tooltip-arrow-width
0
;
border-top-color
:
$tooltip-arrow-color
;
}
.tooltip-right
.tooltip-arrow
{
top
:
50%
;
left
:
0
;
margin-top
:
-
$tooltip-arrow-width
;
border-width
:
$tooltip-arrow-width
$tooltip-arrow-width
$tooltip-arrow-width
0
;
border-right-color
:
$tooltip-arrow-color
;
}
.tooltip-left
.tooltip-arrow
{
top
:
50%
;
right
:
0
;
margin-top
:
-
$tooltip-arrow-width
;
border-width
:
$tooltip-arrow-width
0
$tooltip-arrow-width
$tooltip-arrow-width
;
border-left-color
:
$tooltip-arrow-color
;
}
.tooltip-bottom
.tooltip-arrow
{
top
:
0
;
left
:
50%
;
margin-left
:
-
$tooltip-arrow-width
;
border-width
:
0
$tooltip-arrow-width
$tooltip-arrow-width
;
border-bottom-color
:
$tooltip-arrow-color
;
}
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
5
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment