diff --git a/js/functions.js b/js/functions.js index e64791a6d9..1aa0010e6f 100644 --- a/js/functions.js +++ b/js/functions.js @@ -757,6 +757,8 @@ function insertQuery(queryType) { query = "UPDATE `" + table + "` SET " + editDis + " WHERE 1"; } else if(queryType == "delete") { query = "DELETE FROM `" + table + "` WHERE 1"; + } else if(queryType == "clear") { + query = ""; } document.sqlform.sql_query.value = query; sql_box_locked = false; @@ -1147,11 +1149,7 @@ $(document).ready(function(){ }); $('.sqlbutton').click(function(evt){ - if (evt.target.id == 'clear') { - $('#sqlquery').val(''); - } else { - insertQuery(evt.target.id); - } + insertQuery(evt.target.id); return false; });