summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSarven Capadisli <csarven@controlyourself.ca>2009-05-25 17:30:57 -0400
committerSarven Capadisli <csarven@controlyourself.ca>2009-05-25 17:30:57 -0400
commit3877324fd8ddad36531fb80a5a2ae261015b9780 (patch)
tree28ad710ea6bde44e61dcf91cb029d37e9bf33db8
parent959dce823f105fa5bfbba42b6912b041085be325 (diff)
Updated JS to show/hide attachment thumbnails with timers. Minor
markup changes.
-rw-r--r--actions/attachment_thumbnail.php11
-rw-r--r--js/util.js26
-rw-r--r--theme/base/css/display.css5
3 files changed, 22 insertions, 20 deletions
diff --git a/actions/attachment_thumbnail.php b/actions/attachment_thumbnail.php
index 32fab1324..b4070e747 100644
--- a/actions/attachment_thumbnail.php
+++ b/actions/attachment_thumbnail.php
@@ -71,16 +71,7 @@ class Attachment_thumbnailAction extends AttachmentAction
if (empty($file_thumbnail->url)) {
return;
}
- $url = $file_thumbnail->url;
-
- $attr = array(
- 'id' => 'thumbnail'
- , 'src' => $url
- , 'alt' => 'Thumbnail'
- );
-
- $this->element('img', $attr);
-
+ $this->element('img', array('src' => $file_thumbnail->url, 'alt' => 'Thumbnail'));
}
/**
diff --git a/js/util.js b/js/util.js
index cba6f822e..b1b6ec82b 100644
--- a/js/util.js
+++ b/js/util.js
@@ -18,18 +18,26 @@
$(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.thumbnail').hover(
+ $("a.thumbnail").hover(
function() {
- anchor = $(this);
- $.get($('address .url')[0].href+'/attachment/' + ($(this).attr('id').substring('attachment'.length + 1)) + '/thumbnail', null, function(data) {
- anchor.append(data);
- $('#thumbnail').fadeIn('def');
- });
+ var anchor = $(this);
+ $("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);
+ });
+ }, 250);
+
+ setTimeout(function() {
+ anchor.children('img').remove();
+ anchor.closest(".entry-title").removeClass('ov');
+ }, 3000);
},
function() {
- setTimeout(function() {
- $('#thumbnail').fadeOut('slow', function() {$(this).remove();});
- }, 500);
+ $(this).children('img').remove();
+ $(this).closest(".entry-title").removeClass('ov');
}
);
diff --git a/theme/base/css/display.css b/theme/base/css/display.css
index aa76910f0..9bc1417b1 100644
--- a/theme/base/css/display.css
+++ b/theme/base/css/display.css
@@ -798,6 +798,9 @@ float:left;
width:100%;
overflow:hidden;
}
+.notice .entry-title.ov {
+overflow:visible;
+}
#shownotice .notice .entry-title {
font-size:2.2em;
}
@@ -857,7 +860,7 @@ position:relative;
}
.notice .attachment img {
position:absolute;
-top:11px;
+top:18px;
left:0;
z-index:99;
}