fixed upload button

This commit is contained in:
Dawid Opis 2011-08-11 22:22:32 +02:00
parent 8aac43c12b
commit 9683d44633
4 changed files with 11 additions and 1 deletions

2
.gitignore vendored
View File

@ -24,4 +24,6 @@ RCS/*
# Lokalize # Lokalize
*lokalize* *lokalize*
# eclipse
.project .project
.settings

View File

@ -11,6 +11,7 @@
#fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; } #fileSelector, #file_upload_submit, #file_newfolder_submit { display:none; }
.file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .3em; padding-left:2em; } .file_upload_wrapper, #file_newfolder_name { background-repeat:no-repeat; background-position:.5em .3em; padding-left:2em; }
.file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin-right:1.5em;} .file_upload_wrapper { font-weight:bold; display:-moz-inline-box; /* fallback for older firefox versions*/ display:inline-block; padding-left:0; overflow:hidden; position:relative; margin-right:1.5em;}
.file_upload_wrapper #file_upload_button_wrapper { position:absolute; top:0; left:0; width:100%; height:100%; cursor:pointer; z-index:1000; }
#file_newfolder_name { background-image:url('../../core/img/places/folder.svg'); font-weight:bold; width:8em; } #file_newfolder_name { background-image:url('../../core/img/places/folder.svg'); font-weight:bold; width:8em; }
.file_upload_start, .file_upload_filename { font-size:1em; } .file_upload_start, .file_upload_filename { font-size:1em; }

View File

@ -12,6 +12,12 @@ $(document).ready(function() {
$('#plugins>ul>li:first-child').data('dir',''); $('#plugins>ul>li:first-child').data('dir','');
$('#plugins>ul>li:first-child').droppable(crumbDropOptions); $('#plugins>ul>li:first-child').droppable(crumbDropOptions);
// Triggers invisible file input
$('#file_upload_button_wrapper').bind('click', function() {
$('#file_upload_start').trigger('click');
return false;
});
// Sets the file-action buttons behaviour : // Sets the file-action buttons behaviour :
$('tr').live('mouseenter',function(event) { $('tr').live('mouseenter',function(event) {
FileActions.display($(this).children('td.filename')); FileActions.display($(this).children('td.filename'));

View File

@ -7,7 +7,8 @@
<input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir"> <input type="hidden" name="dir" value="<?php echo $_['dir'] ?>" id="dir">
<div class="file_upload_wrapper"> <div class="file_upload_wrapper">
<input type="submit" class="file_upload_filename" value="<?php echo $l->t('Upload');?> (max. <?php echo $_['uploadMaxHumanFilesize'];?>)"/> <input type="submit" class="file_upload_filename" value="<?php echo $l->t('Upload');?> (max. <?php echo $_['uploadMaxHumanFilesize'];?>)"/>
<input class="file_upload_start" type="file" name='files[]'/> <input id="file_upload_start" class="file_upload_start" type="file" name='files[]'/>
<a href="#" id="file_upload_button_wrapper" onclick="return false;"></a>
</div> </div>
<iframe name="file_upload_target_1" class='file_upload_target' src=""></iframe> <iframe name="file_upload_target_1" class='file_upload_target' src=""></iframe>
</form> </form>