From 4855f70d88d8a06a91d72555ef909ed128470984 Mon Sep 17 00:00:00 2001 From: David Huynh Date: Thu, 11 Mar 2010 20:58:42 +0000 Subject: [PATCH] Fixed event wiring bug in index.html that prevented the project name validation from getting run, and prevented limit= and skip= params from getting sent to the server. git-svn-id: http://google-refine.googlecode.com/svn/trunk@278 7d457c2a-affb-35e4-300a-418c747d4874 --- src/main/webapp/scripts/index.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/webapp/scripts/index.js b/src/main/webapp/scripts/index.js index 4ae8ea4bb..1e018cd47 100644 --- a/src/main/webapp/scripts/index.js +++ b/src/main/webapp/scripts/index.js @@ -1,11 +1,10 @@ function onLoad() { - $("#upload-file-button").click(onClickUploadFileButton); - $.getJSON( "/command/get-all-project-metadata", null, function(data) { renderProjects(data); + $("#upload-file-button").click(onClickUploadFileButton); }, "json" ); @@ -13,7 +12,8 @@ function onLoad() { $(onLoad); function onClickUploadFileButton(evt) { - if ($("#project-name-input")[0].value.trim().length == 0) { + var projectName = $("#project-name-input")[0].value; + if ($.trim(projectName).length == 0) { window.alert("You must specify a project name."); evt.preventDefault(); @@ -86,8 +86,6 @@ function renderProjects(data) { for (var i = 0; i < projects.length; i++) { renderProject(projects[i]); } - - $(table).appendTo(container); } }