author | Lennard de Rijk <ljvderijk@gmail.com> |
Sun, 08 Mar 2009 13:14:28 +0000 | |
changeset 1741 | 0da1285f5bc0 |
parent 1018 | 02ffb446da6e |
child 2025 | e44de18a2f5d |
permissions | -rw-r--r-- |
426
114fe0f840c8
Add tooltips style display of help_text, instead of widening the form with
Todd Larsen <tlarsen@google.com>
parents:
diff
changeset
|
1 |
$(function() { |
1018
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
2 |
// Change 'title' to something else first |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
3 |
$('tr[title]').each(function() { |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
4 |
$(this).attr('xtitle', $(this).attr('title')).removeAttr('title'); |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
5 |
}) |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
6 |
.children().children(':input') |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
7 |
// Set up event handlers |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
8 |
.bt({trigger: ['helperon', 'helperoff'], |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
9 |
titleSelector: "parent().parent().attr('xtitle')", |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
10 |
killTitle: false, |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
11 |
fill: 'rgba(135, 206, 250, .9)', |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
12 |
positions: ['bottom', 'top', 'right'], |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
13 |
}) |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
14 |
.bind('focus', function() { |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
15 |
$(this).trigger('helperon'); |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
16 |
}) |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
17 |
.bind('blur', function() { |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
18 |
$(this).trigger('helperoff'); |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
19 |
}) |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
20 |
.parent() |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
21 |
.bind('mouseover', function() { |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
22 |
$(this).children(':input').trigger('helperon'); |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
23 |
}) |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
24 |
.bind('mouseleave', function() { |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
25 |
$(this).children(':input').trigger('helperoff'); |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
26 |
}); |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
27 |
}); |
02ffb446da6e
Make tooltips work when tabbing
Sverre Rabbelier <srabbelier@gmail.com>
parents:
426
diff
changeset
|
28 |