]> source.dussan.org Git - nextcloud-server.git/commitdiff
show fileactions inline on hover
authorRobin Appelman <icewind1991@gmail.com>
Thu, 21 Jul 2011 22:18:41 +0000 (00:18 +0200)
committerRobin Appelman <icewind1991@gmail.com>
Thu, 21 Jul 2011 22:18:41 +0000 (00:18 +0200)
apps/media/css/jplayer.css
files/css/files.css
files/js/fileactions.js
files/js/files.js
files/templates/index.php

index c47d20c72283ea35eb0c9decf37e2e4d2be418a5..4fd178823919f4bd7aba5413fb5f2328fd39d338 100644 (file)
@@ -45,7 +45,7 @@ div.jp-interface {
        z-index:100;
        width:25em;
        left:201px;
-       top:-10px;
+       top:-20px;
 }
 div.jp-type-playlist{
        width:100%;
index e0b06ea0cb5d48c77b22db0491d999e55d6e0119..a886958f13714ac2d94d6b23252a26f0be342ba0 100644 (file)
@@ -2,22 +2,17 @@
 
 #file_menu
 {
-    display: none;
-    position: absolute;
        right:0px;
-    background-color: #EEE;
-}
-
-#file_menu ul
-{
-    list-style-type: none;
+       position:absolute;
+       top:0;
 }
 
-#file_menu li a
+#file_menu a
 {
-    display: block;
-    padding: 0.5em 5em 0.5em 2em;
-    text-decoration: none;
+       display:block;
+       float:left;
+       background-image:none;
+       text-decoration: none;
 }
 
 .file_upload_form, #file_newfolder_form {
 }
 
 .file_upload_filename {
-       background-image:url(../img/file.png); font-weight:bold;
+       background-image:url("../img/file.png"); font-weight:bold;
 }
 .file_upload_start {opacity:0;filter: alpha(opacity = 0);}
 
 #file_newfolder_name {
-       background-image:url(../img/folder.png); font-weight:bold; 
+       background-image:url("../img/folder.png"); font-weight:bold;
        width: 14em;
 }
 
@@ -102,11 +97,8 @@ table td.selection, table th.selection, table td.fileaction
     text-align: center;
 }
 
-table td.filename a
-{
-    display: block;
-    background-image: url(../img/file.png);
-    text-decoration: none;
+td.filename{
+       position:relative;
 }
 
 .dropArrow{
index b683dc0cd3a46d4ba0dd6ff2fd4a179e27731652..3ad417c91c4a12ab6018c9579b6b2b750ea7747d 100644 (file)
@@ -49,33 +49,39 @@ FileActions={
                return actions[name];
        },
        display:function(parent){
-               $('#file_menu ul').empty();
+               $('#file_menu').empty();
                parent.append($('#file_menu'));
                var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
                for(name in actions){
-                       var html='<li><a href="" alt="'+name+'">'+name+'</a></li>';
+                       var html='<a href="#" alt="'+name+'">'+name+'</a>';
                        var element=$(html);
                        element.data('action',name);
                        element.click(function(event){
+                               event.stopPropagation();
                                event.preventDefault();
-                               $('#file_menu').slideToggle(250);
                                var action=actions[$(this).data('action')];
-                               $('#file_menu ul').empty();
-                               action(FileActions.getCurrentFile());
+                               var currentFile=FileActions.getCurrentFile();
+                               FileActions.hide();
+                               action(currentFile);
                        });
-                       $('#file_menu>ul').append(element);
+                       $('#file_menu').append(element);
                }
-               $('#file_menu').slideToggle(250);
+               $('#file_menu').show();
                return false;
        },
+       hide:function(){
+               $('#file_menu').hide();
+               $('#file_menu').empty();
+               $('body').append($('#file_menu'));
+       },
        getCurrentFile:function(){
-               return $('#file_menu').parents('tr:first').attr('data-file');
+               return $('#file_menu').parent().parent().attr('data-file');
        },
        getCurrentMimeType:function(){
-               return $('#file_menu').parents('tr:first').attr('data-mime');
+               return $('#file_menu').parent().parent().attr('data-mime');
        },
        getCurrentType:function(){
-               return $('#file_menu').parents('tr:first').attr('data-type');
+               return $('#file_menu').parent().parent().attr('data-type');
        }
 }
 
index b09702337395227f98abd66b8ddc0712c1937dac..f1c00650d0a233f744b6e08232ad7c92ccd1df89 100644 (file)
@@ -31,11 +31,13 @@ $(document).ready(function() {
        });
        
        // Sets the file-action buttons behaviour :
-       $('td.fileaction a').live('click',function(event) {
-               event.preventDefault();
-               FileActions.display($(this).parent());
+       $('tr').live('mouseenter',function(event) {
+               FileActions.display($(this).children('td.filename'));
        });
-       
+       $('tr').live('mouseleave',function(event) {
+               FileActions.hide();
+       });
+
        // Sets the file link behaviour :
        $('td.filename a').live('click',function(event) {
                event.preventDefault();
index 7cdb81b2d66cb937514cf718e722b7af9c96bc99..18b805529a93072eca62bca4b1a746ce74e90303 100644 (file)
@@ -43,7 +43,4 @@
        </tbody>
 </table>
 
-<div id="file_menu">
-       <ul>
-       </ul>
-</div>
+<span id="file_menu"/>