Opened 12 years ago

Closed 11 years ago

#6081 closed defect (fixed)

Tooltip connectId should support one id/node

Reported by: Robert Coup Owned by: bill
Priority: high Milestone: 1.3
Component: Dijit Version: 1.0
Keywords: tooltip Cc:
Blocked By: Blocking:

Description (last modified by bill)

Came up on IRC:

  • works: <div dojoType="dijit.Tooltip" connectId="id1" ...>
  • works: <div dojoType="dijit.Tooltip" connectId="id1,id2" ...>
  • works: new dijit.Tooltip({connectId:["id1"], ...})
  • doesn't: new dijit.Tooltip({connectId:"id1", ...})

Considering its named and documented as connectId (not plural) it should probably work that way. Something like the attached would do the trick.

Attachments (1)

tooltip_connectId.patch (416 bytes) - added by Robert Coup 12 years ago.

Download all attachments as: .zip

Change History (6)

Changed 12 years ago by Robert Coup

Attachment: tooltip_connectId.patch added

comment:1 Changed 12 years ago by bill

This is from [10942]/#3429. I agree the name is confusing, and should have been changed to widgetIds. Although I don't like the precedent of supporting different signatures to the constructor. Will think about it.

comment:2 Changed 12 years ago by Robert Coup

Well, it can connect to any DOM node, not just a widget. connectIds would be better. Main thing is that it doesn't catch people out :)

The parser syntax for arrays is IMHO (and ptwobrussell's) a bit too magical and that confuses people, but that's a different issue.

comment:3 Changed 12 years ago by bill

Milestone: 1.3
Version: 1.0

Oops, I meant to say "connectIds" not "widgetIds"... just a typo. Ping me on IRC sometime and tell me how you think the parser should handle arrays.

comment:4 Changed 11 years ago by bill

Description: modified (diff)
Owner: set to bill
Status: newassigned

comment:5 Changed 11 years ago by bill

Resolution: fixed
Status: assignedclosed

(In [16565]) [10942] left the Tooltip API in a confusing state since it converted the connectId parameter (which sounds like a scalar) into an array. For back-compatibility and slightly less confusion, make programmatic instantiation and Tooltip.attr('connectId', ...) accept both arrays and scalars.

For 2.0 I want to just rename that connectId to connectIds, or convert it back to a scalar. (How often do we want a single tooltip for multiple nodes? It seems uncommon.)

Along the way I noticed that Tooltip.attr('connectId', ...) doesn't work correctly since it doesn't erase the old connections. Not sure that's worth supporting anyway though; it too seems quite uncommon.

Refs #3429, fixes #6081 !strict.

Note: See TracTickets for help on using tickets.