]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Updated JS to show/hide attachment thumbnails with timers. Minor
authorSarven Capadisli <csarven@controlyourself.ca>
Mon, 25 May 2009 21:30:57 +0000 (17:30 -0400)
committerSarven Capadisli <csarven@controlyourself.ca>
Mon, 25 May 2009 21:30:57 +0000 (17:30 -0400)
markup changes.

actions/attachment_thumbnail.php
js/util.js
theme/base/css/display.css

index 32fab13242bc5b6624c8edd27915ca08bf60a0fd..b4070e747b78ff6dd58ea3c7876a0140f793ae80 100644 (file)
@@ -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'));
     }
 
     /**
index cba6f822ebf86f4e79df91f799f28a70ed5ec204..b1b6ec82bd93e21d268aa3129f33d5f617dc2780 100644 (file)
 
 $(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');
         }
     );
 
index aa76910f0b4ea899801ea9514ea4f29df8a71856..9bc1417b170954bb38273b0bd13bf87fecdff706 100644 (file)
@@ -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;
 }