From 2bb49b8032962ba042c2b83ed913a52b1deca29f Mon Sep 17 00:00:00 2001 From: Erik Brakkee Date: Sat, 28 Aug 2010 19:33:29 +0000 Subject: [PATCH] --- .../wicket/behavior/wamblee-preselect.js | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-preselect.js b/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-preselect.js index c2caa7b8..a53e0dea 100644 --- a/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-preselect.js +++ b/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-preselect.js @@ -1,13 +1,15 @@ -org.wamblee.preselectSetup = function(id) { - var preselect = function(elem) { - if (elem.defaultValue == elem.value) { - elem.select(); - } - }; - // Add focus listeners. - $(id).find(":text, textarea").each(function() { - $(this).focus(function() { - preselect(this); - }); - }) -} \ No newline at end of file +(function($) { + org.wamblee.preselectionSetup = function(id) { + var preselect = function(elem) { + if (elem.defaultValue == elem.value) { + elem.select(); + } + }; + // Add focus listeners. + $(id).find(":text, textarea").each(function() { + $(this).focus(function() { + preselect(this); + }); + }) + } +})(jQuery); -- 2.31.1