(no commit message)
authorErik Brakkee <erik@brakkee.org>
Sat, 28 Aug 2010 19:01:02 +0000 (19:01 +0000)
committerErik Brakkee <erik@brakkee.org>
Sat, 28 Aug 2010 19:01:02 +0000 (19:01 +0000)
wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-namespace.js [new file with mode: 0644]
wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-preselect.js [new file with mode: 0644]

diff --git a/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-namespace.js b/wicket/components/src/main/resources/org/wamblee/wicket/behavior/wamblee-namespace.js
new file mode 100644 (file)
index 0000000..08911fd
--- /dev/null
@@ -0,0 +1,4 @@
+
+
+var org = org || {};
+org.wamblee = org.wamblee || {};
\ No newline at end of file
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
new file mode 100644 (file)
index 0000000..c2caa7b
--- /dev/null
@@ -0,0 +1,13 @@
+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