X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fipsilon.git;a=blobdiff_plain;f=templates%2Fadmin%2Foption_config.html;fp=templates%2Fadmin%2Foption_config.html;h=14326fd311c351ed6b06e75382157d85e05e7ada;hp=02babe6bbe9139ff886e7b791321623c93c2e7f9;hb=cae2c6d2b98b2981458e06f3700d0e0d27e1a2dc;hpb=a8994fbcbe824b784c6ccefb1acc2cf8d268b90e diff --git a/templates/admin/option_config.html b/templates/admin/option_config.html index 02babe6..14326fd 100644 --- a/templates/admin/option_config.html +++ b/templates/admin/option_config.html @@ -38,7 +38,13 @@ var reader = new FileReader(); // instance of the FileReader reader.readAsDataURL(files[0]); // read the local file - reader.onloadend = function(){ // set image data as background of div + reader.onloadend = function(e){ // set image data as background of div + var contents = e.target.result; + if (!contents) { + window.alert('Image file is unreadable') + document.getElementById('uploadFile').value = null; + } + $("#imagePreview").css("background-image", "url("+this.result+")"); } }