on hover, display absolute time
This commit is contained in:
@@ -431,7 +431,7 @@ function getPost(asPost) {
|
||||
$Post
|
||||
.append($('<div>', {'class':'header'})
|
||||
.append($('<span>', {'class':'index'}).addIcon('fa-'+asPost.type))
|
||||
.append($('<span>', {'class':'time', 'title':sAbsTime+self.tmp('site_tz_notice')}).text(sRelTime)))
|
||||
.append($('<span>', {'class':'time'}).hoverSwap(sRelTime, sAbsTime+self.tmp('site_tz_notice'))))
|
||||
.append($('<div>', {'class':'body'}).append($Body));
|
||||
|
||||
if(asPost.displayed_id) $Post.find('.index').append(' '+asPost.displayed_id);
|
||||
|
||||
@@ -268,3 +268,22 @@ $.prototype.cascadingDown = function(sDuration)
|
||||
{
|
||||
return $(this).slideDown(sDuration, function(){$(this).next().cascadingDown(sDuration);});
|
||||
};
|
||||
|
||||
$.prototype.hoverSwap = function(sDefault, sHover)
|
||||
{
|
||||
return $(this)
|
||||
.data('default', sDefault)
|
||||
.data('hover', sHover)
|
||||
.hover(function(){
|
||||
var $This = $(this),
|
||||
sHover = $This.data('hover');
|
||||
sDefault = $This.data('default');
|
||||
|
||||
if(sDefault!='' && sHover != '') {
|
||||
$This.fadeOut('fast', () => {
|
||||
$This.text((sDefault==$This.text())?sHover:sDefault).fadeIn('fast');
|
||||
});
|
||||
}
|
||||
})
|
||||
.text(sDefault);
|
||||
};
|
||||
|
||||
@@ -201,18 +201,23 @@
|
||||
font-style: italic;
|
||||
}
|
||||
.header {
|
||||
padding: 0.5em 1em;
|
||||
font-style: italic;
|
||||
font-size: 0.8em;
|
||||
text-align: right;
|
||||
|
||||
.index {
|
||||
float: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.time {
|
||||
span {
|
||||
padding: 0.5em 1em;
|
||||
display: inline-block;
|
||||
width: calc(50% - 2em);
|
||||
cursor: default;
|
||||
|
||||
&.index {
|
||||
float: left;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
&.time {
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
}
|
||||
.body {
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user