More popover simplification.
This commit is contained in:
Родитель
d2fa1feefc
Коммит
cb10289788
|
@ -917,60 +917,17 @@ input[type="button"] {
|
|||
}
|
||||
.popover:after {
|
||||
position: absolute;
|
||||
top: -19px;
|
||||
top: -15px;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-left: -20px;
|
||||
margin-left: -15px;
|
||||
content: '';
|
||||
border-right: 20px solid transparent;
|
||||
border-bottom: 20px solid rgba(247, 247, 247, 0.98);
|
||||
border-left: 20px solid transparent;
|
||||
border-right: 15px solid transparent;
|
||||
border-bottom: 15px solid rgba(247, 247, 247, 0.98);
|
||||
border-left: 15px solid transparent;
|
||||
}
|
||||
|
||||
.popover-header {
|
||||
display: -webkit-box;
|
||||
display: box;
|
||||
height: 34px;
|
||||
margin-bottom: 5px;
|
||||
box-shadow: 0 0 1px rgba(0, 0, 0, 0.85);
|
||||
}
|
||||
.popover-header .title {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 45px;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
}
|
||||
.popover-header [class*="button"] {
|
||||
z-index: 25;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: 29px;
|
||||
color: #007aff;
|
||||
border: 0;
|
||||
transition: opacity .2s linear;
|
||||
-webkit-box-flex: 0;
|
||||
box-flex: 0;
|
||||
}
|
||||
.popover-header .title + [class*="button"]:last-child,
|
||||
.popover-header .button + [class*="button"]:last-child,
|
||||
.popover-header [class*="button"].pull-right {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
}
|
||||
.popover-header .button:active {
|
||||
color: #007aff;
|
||||
background-color: transparent;
|
||||
opacity: .3;
|
||||
}
|
||||
.popover-header.visible {
|
||||
.popover.visible {
|
||||
opacity: 1;
|
||||
-webkit-transform: translate3d(0, 0, 0);
|
||||
transform: translate3d(0, 0, 0);
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
</script>
|
||||
|
||||
<style>
|
||||
[class*="bar"] {
|
||||
.content > [class*="bar"] {
|
||||
position: relative;
|
||||
}
|
||||
.slider,
|
||||
|
@ -34,6 +34,34 @@
|
|||
<!-- ontouchstart property makes :active/:hover behaviors work on everything -->
|
||||
<body class="body" ontouchstart="">
|
||||
|
||||
<!-- POPOVER ============================================================ -->
|
||||
<div id="myPopover" class="popover">
|
||||
<header class="bar-title">
|
||||
<a class="button" href="#">
|
||||
Open
|
||||
</a>
|
||||
<h3 class="title">Popover title</h3>
|
||||
<a class="button" href="#">
|
||||
Filter
|
||||
</a>
|
||||
</header>
|
||||
<div class="popover-content">
|
||||
<ul class="table-view">
|
||||
<li>Item1</li>
|
||||
<li>Item2</li>
|
||||
<li>Item3</li>
|
||||
<li class="table-view-divider">With counts</li>
|
||||
<li>Item1 <br> Item1.2 <br> Item1.3 <br> Item1.4 <span class="count">1</span></li>
|
||||
<li>Item2 <span class="count">1</span></li>
|
||||
<li>Item3 <span class="count">1</span></li>
|
||||
<li class="table-view-divider">With chevrons</li>
|
||||
<li>Item1 <br> Item1.2 <br> Item1.3 <br> Item1.4 <span class="chevron"></span></li>
|
||||
<li>Item2 <span class="chevron"></span></li>
|
||||
<li>Item3 <span class="chevron"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
|
||||
<header class="bar-title">
|
||||
|
@ -68,32 +96,6 @@
|
|||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- POPOVER ============================================================ -->
|
||||
<div id="myPopover" class="popover">
|
||||
<header class="popover-header">
|
||||
<a class="button" href="#">
|
||||
Open
|
||||
</a>
|
||||
<h3 class="title">Popover title</h3>
|
||||
<a class="button" href="#">
|
||||
Filter
|
||||
</a>
|
||||
</header>
|
||||
<ul class="table-view">
|
||||
<li>Item1</li>
|
||||
<li>Item2</li>
|
||||
<li>Item3</li>
|
||||
<li class="table-view-divider">With counts</li>
|
||||
<li>Item1 <br> Item1.2 <br> Item1.3 <br> Item1.4 <span class="count">1</span></li>
|
||||
<li>Item2 <span class="count">1</span></li>
|
||||
<li>Item3 <span class="count">1</span></li>
|
||||
<li class="table-view-divider">With chevrons</li>
|
||||
<li>Item1 <br> Item1.2 <br> Item1.3 <br> Item1.4 <span class="chevron"></span></li>
|
||||
<li>Item2 <span class="chevron"></span></li>
|
||||
<li>Item3 <span class="chevron"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!-- TITLEBAR ============================================================ -->
|
||||
|
||||
<!-- Title-bar left and right buttons -->
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
<style>
|
||||
|
||||
[class*="bar"] {
|
||||
.content > [class*="bar"] {
|
||||
position: relative;
|
||||
}
|
||||
.slider,
|
||||
|
@ -36,7 +36,7 @@
|
|||
|
||||
<!-- POPOVER ============================================================ -->
|
||||
<div id="myPopover" class="popover">
|
||||
<header class="popover-header">
|
||||
<header class="bar-title">
|
||||
<a class="button" href="#">
|
||||
Open
|
||||
</a>
|
||||
|
@ -45,19 +45,21 @@
|
|||
Filter
|
||||
</a>
|
||||
</header>
|
||||
<ul class="table-view">
|
||||
<li>Item1</li>
|
||||
<li>Item2</li>
|
||||
<li>Item3</li>
|
||||
<li class="table-view-divider">With counts</li>
|
||||
<li>Item1 <br> Item1.2 <br> Item1.3 <br> Item1.4 <span class="count">1</span></li>
|
||||
<li>Item2 <span class="count">1</span></li>
|
||||
<li>Item3 <span class="count">1</span></li>
|
||||
<li class="table-view-divider">With chevrons</li>
|
||||
<li>Item1 <br> Item1.2 <br> Item1.3 <br> Item1.4 <span class="chevron"></span></li>
|
||||
<li>Item2 <span class="chevron"></span></li>
|
||||
<li>Item3 <span class="chevron"></span></li>
|
||||
</ul>
|
||||
<div class="popover-content">
|
||||
<ul class="table-view">
|
||||
<li>Item1</li>
|
||||
<li>Item2</li>
|
||||
<li>Item3</li>
|
||||
<li class="table-view-divider">With counts</li>
|
||||
<li>Item1 <br> Item1.2 <br> Item1.3 <br> Item1.4 <span class="count">1</span></li>
|
||||
<li>Item2 <span class="count">1</span></li>
|
||||
<li>Item3 <span class="count">1</span></li>
|
||||
<li class="table-view-divider">With chevrons</li>
|
||||
<li>Item1 <br> Item1.2 <br> Item1.3 <br> Item1.4 <span class="chevron"></span></li>
|
||||
<li>Item2 <span class="chevron"></span></li>
|
||||
<li>Item3 <span class="chevron"></span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content">
|
||||
|
|
|
@ -22,68 +22,15 @@
|
|||
// Caret on top of popover using CSS triangles (thanks to @chriscoyier for solution)
|
||||
&:after {
|
||||
position: absolute;
|
||||
top: -19px;
|
||||
top: -15px;
|
||||
left: 50%;
|
||||
width: 0;
|
||||
height: 0;
|
||||
margin-left: -20px;
|
||||
margin-left: -15px;
|
||||
content: '';
|
||||
border-right: 20px solid transparent;
|
||||
border-bottom: 20px solid $chrome-color;
|
||||
border-left: 20px solid transparent;
|
||||
}
|
||||
}
|
||||
|
||||
// Wrapper for a title and buttons
|
||||
.popover-header {
|
||||
display: -webkit-box;
|
||||
display: box;
|
||||
height: 34px;
|
||||
margin-bottom: 5px;
|
||||
box-shadow: 0 0 1px rgba(0,0,0,.85);
|
||||
|
||||
// Centered title for popover
|
||||
.title {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
display: block;
|
||||
width: 100%;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
line-height: 45px;
|
||||
color: #000;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
// Generic style for all buttons in .popover-header
|
||||
[class*="button"] {
|
||||
z-index: 25;
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
line-height: 29px;
|
||||
color: $primary-color;
|
||||
border: 0;
|
||||
transition: opacity .2s linear;
|
||||
-webkit-box-flex: 0;
|
||||
box-flex: 0;
|
||||
}
|
||||
|
||||
// Hacky way to right align buttons outside of flex-box system
|
||||
// Note: is only absolutely positioned button, would be better if flex-box had an "align right" option
|
||||
.title + [class*="button"]:last-child,
|
||||
.button + [class*="button"]:last-child,
|
||||
[class*="button"].pull-right {
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 5px;
|
||||
}
|
||||
|
||||
// Active state for popover header buttons
|
||||
.button:active {
|
||||
color: $primary-color;
|
||||
background-color: transparent;
|
||||
opacity: .3;
|
||||
border-right: 15px solid transparent;
|
||||
border-bottom: 15px solid $chrome-color;
|
||||
border-left: 15px solid transparent;
|
||||
}
|
||||
|
||||
// Popover animation
|
||||
|
|
Загрузка…
Ссылка в новой задаче