From 05f5ee8efe8510ce5744902f07d953c67c1c86cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 2 Jun 2011 14:55:11 +0200 Subject: [PATCH] Consistent handling of all SQL butttons --- js/functions.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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; });