summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorPrateek Saxena <prtksxna@gmail.com>2016-04-22 21:49:01 +0530
committerPrateek Saxena <prtksxna@gmail.com>2016-04-22 21:49:01 +0530
commitef77497442308a9f9337b8ae2f61405b247e2188 (patch)
tree527d695aaefa06394f97746f934adb15b95b9809 /views
parent90442d1da1e07f411a31b330888067e00a77122d (diff)
Stop showing broken image icon on the new post page
Diffstat (limited to 'views')
-rw-r--r--views/new-post.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/views/new-post.php b/views/new-post.php
index 2c8c9f9..57b7521 100644
--- a/views/new-post.php
+++ b/views/new-post.php
@@ -133,12 +133,15 @@
<script>
function previewPhoto(event) {
- document.getElementById('photo_preview').src = URL.createObjectURL(event.target.files[0]);
+ $("#photo_preview")
+ .show()
+ .attr("src", URL.createObjectURL(event.target.files[0]) );
}
$(function(){
var userHasSetCategory = false;
+ $("#photo_preview").hide();
$("#note_content").on('change keyup', function(e){
var text = $("#note_content").val();
@@ -161,7 +164,7 @@ $(function(){
$("#note_in_reply_to").on('change', function(){
if(match=$("#note_in_reply_to").val().match(/twitter\.com\/([^\/]+)\/status/)) {
$("#note_content").val( "@"+match[1]+" "+$("#note_content").val() );
- }
+ }
});
$("#note_category").on('keydown keyup', function(){
@@ -196,7 +199,7 @@ $(function(){
var formData = new FormData();
if(v=$("#note_content").val()) {
- formData.append("content", v);
+ formData.append("content", v);
}
if(v=$("#note_in_reply_to").val()) {
formData.append("in-reply-to", v);