Skip to content

Commit

Permalink
feat(/): add live image preview when user hovers the image file name …
Browse files Browse the repository at this point in the history
…(only when the number of files in current folder less than 500 files) (#244)

Co-authored-by: Prasath Mani <[email protected]>
  • Loading branch information
daubac402 and prasathmani committed Jan 14, 2020
1 parent 4905e5c commit 0319b7b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tinyfilemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1870,9 +1870,12 @@ class="edit-file"><i class="fa fa-pencil-square-o"></i> <?php echo lng('Advanced
<label class="custom-control-label" for="<?php echo $ik ?>"></label>
</div>
</td><?php endif; ?>
<td>
<td class="file-name-col">
<div class="filename"><a href="<?php echo $filelink ?>" title="File info"><i class="<?php echo $img ?>"></i> <?php echo fm_convert_win($f) ?>
</a><?php echo($is_link ? ' &rarr; <i>' . readlink($path . '/' . $f) . '</i>' : '') ?></div>
<?php if ($num_files < 500 && in_array(strtolower(pathinfo($f, PATHINFO_EXTENSION)), array('gif', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg'))): ?>
<img src="<?php echo fm_enc(FM_ROOT_URL . (FM_PATH != '' ? '/' . FM_PATH : '') . '/' . $f) ?>" alt="" class="live-preview-img">
<?php endif; ?>
</td>
<td><span title="<?php printf('%s bytes', $filesize_raw) ?>">
<?php echo $filesize; ?>
Expand Down

0 comments on commit 0319b7b

Please sign in to comment.