(no commit message)
[utils] / wicket / components / src / main / resources / org / wamblee / wicket / behavior / wamblee-preselect.js
1 (function($) {
2         org.wamblee.preselectionSetup = function(id) {
3                 var preselect = function(elem) {
4                         if (elem.defaultValue == elem.value) {
5                                 elem.select();
6                         }
7                 };
8                 // Add focus listeners.
9                 $(id).find(":text, textarea").each(function() {
10                         $(this).focus(function() {
11                                 preselect(this);
12                         });
13                 })
14         }
15 })(jQuery);