From fa7f3a80a777bf743bcc5d7b95bfd811a417651f Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 12 Nov 2010 11:36:10 +0100 Subject: [PATCH] Load texts for input fields only once. --- src/main/resources/static/javascript/sone.js | 12 ++---------- src/main/resources/templates/include/head.html | 10 +++++++--- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/main/resources/static/javascript/sone.js b/src/main/resources/static/javascript/sone.js index 7b971bb..01f13e3 100644 --- a/src/main/resources/static/javascript/sone.js +++ b/src/main/resources/static/javascript/sone.js @@ -11,11 +11,7 @@ function registerInputTextareaSwap(inputSelector, defaultText, inputFieldName, o $(this).hide(); inputField = $(this).data("inputField"); inputField.show().removeAttr("disabled").addClass("default"); - (function(inputField) { - getTranslation(defaultText, function(translation) { - inputField.val(translation); - }); - })(inputField); + inputField.val(defaultText); } }).hide().data("inputField", $(this)).val($(this).val()); $(this).after(textarea); @@ -26,11 +22,7 @@ function registerInputTextareaSwap(inputSelector, defaultText, inputFieldName, o }); if (inputField.val() == "") { inputField.addClass("default"); - (function(inputField) { - getTranslation(defaultText, function(translation) { - inputField.val(translation); - }); - })(inputField); + inputField.val(defaultText); } else { inputField.hide().attr("disabled", "disabled"); textarea.show(); diff --git a/src/main/resources/templates/include/head.html b/src/main/resources/templates/include/head.html index 9330e14..e6038d7 100644 --- a/src/main/resources/templates/include/head.html +++ b/src/main/resources/templates/include/head.html @@ -8,7 +8,9 @@ @@ -24,8 +26,10 @@ -- 2.7.4