1
0
mirror of https://github.com/monstra-cms/monstra.git synced 2025-07-31 18:30:20 +02:00

Filesmanager: image preview updates

This commit is contained in:
Awilum
2013-01-02 19:47:13 +02:00
parent 97c72c002a
commit 08e9e8a6b3
3 changed files with 39 additions and 20 deletions

View File

@@ -0,0 +1,32 @@
if (typeof $.monstra == 'undefined') $.monstra = {};
$.monstra.filesmanager = {
init: function() {
this.showImage();
},
showImage: function() {
$('.image').find('a').on('click', function() {
var src = $(this).attr('href');
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;
});
}
};
$(document).ready(function(){
$.monstra.filesmanager.init();
});