##// END OF EJS Templates
"up" button will be visible always, not only at the page bottom
"up" button will be visible always, not only at the page bottom

File last commit:

r970:579d6b3a default
r974:a0151a6e default
Show More
form.js
21 lines | 640 B | application/javascript | JavascriptLexer
var isCompact = false;
$('input[name=image]').wrap($('<div class="file_wrap"></div>'));
$('body').on('change', 'input[name=image]', function(event) {
var file = event.target.files[0];
if(file.type.match('image.*')) {
var fileReader = new FileReader();
fileReader.addEventListener("load", function(event) {
var wrapper = $('.file_wrap');
wrapper.find('.file-thumb').remove();
wrapper.append(
$('<div class="file-thumb" style="background-image: url('+event.target.result+')"></div>')
);
});
fileReader.readAsDataURL(file);
}
});