Skip to content

Commit

Permalink
[#1583][s]: Tweaking hover-for-help mechanism.
Browse files Browse the repository at this point in the history
  • Loading branch information
teajaymars committed Jan 24, 2012
1 parent 69f0bd1 commit aded321
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ckan/lib/helpers.py
Expand Up @@ -343,7 +343,7 @@ def resource_star_rating(resource_dict):
out = ""
if stars==0:
message = _('When we last checked, this resource was not available.');
out = literal('<a href="#" class="mouseover-help-link error-hint" data="%s">404?</a>' % message)
out = literal('<span class="hover-for-help error-hint" data="%s">404?</span>' % message)
else:
for n in range(stars):
out += icon('star')
Expand Down
12 changes: 6 additions & 6 deletions ckan/public/css/style.css
Expand Up @@ -207,14 +207,14 @@ tbody tr.table-empty td {
font-size: 2.2em;
font-weight: normal;
}
.mouseover-help-link {
border-bottom: 1px dashed #bb2222;
.hover-for-help {
border-bottom: 1px dashed #000;
position: relative;
}
.mouseover-help-link:hover {
border-bottom: 1px dashed #183661;
.hover-for-help.no-underline {
border-bottom: none;
}
.mouseover-help-link .inner {
.hover-for-help > .inner {
position: absolute;
top: 18px;
left: -30px;
Expand All @@ -227,7 +227,7 @@ tbody tr.table-empty td {
z-index: 3;
color: #fff;
}
.mouseover-help-link:hover .inner {
.hover-for-help:hover > .inner {
display: block;
}

Expand Down
5 changes: 2 additions & 3 deletions ckan/public/scripts/application.js
Expand Up @@ -8,7 +8,7 @@
CKAN.Utils.setupFormatAutocomplete($(this));
});
CKAN.Utils.setupMarkdownEditor($('.markdown-editor'));
CKAN.Utils.setupMouseoverHelpLinks($('.mouseover-help-link'));
CKAN.Utils.setupHoverForHelp($('.hover-for-help'));

// set up ckan js
var config = {
Expand Down Expand Up @@ -429,10 +429,9 @@ CKAN.Utils = function($, my) {
});
};

my.setupMouseoverHelpLinks = function(links) {
my.setupHoverForHelp = function(links) {
$.each(links, function(n,link) {
link = $(link);
link.click(function() { return false; });
var div = $('<div />');
div.html(link.attr('data'));
div.addClass('inner');
Expand Down

0 comments on commit aded321

Please sign in to comment.