show fileactions inline on hover
This commit is contained in:
parent
aa335f57d6
commit
d9a79c0f7e
|
@ -45,7 +45,7 @@ div.jp-interface {
|
||||||
z-index:100;
|
z-index:100;
|
||||||
width:25em;
|
width:25em;
|
||||||
left:201px;
|
left:201px;
|
||||||
top:-10px;
|
top:-20px;
|
||||||
}
|
}
|
||||||
div.jp-type-playlist{
|
div.jp-type-playlist{
|
||||||
width:100%;
|
width:100%;
|
||||||
|
|
|
@ -2,22 +2,17 @@
|
||||||
|
|
||||||
#file_menu
|
#file_menu
|
||||||
{
|
{
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
right:0px;
|
right:0px;
|
||||||
background-color: #EEE;
|
position:absolute;
|
||||||
|
top:0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#file_menu ul
|
#file_menu a
|
||||||
{
|
{
|
||||||
list-style-type: none;
|
display:block;
|
||||||
}
|
float:left;
|
||||||
|
background-image:none;
|
||||||
#file_menu li a
|
text-decoration: none;
|
||||||
{
|
|
||||||
display: block;
|
|
||||||
padding: 0.5em 5em 0.5em 2em;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.file_upload_form, #file_newfolder_form {
|
.file_upload_form, #file_newfolder_form {
|
||||||
|
@ -36,12 +31,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.file_upload_filename {
|
.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_upload_start {opacity:0;filter: alpha(opacity = 0);}
|
||||||
|
|
||||||
#file_newfolder_name {
|
#file_newfolder_name {
|
||||||
background-image:url(../img/folder.png); font-weight:bold;
|
background-image:url("../img/folder.png"); font-weight:bold;
|
||||||
width: 14em;
|
width: 14em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,11 +97,8 @@ table td.selection, table th.selection, table td.fileaction
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
table td.filename a
|
td.filename{
|
||||||
{
|
position:relative;
|
||||||
display: block;
|
|
||||||
background-image: url(../img/file.png);
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.dropArrow{
|
.dropArrow{
|
||||||
|
|
|
@ -49,33 +49,39 @@ FileActions={
|
||||||
return actions[name];
|
return actions[name];
|
||||||
},
|
},
|
||||||
display:function(parent){
|
display:function(parent){
|
||||||
$('#file_menu ul').empty();
|
$('#file_menu').empty();
|
||||||
parent.append($('#file_menu'));
|
parent.append($('#file_menu'));
|
||||||
var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
|
var actions=FileActions.get(FileActions.getCurrentMimeType(),FileActions.getCurrentType());
|
||||||
for(name in actions){
|
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);
|
var element=$(html);
|
||||||
element.data('action',name);
|
element.data('action',name);
|
||||||
element.click(function(event){
|
element.click(function(event){
|
||||||
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$('#file_menu').slideToggle(250);
|
|
||||||
var action=actions[$(this).data('action')];
|
var action=actions[$(this).data('action')];
|
||||||
$('#file_menu ul').empty();
|
var currentFile=FileActions.getCurrentFile();
|
||||||
action(FileActions.getCurrentFile());
|
FileActions.hide();
|
||||||
|
action(currentFile);
|
||||||
});
|
});
|
||||||
$('#file_menu>ul').append(element);
|
$('#file_menu').append(element);
|
||||||
}
|
}
|
||||||
$('#file_menu').slideToggle(250);
|
$('#file_menu').show();
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
hide:function(){
|
||||||
|
$('#file_menu').hide();
|
||||||
|
$('#file_menu').empty();
|
||||||
|
$('body').append($('#file_menu'));
|
||||||
|
},
|
||||||
getCurrentFile:function(){
|
getCurrentFile:function(){
|
||||||
return $('#file_menu').parents('tr:first').attr('data-file');
|
return $('#file_menu').parent().parent().attr('data-file');
|
||||||
},
|
},
|
||||||
getCurrentMimeType:function(){
|
getCurrentMimeType:function(){
|
||||||
return $('#file_menu').parents('tr:first').attr('data-mime');
|
return $('#file_menu').parent().parent().attr('data-mime');
|
||||||
},
|
},
|
||||||
getCurrentType:function(){
|
getCurrentType:function(){
|
||||||
return $('#file_menu').parents('tr:first').attr('data-type');
|
return $('#file_menu').parent().parent().attr('data-type');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,9 +31,11 @@ $(document).ready(function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Sets the file-action buttons behaviour :
|
// Sets the file-action buttons behaviour :
|
||||||
$('td.fileaction a').live('click',function(event) {
|
$('tr').live('mouseenter',function(event) {
|
||||||
event.preventDefault();
|
FileActions.display($(this).children('td.filename'));
|
||||||
FileActions.display($(this).parent());
|
});
|
||||||
|
$('tr').live('mouseleave',function(event) {
|
||||||
|
FileActions.hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Sets the file link behaviour :
|
// Sets the file link behaviour :
|
||||||
|
|
|
@ -43,7 +43,4 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div id="file_menu">
|
<span id="file_menu"/>
|
||||||
<ul>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
Loading…
Reference in New Issue