From 93aecb28830aa17faca60fa31ec234ecc25a4edb Mon Sep 17 00:00:00 2001 From: Robin Cornett Date: Mon, 20 Apr 2015 11:56:07 -0400 Subject: [PATCH] fix js (default) --- includes/js/settings-upload.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/includes/js/settings-upload.js b/includes/js/settings-upload.js index 721a5d0..fffc197 100644 --- a/includes/js/settings-upload.js +++ b/includes/js/settings-upload.js @@ -43,25 +43,22 @@ jQuery(document).ready(function($){ }); - $( '.delete_image' ).click( function(e) { + $( '.delete_image' ).click( function() { target_input = $(this).prevAll( '.upload_image_id' ); previewView = $(this).prevAll( '#upload_logo_preview' ); - e.preventDefault(); - $( target_input ).val( '' ); $( previewView ).remove(); }); - $( '#submit' ).click( function(e) { + $( '#submit' ).click( function() { submitButton = $(this).parentsUntil( '#addtag' ); previewView = submitButton.siblings( '.term-image-wrap' ).children( '#upload_logo_preview' ); clearInput = submitButton.siblings( '.term-image-wrap' ).children( '.upload_image_id' ); - e.preventDefault(); - if ( $( previewView ).length ) { + if ( $( previewView ).length && $( submitButton ).length ) { $( previewView ).delay( 1000 ).fadeOut( 200, function() { $(this).remove(); $( clearInput ).val( '' );