mirror of
https://github.com/monstra-cms/monstra.git
synced 2025-08-02 19:27:52 +02:00
Filesmanager: Bootstrap Lightbox added instead of default Modal Dialog. #100
This commit is contained in:
@@ -8,21 +8,7 @@ $.monstra.filesmanager = {
|
|||||||
|
|
||||||
showImage: function() {
|
showImage: function() {
|
||||||
$('.image').find('a').on('click', function() {
|
$('.image').find('a').on('click', function() {
|
||||||
var src = $(this).attr('href');
|
$('#previewLightbox').lightbox('show').find('img').attr('src', $(this).attr('rel'));
|
||||||
var file = $(src.split('/')).last();
|
|
||||||
var image = new Image();
|
|
||||||
image.src = src;
|
|
||||||
$(image).load(function() {
|
|
||||||
$('#showImage')
|
|
||||||
.modal('show')
|
|
||||||
.css({"min-width": 632})
|
|
||||||
.find('img')
|
|
||||||
.attr('src', src);
|
|
||||||
$('#showImage').find('h3 span').text(file[0]);
|
|
||||||
$('#showImage').find('img').css({"max-width": 600});
|
|
||||||
$('#showImage').find('img').attr('alt', file[0]);
|
|
||||||
});
|
|
||||||
return false;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@@ -71,7 +71,11 @@
|
|||||||
<?php if ( ! in_array($ext, $forbidden_types)) { ?>
|
<?php if ( ! in_array($ext, $forbidden_types)) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td<?php if (isset(File::$mime_types[$ext]) && preg_match('/image/', File::$mime_types[$ext])) echo ' class="image"'?>>
|
<td<?php if (isset(File::$mime_types[$ext]) && preg_match('/image/', File::$mime_types[$ext])) echo ' class="image"'?>>
|
||||||
<?php echo Html::anchor(File::name($file), $site_url.'public/' . $path.$file, array('target'=>'_blank'));?>
|
<?php if (isset(File::$mime_types[$ext]) && preg_match('/image/', File::$mime_types[$ext])) { ?>
|
||||||
|
<?php echo Html::anchor(File::name($file), '#', array('rel' => $site_url.'public/' . $path.$file));?>
|
||||||
|
<?php } else { ?>
|
||||||
|
<?php echo Html::anchor(File::name($file), $site_url.'public/' . $path.$file, array('target'=>'_blank'));?>
|
||||||
|
<?php } ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="hidden-phone">
|
<td class="hidden-phone">
|
||||||
<?php echo $ext; ?>
|
<?php echo $ext; ?>
|
||||||
@@ -92,12 +96,11 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div id="showImage" class="modal hide fade">
|
<div id="previewLightbox" class="lightbox hide fade" tabindex="-1" role="dialog" aria-hidden="true">
|
||||||
<div class="modal-header">
|
<div class='lightbox-header'>
|
||||||
<a class="close" data-dismiss="modal">×</a>
|
<button type="button" class="close" data-dismiss="lightbox" aria-hidden="true">×</button>
|
||||||
<h3><?php echo __('Image:', 'filesmanager')?> <span></span></h3>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class='lightbox-content'>
|
||||||
<p align="center"><img /></p>
|
<img />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user