Changeset 7786
- Timestamp:
- 03/25/07 17:51:55 (22 months ago)
- Location:
- dijit/trunk
- Files:
-
- 1 added
- 3 modified
-
templates/Tooltip.html (added)
-
tests/test_Tooltip.html (modified) (1 diff)
-
themes/tundra/tundra.css (modified) (1 diff)
-
Tooltip.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dijit/trunk/tests/test_Tooltip.html
r7562 r7786 20 20 21 21 /* override tooltip style for this page */ 22 body .dojoTooltip { color: blue; border: solid 2px blue; padding: 4px; } 23 22 23 body .dojoTooltipContainer { color: blue; border: solid 2px blue; padding: 4px; } 24 body .dojoTooltip .dojoTooltipConnector { border-bottom-color: blue; } 25 24 26 /* and then have some tooltips that look different than the others (just for testing) */ 25 27 body .waves { color: red; font-style: italic; background: url(images/2.jpg) top right; border: red 3px dotted;} -
dijit/trunk/themes/tundra/tundra.css
r7686 r7786 399 399 400 400 .dojoTooltip { 401 border: solid black 1px; 402 background: beige; 401 position: absolute; 402 z-index: 10; 403 display: block; 404 margin-top: 10px; 405 border: red; 406 /* todo: make visible but off screen */ 407 } 408 409 .dojoTooltipContainer { 410 border: solid black 2px; 411 background: #b8b5b5; 403 412 color: black; 404 position: absolute;405 413 font-size: small; 406 414 padding: 2px 2px 2px 2px; 407 z-index: 10; 408 display: block; 415 } 416 417 .dojoTooltipConnector { 418 /* the border on the triangle */ 419 font-size: 0px; line-height: 0%; width: 0px; 420 position: absolute; 421 border-top: none; 422 border-bottom: 14px solid black; 423 border-left: 7px solid transparent; 424 border-right: 7px solid transparent; 425 top: -14px; 426 left: 3px; 427 z-index: 2; 428 } 429 430 .dojoTooltipConnector div { 431 /* the background of the triangle */ 432 font-size: 0px; line-height: 0%; width: 0px; 433 position: absolute; 434 border-bottom: 10px solid #b8b5b5; 435 border-left: 5px solid transparent; 436 border-right: 5px solid transparent; 437 top: 6px; 438 left: -5px; 439 z-index: 3; 409 440 } 410 441 -
dijit/trunk/Tooltip.js
r7562 r7786 8 8 9 9 dojo.require("dijit.base.Widget"); 10 dojo.require("dijit.base.TemplatedWidget"); 10 11 dojo.require("dijit.util.PopupManager"); 11 12 12 13 dojo.declare( 13 14 "dijit.Tooltip", 14 [dijit.base.Widget ],15 [dijit.base.Widget, dijit.base.TemplatedWidget], 15 16 { 16 17 // summary … … 37 38 connectId: "", 38 39 40 templatePath: dojo.uri.moduleUri("dijit", "templates/Tooltip.html"), 41 39 42 postCreate: function(){ 40 43 this._connectNode = dojo.byId(this.connectId); … … 42 45 43 46 if(this.caption != ""){ 44 this. domNode.appendChild(document.createTextNode(this.caption));47 this.containerNode.appendChild(document.createTextNode(this.caption)); 45 48 } 46 dojo.html.addClass(this.domNode, "dojoTooltip");47 49 }, 48 50 49 51 _onMouseOver: function(/*Event*/ e){ 50 this._mouse = {pageX: e.pageX, pageY: e.pageY, target: e.target};51 52 52 // Start tracking mouse movements, so we know when to cancel timers or erase the tooltip 53 53 if(!this._tracking){ … … 60 60 61 61 _onMouseMove: function(/*Event*/ e) { 62 this._mouse = {pageX: e.pageX, pageY: e.pageY, target: e.target};63 64 62 if(dojo.html.overElement(this._connectNode, e) || dojo.html.overElement(this.domNode, e)){ 65 63 this._onHover(e); … … 113 111 114 112 if (this.isShowingNow) { return; } 115 dijit.util.PopupManager.open (this._mouse, this, [10,15]);113 dijit.util.PopupManager.openAround(this._connectNode, this, {'BL': 'TL', 'TL': 'BL'}, [0, 0] ); 116 114 this.isShowingNow = true; 117 115 },