forked from GNUsocial/gnu-social
Updated JS to show/hide attachment thumbnails with timers. Minor
markup changes.
This commit is contained in:
parent
959dce823f
commit
3877324fd8
@ -71,16 +71,7 @@ class Attachment_thumbnailAction extends AttachmentAction
|
|||||||
if (empty($file_thumbnail->url)) {
|
if (empty($file_thumbnail->url)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
$url = $file_thumbnail->url;
|
$this->element('img', array('src' => $file_thumbnail->url, 'alt' => 'Thumbnail'));
|
||||||
|
|
||||||
$attr = array(
|
|
||||||
'id' => 'thumbnail'
|
|
||||||
, 'src' => $url
|
|
||||||
, 'alt' => 'Thumbnail'
|
|
||||||
);
|
|
||||||
|
|
||||||
$this->element('img', $attr);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
22
js/util.js
22
js/util.js
@ -18,18 +18,26 @@
|
|||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$('a.attachment').click(function() {$().jOverlay({url: $('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); return false; });
|
$('a.attachment').click(function() {$().jOverlay({url: $('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/ajax'}); return false; });
|
||||||
$('a.thumbnail').hover(
|
$("a.thumbnail").hover(
|
||||||
function() {
|
function() {
|
||||||
anchor = $(this);
|
var anchor = $(this);
|
||||||
$.get($('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) {
|
$("a.thumbnail").children('img').remove();
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
anchor.closest(".entry-title").addClass('ov');
|
||||||
|
$.get($('address .url')[0].href+'/attachment/' + (anchor.attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) {
|
||||||
anchor.append(data);
|
anchor.append(data);
|
||||||
$('#thumbnail').fadeIn('def');
|
|
||||||
});
|
});
|
||||||
|
}, 250);
|
||||||
|
|
||||||
|
setTimeout(function() {
|
||||||
|
anchor.children('img').remove();
|
||||||
|
anchor.closest(".entry-title").removeClass('ov');
|
||||||
|
}, 3000);
|
||||||
},
|
},
|
||||||
function() {
|
function() {
|
||||||
setTimeout(function() {
|
$(this).children('img').remove();
|
||||||
$('#thumbnail').fadeOut('slow', function() {$(this).remove();});
|
$(this).closest(".entry-title").removeClass('ov');
|
||||||
}, 500);
|
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -798,6 +798,9 @@ float:left;
|
|||||||
width:100%;
|
width:100%;
|
||||||
overflow:hidden;
|
overflow:hidden;
|
||||||
}
|
}
|
||||||
|
.notice .entry-title.ov {
|
||||||
|
overflow:visible;
|
||||||
|
}
|
||||||
#shownotice .notice .entry-title {
|
#shownotice .notice .entry-title {
|
||||||
font-size:2.2em;
|
font-size:2.2em;
|
||||||
}
|
}
|
||||||
@ -857,7 +860,7 @@ position:relative;
|
|||||||
}
|
}
|
||||||
.notice .attachment img {
|
.notice .attachment img {
|
||||||
position:absolute;
|
position:absolute;
|
||||||
top:11px;
|
top:18px;
|
||||||
left:0;
|
left:0;
|
||||||
z-index:99;
|
z-index:99;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user