app/soc/content/js/tips-081027.js
author Sverre Rabbelier <srabbelier@gmail.com>
Mon, 13 Apr 2009 15:31:39 +0000
changeset 2177 e2c193e1f631
parent 2025 e44de18a2f5d
permissions -rw-r--r--
Do not rely on dicts.merge to change target Also make dicts.merge actually not touch target. This is much cleaner than modifying in place, especially since we assign the result of the dicts.merge call to target most of the time anyway. Patch by: Sverre Rabbelier
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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)',
2025
e44de18a2f5d Remove two trailing comma's
Sverre Rabbelier <srabbelier@gmail.com>
parents: 1018
diff changeset
    12
             positions: ['bottom', 'top', 'right']
1018
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