Commit 6762ec68 authored by Sindre Sorhus's avatar Sindre Sorhus

Site: Rewrite popover and cleanups

parent b129e3b7
This diff is collapsed.
...@@ -43,11 +43,6 @@ a:hover { ...@@ -43,11 +43,6 @@ a:hover {
color: #787e7e; color: #787e7e;
} }
.nav-tabs > li > a,
.nav-pills > li > a {
line-height: 20px;
}
p { p {
font-size: 15px; font-size: 15px;
line-height: 1.5; line-height: 1.5;
...@@ -110,8 +105,11 @@ header nav a:first-child { ...@@ -110,8 +105,11 @@ header nav a:first-child {
margin-bottom: 20px; margin-bottom: 20px;
} }
.applist a { .applist .row > div {
white-space: nowrap; white-space: nowrap;
}
.applist a {
position: relative; /* popover */ position: relative; /* popover */
} }
...@@ -123,24 +121,9 @@ header nav a:first-child { ...@@ -123,24 +121,9 @@ header nav a:first-child {
background-color: rgba(0, 0, 0, .2); background-color: rgba(0, 0, 0, .2);
} }
.applist .popover { .applist a:hover .label {
margin: 0; text-decoration: none !important;
cursor: default; color: red;
color: #333;
white-space: normal;
z-index: 999;
}
.applist .popover-title {
padding: 9px 70px 9px 15px;
}
.applist .popover-title a {
font-size: 13px;
line-height: 18px;
position: absolute;
top: 16px;
right: 20px;
} }
.applist.labs { .applist.labs {
...@@ -151,7 +134,13 @@ header nav a:first-child { ...@@ -151,7 +134,13 @@ header nav a:first-child {
columns: 3; columns: 3;
} }
.applist.labs {
list-style: none;
margin: 0;
}
.applist.labs li { .applist.labs li {
margin-bottom: 20px;
-webkit-column-break-inside: avoid; -webkit-column-break-inside: avoid;
-moz-column-break-inside: avoid; -moz-column-break-inside: avoid;
-ms-column-break-inside: avoid; -ms-column-break-inside: avoid;
...@@ -169,6 +158,26 @@ header nav a:first-child { ...@@ -169,6 +158,26 @@ header nav a:first-child {
margin-right: 5px; margin-right: 5px;
} }
.popover {
margin: 0;
cursor: default;
color: #333;
white-space: normal;
z-index: 999;
}
.popover-title {
padding: 9px 70px 9px 15px;
}
.popover-title a {
font-size: 13px;
line-height: 18px;
position: absolute;
top: 16px;
right: 20px;
}
.zocial.red { .zocial.red {
background-color: #a82400; background-color: #a82400;
} }
......
...@@ -2,26 +2,40 @@ ...@@ -2,26 +2,40 @@
(function() { (function() {
'use strict'; 'use strict';
// Apps popover $.fn.persistantPopover = function() {
function hover() { var popoverTimeout;
$( this ).popover('toggle');
}
$('.applist a').each(function() { function delay() {
var $this = $( this ); popoverTimeout = setTimeout(function() {
$this.popover({ $('.popover').hide();
placement: 'in right', }, 100);
animation: false,
title: $this[0].firstChild.textContent + '<a href="' + $this.data('source') + '">Go to site</a>'
});
})
.off()
.hoverIntent( hover, hover )
.on('click', '.popover', function( e ) {
// Prevent click on the popover, but allow links inside
if ( e.target.nodeName.toLowerCase() !== 'a' ) {
e.preventDefault();
} }
});
this.each(function() {
var $this = $( this );
$this.popover({
trigger: 'manual',
placement: 'right',
animation: false,
title: this.firstChild.textContent + '<a href="' + $this.data('source') + '">Website</a>'
});
})
.mouseenter(function() {
clearTimeout( popoverTimeout );
$('.popover').remove();
$( this ).popover('show');
})
.mouseleave(function() {
delay();
$('.popover').mouseenter(function() {
clearTimeout( popoverTimeout ) ;
}).mouseleave(function() {
delay();
});
});
};
// Apps popover
$('.applist a').persistantPopover();
}()); }());
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment