public
Description: Prototype extensions that I find myself using frequently, or just ideas that I think would be fun.
Clone URL: git://github.com/nakajima/nakatype.git
added tool_tips.js and a functional test
nakajima (author)
Fri Jun 20 15:31:10 -0700 2008
commit  2dad2da5e051349f54ed374ddfdd6e032b7590ef
tree    1b939117067a23ddfee695748f2a350e18c2c58e
parent  a415ed183b503e973a5f77210713212811dd9363

Comments

  • kangax Fri Jun 20 16:33:40 -0700 2008 at src/tool_tips.js L32

    I would do:

    $w(‘show hide move fade appear observeMove’).each(function(name) {
    this.behaviors[name] = this[name].bind(this);
    }, this)

  • kangax Fri Jun 20 16:35:10 -0700 2008 at src/tool_tips.js L61

    It’s usually faster to call event.pointer() and then reuse its x/y properties (rather than calling method twice) : )

  • kangax Fri Jun 20 16:35:54 -0700 2008 at src/tool_tips.js L72

    Any reason to use bracket notation (over a more concise “dot” one) ?

  • kangax Fri Jun 20 16:37:55 -0700 2008 at src/tool_tips.js L26

    Pat, you just can’t stand $(document.body), can you? : )

  • kangax Fri Jun 20 16:38:57 -0700 2008 at src/tool_tips.js L90

    Maybe it would make sense to configure offset (“5”) via options?

  • nakajima Fri Jun 20 19:51:05 -0700 2008 at src/tool_tips.js L72

    I like to use the bracket notation when it’s clear that the object is more or less just a container for other things (similar to using a hash in Ruby). I use the dot notation when the property is more of an attribute of the object (I have a weird relationship with my code).

  • nakajima Fri Jun 20 20:02:31 -0700 2008 at src/tool_tips.js L26

    Haha, more like I can never remember it. Thanks again for the reminder. It’s been fixed in the most recent commit.