dijit/Tooltip.js

  • Provides:

    • dijit.Tooltip
  • dijit._MasterTooltip

    • type
      Function
    • chains:
      • dijit._Widget: (prototype)
      • dijit._Widget: (call)
      • dijit._Templated: (call)
    • mixins:
      • dijit._Templated.prototype: (prototype)
    • summary
      Internal widget that holds the actual tooltip markup,
      which occurs once per page.
      Called by Tooltip widgets which are just containers to hold
      the markup
      tags:
      protected
  • dijit._MasterTooltip.duration

    • type
      Integer
    • summary
      Milliseconds to fade in/fade out
  • dijit._MasterTooltip.templateString

    • summary
  • dijit._MasterTooltip.postCreate

    • type
      Function
    • source: [view]
         dojo.body().appendChild(this.domNode);


         this.bgIframe = new dijit.BackgroundIframe(this.domNode);


         // Setup fade-in and fade-out functions.
         this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") });
         this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") });
    • summary
  • dijit._MasterTooltip.show

    • type
      Function
    • parameters:
      • innerHTML: (typeof String)
      • aroundNode: (typeof DomNode)
      • position: (typeof String[])
      • rtl: (typeof Boolean)
    • source: [view]
         if(this.aroundNode && this.aroundNode === aroundNode){
          return;
         }


         // reset width; it may have been set by orient() on a previous tooltip show()
         this.domNode.width = "auto";


         if(this.fadeOut.status() == "playing"){
          // previous tooltip is being hidden; wait until the hide completes then show new one
          this._onDeck=arguments;
          return;
         }
         this.containerNode.innerHTML=innerHTML;


         var pos = dijit.placeOnScreenAroundElement(this.domNode, aroundNode, dijit.getPopupAroundAlignment((position && position.length) ? position : dijit.Tooltip.defaultPosition, !rtl), dojo.hitch(this, "orient"));


         // show it
         dojo.style(this.domNode, "opacity", 0);
         this.fadeIn.play();
         this.isShowingNow = true;
         this.aroundNode = aroundNode;
    • summary
      Display tooltip w/specified contents to right of specified node
      (To left if there's no space on the right, or if rtl == true)
  • dijit._MasterTooltip.orient

    • type
      Function
    • parameters:
      • node: (typeof DomNode)
      • aroundCorner: (typeof String)
      • tooltipCorner: (typeof String)
      • spaceAvailable: (typeof Object)
      • aroundNodeCoords: (typeof Object)
    • source: [view]
         this.connectorNode.style.top = ""; //reset to default

         
         //Adjust the spaceAvailable width, without changing the spaceAvailable object
         var tooltipSpaceAvaliableWidth = spaceAvailable.w - this.connectorNode.offsetWidth;


         node.className = "dijitTooltip " +
          {
           "BL-TL": "dijitTooltipBelow dijitTooltipABLeft",
           "TL-BL": "dijitTooltipAbove dijitTooltipABLeft",
           "BR-TR": "dijitTooltipBelow dijitTooltipABRight",
           "TR-BR": "dijitTooltipAbove dijitTooltipABRight",
           "BR-BL": "dijitTooltipRight",
           "BL-BR": "dijitTooltipLeft"
          }[aroundCorner + "-" + tooltipCorner];

          
         // reduce tooltip's width to the amount of width available, so that it doesn't overflow screen
         this.domNode.style.width = "auto";
         var size = dojo.contentBox(this.domNode);

         
         var width = Math.min((Math.max(tooltipSpaceAvaliableWidth,1)), size.w);
         var widthWasReduced = width < size.w;

         
         this.domNode.style.width = width+"px";

            
         //Adjust width for tooltips that have a really long word or a nowrap setting
         if(widthWasReduced){
          this.containerNode.style.overflow = "auto"; //temp change to overflow to detect if our tooltip needs to be wider to support the content
          var scrollWidth = this.containerNode.scrollWidth;
          this.containerNode.style.overflow = "visible"; //change it back
          if(scrollWidth > width){
           scrollWidth = scrollWidth + dojo.style(this.domNode,"paddingLeft") + dojo.style(this.domNode,"paddingRight");
           this.domNode.style.width = scrollWidth + "px";
          }
         }

         
         // Reposition the tooltip connector.
         if(tooltipCorner.charAt(0) == 'B' && aroundCorner.charAt(0) == 'B'){
          var mb = dojo.marginBox(node);
          var tooltipConnectorHeight = this.connectorNode.offsetHeight;
          if(mb.h > spaceAvailable.h){
           // The tooltip starts at the top of the page and will extend past the aroundNode
           var aroundNodePlacement = spaceAvailable.h - (aroundNodeCoords.h / 2) - (tooltipConnectorHeight / 2);
           this.connectorNode.style.top = aroundNodePlacement + "px";
           this.connectorNode.style.bottom = "";
          }else{
           // Align center of connector with center of aroundNode, except don't let bottom
           // of connector extend below bottom of tooltip content, or top of connector
           // extend past top of tooltip content
           this.connectorNode.style.bottom = Math.min(
            Math.max(aroundNodeCoords.h/2 - tooltipConnectorHeight/2, 0),
            mb.h - tooltipConnectorHeight) + "px";
           this.connectorNode.style.top = "";
          }
         }else{
          // reset the tooltip back to the defaults
          this.connectorNode.style.top = "";
          this.connectorNode.style.bottom = "";
         }

         
         return Math.max(0, size.w - tooltipSpaceAvaliableWidth);
    • summary
      Private function to set CSS for tooltip node based on which position it's in.
      This is called by the dijit popup code.   It will also reduce the tooltip's
      width to whatever width is available
    • tags:
  • dijit._MasterTooltip._onShow

    • type
      Function
    • source: [view]
         if(dojo.isIE){
          // the arrow won't show up on a node w/an opacity filter
          this.domNode.style.filter="";
         }
    • summary
      Called at end of fade-in operation
    • tags:
  • dijit._MasterTooltip.hide

    • type
      Function
    • parameters:
      • aroundNode: (typeof )
    • source: [view]
         if(this._onDeck && this._onDeck[1] == aroundNode){
          // this hide request is for a show() that hasn't even started yet;
          // just cancel the pending show()
          this._onDeck=null;
         }else if(this.aroundNode === aroundNode){
          // this hide request is for the currently displayed tooltip
          this.fadeIn.stop();
          this.isShowingNow = false;
          this.aroundNode = null;
          this.fadeOut.play();
         }else{
          // just ignore the call, it's for a tooltip that has already been erased
         }
    • summary
      Hide the tooltip
  • dijit._MasterTooltip._onHide

    • type
      Function
    • source: [view]
         this.domNode.style.cssText=""; // to position offscreen again
         this.containerNode.innerHTML="";
         if(this._onDeck){
          // a show request has been queued up; do it now
          this.show.apply(this, this._onDeck);
          this._onDeck=null;
         }
    • summary
      Called at end of fade-out operation
    • tags:
    • chains:
      • this.show: (call)
  • dijit._MasterTooltip.bgIframe

    • summary
  • dijit._MasterTooltip.fadeIn

    • summary
  • dijit._MasterTooltip.fadeOut

    • summary
  • dijit._MasterTooltip.aroundNode

    • summary
  • dijit._MasterTooltip.domNode.width

    • summary
  • dijit._MasterTooltip._onDeck

    • summary
  • dijit._MasterTooltip.containerNode.innerHTML

    • summary
  • dijit._MasterTooltip.isShowingNow

    • summary
  • dijit._MasterTooltip.connectorNode.style.top

    • summary
  • dijit._MasterTooltip.domNode.style.width

    • summary
  • dijit._MasterTooltip.containerNode.style.overflow

    • summary
  • dijit._MasterTooltip.connectorNode.style.bottom

    • summary
  • dijit._MasterTooltip.domNode.style.filter

    • summary
  • dijit._MasterTooltip.domNode.style.cssText

    • summary
  • dijit.Tooltip

    • type
      Function
    • chains:
      • dijit._Widget: (prototype)
      • dijit._Widget: (call)
    • summary
      Pops up a tooltip (a help message) when you hover over a node.
  • dijit.Tooltip.label

    • type
      String
    • summary
      Text to display in the tooltip.
      Specified as innerHTML when creating the widget from markup.
  • dijit.Tooltip.showDelay

    • type
      Integer
    • summary
      Number of milliseconds to wait after hovering over/focusing on the object, before
      the tooltip is displayed.
  • dijit.Tooltip.connectId

    • type
      String|String[
    • summary
      Id of domNode(s) to attach the tooltip to.
      When user hovers over specified dom node, the tooltip will appear.
  • dijit.Tooltip.position

    • type
      String[
    • summary
      See description of `dijit.Tooltip.defaultPosition` for details on position parameter.
  • dijit.Tooltip._setConnectIdAttr

    • type
      Function
    • parameters:
      • newId: (typeof String)
    • source: [view]
      define("dijit/Tooltip", ["dojo", "dijit", "dijit/_Widget", "dijit/_Templated"], function(dojo, dijit) {


      dojo.declare(
       "dijit._MasterTooltip",
       [dijit._Widget, dijit._Templated],
       {
        // summary:
        //  Internal widget that holds the actual tooltip markup,
        //  which occurs once per page.
        //  Called by Tooltip widgets which are just containers to hold
        //  the markup
        // tags:
        //  protected


        // duration: Integer
        //  Milliseconds to fade in/fade out
        duration: dijit.defaultDuration,


        templateString: dojo.cache("dijit", "templates/Tooltip.html"),


        postCreate: function(){
         dojo.body().appendChild(this.domNode);


         this.bgIframe = new dijit.BackgroundIframe(this.domNode);


         // Setup fade-in and fade-out functions.
         this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") });
         this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") });
        },


        show: function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
         // summary:
         //  Display tooltip w/specified contents to right of specified node
         //  (To left if there's no space on the right, or if rtl == true)


         if(this.aroundNode && this.aroundNode === aroundNode){
          return;
         }


         // reset width; it may have been set by orient() on a previous tooltip show()
         this.domNode.width = "auto";


         if(this.fadeOut.status() == "playing"){
          // previous tooltip is being hidden; wait until the hide completes then show new one
          this._onDeck=arguments;
          return;
         }
         this.containerNode.innerHTML=innerHTML;


         var pos = dijit.placeOnScreenAroundElement(this.domNode, aroundNode, dijit.getPopupAroundAlignment((position && position.length) ? position : dijit.Tooltip.defaultPosition, !rtl), dojo.hitch(this, "orient"));


         // show it
         dojo.style(this.domNode, "opacity", 0);
         this.fadeIn.play();
         this.isShowingNow = true;
         this.aroundNode = aroundNode;
        },


        orient: function(/*DomNode*/ node, /*String*/ aroundCorner, /*String*/ tooltipCorner, /*Object*/ spaceAvailable, /*Object*/ aroundNodeCoords){
         // summary:
         //  Private function to set CSS for tooltip node based on which position it's in.
         //  This is called by the dijit popup code. It will also reduce the tooltip's
         //  width to whatever width is available
         // tags:
         //  protected
         this.connectorNode.style.top = ""; //reset to default

         
         //Adjust the spaceAvailable width, without changing the spaceAvailable object
         var tooltipSpaceAvaliableWidth = spaceAvailable.w - this.connectorNode.offsetWidth;


         node.className = "dijitTooltip " +
          {
           "BL-TL": "dijitTooltipBelow dijitTooltipABLeft",
           "TL-BL": "dijitTooltipAbove dijitTooltipABLeft",
           "BR-TR": "dijitTooltipBelow dijitTooltipABRight",
           "TR-BR": "dijitTooltipAbove dijitTooltipABRight",
           "BR-BL": "dijitTooltipRight",
           "BL-BR": "dijitTooltipLeft"
          }[aroundCorner + "-" + tooltipCorner];

          
         // reduce tooltip's width to the amount of width available, so that it doesn't overflow screen
         this.domNode.style.width = "auto";
         var size = dojo.contentBox(this.domNode);

         
         var width = Math.min((Math.max(tooltipSpaceAvaliableWidth,1)), size.w);
         var widthWasReduced = width < size.w;

         
         this.domNode.style.width = width+"px";

            
         //Adjust width for tooltips that have a really long word or a nowrap setting
         if(widthWasReduced){
          this.containerNode.style.overflow = "auto"; //temp change to overflow to detect if our tooltip needs to be wider to support the content
          var scrollWidth = this.containerNode.scrollWidth;
          this.containerNode.style.overflow = "visible"; //change it back
          if(scrollWidth > width){
           scrollWidth = scrollWidth + dojo.style(this.domNode,"paddingLeft") + dojo.style(this.domNode,"paddingRight");
           this.domNode.style.width = scrollWidth + "px";
          }
         }

         
         // Reposition the tooltip connector.
         if(tooltipCorner.charAt(0) == 'B' && aroundCorner.charAt(0) == 'B'){
          var mb = dojo.marginBox(node);
          var tooltipConnectorHeight = this.connectorNode.offsetHeight;
          if(mb.h > spaceAvailable.h){
           // The tooltip starts at the top of the page and will extend past the aroundNode
           var aroundNodePlacement = spaceAvailable.h - (aroundNodeCoords.h / 2) - (tooltipConnectorHeight / 2);
           this.connectorNode.style.top = aroundNodePlacement + "px";
           this.connectorNode.style.bottom = "";
          }else{
           // Align center of connector with center of aroundNode, except don't let bottom
           // of connector extend below bottom of tooltip content, or top of connector
           // extend past top of tooltip content
           this.connectorNode.style.bottom = Math.min(
            Math.max(aroundNodeCoords.h/2 - tooltipConnectorHeight/2, 0),
            mb.h - tooltipConnectorHeight) + "px";
           this.connectorNode.style.top = "";
          }
         }else{
          // reset the tooltip back to the defaults
          this.connectorNode.style.top = "";
          this.connectorNode.style.bottom = "";
         }

         
         return Math.max(0, size.w - tooltipSpaceAvaliableWidth);
        },


        _onShow: function(){
         // summary:
         //  Called at end of fade-in operation
         // tags:
         //  protected
         if(dojo.isIE){
          // the arrow won't show up on a node w/an opacity filter
          this.domNode.style.filter="";
         }
        },


        hide: function(aroundNode){
         // summary:
         //  Hide the tooltip


         if(this._onDeck && this._onDeck[1] == aroundNode){
          // this hide request is for a show() that hasn't even started yet;
          // just cancel the pending show()
          this._onDeck=null;
         }else if(this.aroundNode === aroundNode){
          // this hide request is for the currently displayed tooltip
          this.fadeIn.stop();
          this.isShowingNow = false;
          this.aroundNode = null;
          this.fadeOut.play();
         }else{
          // just ignore the call, it's for a tooltip that has already been erased
         }
        },


        _onHide: function(){
         // summary:
         //  Called at end of fade-out operation
         // tags:
         //  protected


         this.domNode.style.cssText=""; // to position offscreen again
         this.containerNode.innerHTML="";
         if(this._onDeck){
          // a show request has been queued up; do it now
          this.show.apply(this, this._onDeck);
          this._onDeck=null;
         }
        }


       }
      );


      dijit.showTooltip = function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
       // summary:
       //  Display tooltip w/specified contents in specified position.
       //  See description of dijit.Tooltip.defaultPosition for details on position parameter.
       //  If position is not specified then dijit.Tooltip.defaultPosition is used.
       if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
       return dijit._masterTT.show(innerHTML, aroundNode, position, rtl);
      };


      dijit.hideTooltip = function(aroundNode){
       // summary:
       //  Hide the tooltip
       if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
       return dijit._masterTT.hide(aroundNode);
      };


      dojo.declare(
       "dijit.Tooltip",
       dijit._Widget,
       {
        // summary:
        //  Pops up a tooltip (a help message) when you hover over a node.


        // label: String
        //  Text to display in the tooltip.
        //  Specified as innerHTML when creating the widget from markup.
        label: "",


        // showDelay: Integer
        //  Number of milliseconds to wait after hovering over/focusing on the object, before
        //  the tooltip is displayed.
        showDelay: 400,


        // connectId: String|String[]
        //  Id of domNode(s) to attach the tooltip to.
        //  When user hovers over specified dom node, the tooltip will appear.
        connectId: [],


        // position: String[]
        //  See description of `dijit.Tooltip.defaultPosition` for details on position parameter.
        position: [],


        _setConnectIdAttr: function(/*String*/ newId){
         // summary:
         //  Connect to node(s) (specified by id)


         // Remove connections to old nodes (if there are any)
         dojo.forEach(this._connections || [], function(nested){
          dojo.forEach(nested, dojo.hitch(this, "disconnect"));
         }, this);


         // Make connections to nodes in newIds.
         var ary = dojo.isArrayLike(newId) ? newId : (newId ? [newId] : []);
         this._connections = dojo.map(ary, function(id){
          var node = dojo.byId(id);
          return node ? [
           this.connect(node, "onmouseenter", "_onTargetMouseEnter"),
           this.connect(node, "onmouseleave", "_onTargetMouseLeave"),
           this.connect(node, "onfocus", "_onTargetFocus"),
           this.connect(node, "onblur", "_onTargetBlur")
          ] : [];
         }, this);

       
         this._set("connectId", newId);


         this._connectIds = ary; // save as array
    • summary
  • dijit.Tooltip.addTarget

    • type
      Function
    • parameters:
      • node: (typeof DOMNODE || String)
    • source: [view]
      define("dijit/Tooltip", ["dojo", "dijit", "dijit/_Widget", "dijit/_Templated"], function(dojo, dijit) {


      dojo.declare(
       "dijit._MasterTooltip",
       [dijit._Widget, dijit._Templated],
       {
        // summary:
        //  Internal widget that holds the actual tooltip markup,
        //  which occurs once per page.
        //  Called by Tooltip widgets which are just containers to hold
        //  the markup
        // tags:
        //  protected


        // duration: Integer
        //  Milliseconds to fade in/fade out
        duration: dijit.defaultDuration,


        templateString: dojo.cache("dijit", "templates/Tooltip.html"),


        postCreate: function(){
         dojo.body().appendChild(this.domNode);


         this.bgIframe = new dijit.BackgroundIframe(this.domNode);


         // Setup fade-in and fade-out functions.
         this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") });
         this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") });
        },


        show: function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
         // summary:
         //  Display tooltip w/specified contents to right of specified node
         //  (To left if there's no space on the right, or if rtl == true)


         if(this.aroundNode && this.aroundNode === aroundNode){
          return;
         }


         // reset width; it may have been set by orient() on a previous tooltip show()
         this.domNode.width = "auto";


         if(this.fadeOut.status() == "playing"){
          // previous tooltip is being hidden; wait until the hide completes then show new one
          this._onDeck=arguments;
          return;
         }
         this.containerNode.innerHTML=innerHTML;


         var pos = dijit.placeOnScreenAroundElement(this.domNode, aroundNode, dijit.getPopupAroundAlignment((position && position.length) ? position : dijit.Tooltip.defaultPosition, !rtl), dojo.hitch(this, "orient"));


         // show it
         dojo.style(this.domNode, "opacity", 0);
         this.fadeIn.play();
         this.isShowingNow = true;
         this.aroundNode = aroundNode;
        },


        orient: function(/*DomNode*/ node, /*String*/ aroundCorner, /*String*/ tooltipCorner, /*Object*/ spaceAvailable, /*Object*/ aroundNodeCoords){
         // summary:
         //  Private function to set CSS for tooltip node based on which position it's in.
         //  This is called by the dijit popup code. It will also reduce the tooltip's
         //  width to whatever width is available
         // tags:
         //  protected
         this.connectorNode.style.top = ""; //reset to default

         
         //Adjust the spaceAvailable width, without changing the spaceAvailable object
         var tooltipSpaceAvaliableWidth = spaceAvailable.w - this.connectorNode.offsetWidth;


         node.className = "dijitTooltip " +
          {
           "BL-TL": "dijitTooltipBelow dijitTooltipABLeft",
           "TL-BL": "dijitTooltipAbove dijitTooltipABLeft",
           "BR-TR": "dijitTooltipBelow dijitTooltipABRight",
           "TR-BR": "dijitTooltipAbove dijitTooltipABRight",
           "BR-BL": "dijitTooltipRight",
           "BL-BR": "dijitTooltipLeft"
          }[aroundCorner + "-" + tooltipCorner];

          
         // reduce tooltip's width to the amount of width available, so that it doesn't overflow screen
         this.domNode.style.width = "auto";
         var size = dojo.contentBox(this.domNode);

         
         var width = Math.min((Math.max(tooltipSpaceAvaliableWidth,1)), size.w);
         var widthWasReduced = width < size.w;

         
         this.domNode.style.width = width+"px";

            
         //Adjust width for tooltips that have a really long word or a nowrap setting
         if(widthWasReduced){
          this.containerNode.style.overflow = "auto"; //temp change to overflow to detect if our tooltip needs to be wider to support the content
          var scrollWidth = this.containerNode.scrollWidth;
          this.containerNode.style.overflow = "visible"; //change it back
          if(scrollWidth > width){
           scrollWidth = scrollWidth + dojo.style(this.domNode,"paddingLeft") + dojo.style(this.domNode,"paddingRight");
           this.domNode.style.width = scrollWidth + "px";
          }
         }

         
         // Reposition the tooltip connector.
         if(tooltipCorner.charAt(0) == 'B' && aroundCorner.charAt(0) == 'B'){
          var mb = dojo.marginBox(node);
          var tooltipConnectorHeight = this.connectorNode.offsetHeight;
          if(mb.h > spaceAvailable.h){
           // The tooltip starts at the top of the page and will extend past the aroundNode
           var aroundNodePlacement = spaceAvailable.h - (aroundNodeCoords.h / 2) - (tooltipConnectorHeight / 2);
           this.connectorNode.style.top = aroundNodePlacement + "px";
           this.connectorNode.style.bottom = "";
          }else{
           // Align center of connector with center of aroundNode, except don't let bottom
           // of connector extend below bottom of tooltip content, or top of connector
           // extend past top of tooltip content
           this.connectorNode.style.bottom = Math.min(
            Math.max(aroundNodeCoords.h/2 - tooltipConnectorHeight/2, 0),
            mb.h - tooltipConnectorHeight) + "px";
           this.connectorNode.style.top = "";
          }
         }else{
          // reset the tooltip back to the defaults
          this.connectorNode.style.top = "";
          this.connectorNode.style.bottom = "";
         }

         
         return Math.max(0, size.w - tooltipSpaceAvaliableWidth);
        },


        _onShow: function(){
         // summary:
         //  Called at end of fade-in operation
         // tags:
         //  protected
         if(dojo.isIE){
          // the arrow won't show up on a node w/an opacity filter
          this.domNode.style.filter="";
         }
        },


        hide: function(aroundNode){
         // summary:
         //  Hide the tooltip


         if(this._onDeck && this._onDeck[1] == aroundNode){
          // this hide request is for a show() that hasn't even started yet;
          // just cancel the pending show()
          this._onDeck=null;
         }else if(this.aroundNode === aroundNode){
          // this hide request is for the currently displayed tooltip
          this.fadeIn.stop();
          this.isShowingNow = false;
          this.aroundNode = null;
          this.fadeOut.play();
         }else{
          // just ignore the call, it's for a tooltip that has already been erased
         }
        },


        _onHide: function(){
         // summary:
         //  Called at end of fade-out operation
         // tags:
         //  protected


         this.domNode.style.cssText=""; // to position offscreen again
         this.containerNode.innerHTML="";
         if(this._onDeck){
          // a show request has been queued up; do it now
          this.show.apply(this, this._onDeck);
          this._onDeck=null;
         }
        }


       }
      );


      dijit.showTooltip = function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
       // summary:
       //  Display tooltip w/specified contents in specified position.
       //  See description of dijit.Tooltip.defaultPosition for details on position parameter.
       //  If position is not specified then dijit.Tooltip.defaultPosition is used.
       if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
       return dijit._masterTT.show(innerHTML, aroundNode, position, rtl);
      };


      dijit.hideTooltip = function(aroundNode){
       // summary:
       //  Hide the tooltip
       if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
       return dijit._masterTT.hide(aroundNode);
      };


      dojo.declare(
       "dijit.Tooltip",
       dijit._Widget,
       {
        // summary:
        //  Pops up a tooltip (a help message) when you hover over a node.


        // label: String
        //  Text to display in the tooltip.
        //  Specified as innerHTML when creating the widget from markup.
        label: "",


        // showDelay: Integer
        //  Number of milliseconds to wait after hovering over/focusing on the object, before
        //  the tooltip is displayed.
        showDelay: 400,


        // connectId: String|String[]
        //  Id of domNode(s) to attach the tooltip to.
        //  When user hovers over specified dom node, the tooltip will appear.
        connectId: [],


        // position: String[]
        //  See description of `dijit.Tooltip.defaultPosition` for details on position parameter.
        position: [],


        _setConnectIdAttr: function(/*String*/ newId){
         // summary:
         //  Connect to node(s) (specified by id)


         // Remove connections to old nodes (if there are any)
         dojo.forEach(this._connections || [], function(nested){
          dojo.forEach(nested, dojo.hitch(this, "disconnect"));
         }, this);


         // Make connections to nodes in newIds.
         var ary = dojo.isArrayLike(newId) ? newId : (newId ? [newId] : []);
         this._connections = dojo.map(ary, function(id){
          var node = dojo.byId(id);
          return node ? [
           this.connect(node, "onmouseenter", "_onTargetMouseEnter"),
           this.connect(node, "onmouseleave", "_onTargetMouseLeave"),
           this.connect(node, "onfocus", "_onTargetFocus"),
           this.connect(node, "onblur", "_onTargetBlur")
          ] : [];
         }, this);

       
         this._set("connectId", newId);


         this._connectIds = ary; // save as array
        },


        addTarget: function(/*DOMNODE || String*/ node){
         // summary:
         //  Attach tooltip to specified node if it's not already connected


         // TODO: remove in 2.0 and just use set("connectId", ...) interface


         var id = node.id || node;
         if(dojo.indexOf(this._connectIds, id) == -1){
          this.set("connectId", this._connectIds.concat(id));
         }
    • summary
  • dijit.Tooltip.removeTarget

    • type
      Function
    • parameters:
      • node: (typeof DOMNODE || String)
    • source: [view]
      define("dijit/Tooltip", ["dojo", "dijit", "dijit/_Widget", "dijit/_Templated"], function(dojo, dijit) {


      dojo.declare(
       "dijit._MasterTooltip",
       [dijit._Widget, dijit._Templated],
       {
        // summary:
        //  Internal widget that holds the actual tooltip markup,
        //  which occurs once per page.
        //  Called by Tooltip widgets which are just containers to hold
        //  the markup
        // tags:
        //  protected


        // duration: Integer
        //  Milliseconds to fade in/fade out
        duration: dijit.defaultDuration,


        templateString: dojo.cache("dijit", "templates/Tooltip.html"),


        postCreate: function(){
         dojo.body().appendChild(this.domNode);


         this.bgIframe = new dijit.BackgroundIframe(this.domNode);


         // Setup fade-in and fade-out functions.
         this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") });
         this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") });
        },


        show: function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
         // summary:
         //  Display tooltip w/specified contents to right of specified node
         //  (To left if there's no space on the right, or if rtl == true)


         if(this.aroundNode && this.aroundNode === aroundNode){
          return;
         }


         // reset width; it may have been set by orient() on a previous tooltip show()
         this.domNode.width = "auto";


         if(this.fadeOut.status() == "playing"){
          // previous tooltip is being hidden; wait until the hide completes then show new one
          this._onDeck=arguments;
          return;
         }
         this.containerNode.innerHTML=innerHTML;


         var pos = dijit.placeOnScreenAroundElement(this.domNode, aroundNode, dijit.getPopupAroundAlignment((position && position.length) ? position : dijit.Tooltip.defaultPosition, !rtl), dojo.hitch(this, "orient"));


         // show it
         dojo.style(this.domNode, "opacity", 0);
         this.fadeIn.play();
         this.isShowingNow = true;
         this.aroundNode = aroundNode;
        },


        orient: function(/*DomNode*/ node, /*String*/ aroundCorner, /*String*/ tooltipCorner, /*Object*/ spaceAvailable, /*Object*/ aroundNodeCoords){
         // summary:
         //  Private function to set CSS for tooltip node based on which position it's in.
         //  This is called by the dijit popup code. It will also reduce the tooltip's
         //  width to whatever width is available
         // tags:
         //  protected
         this.connectorNode.style.top = ""; //reset to default

         
         //Adjust the spaceAvailable width, without changing the spaceAvailable object
         var tooltipSpaceAvaliableWidth = spaceAvailable.w - this.connectorNode.offsetWidth;


         node.className = "dijitTooltip " +
          {
           "BL-TL": "dijitTooltipBelow dijitTooltipABLeft",
           "TL-BL": "dijitTooltipAbove dijitTooltipABLeft",
           "BR-TR": "dijitTooltipBelow dijitTooltipABRight",
           "TR-BR": "dijitTooltipAbove dijitTooltipABRight",
           "BR-BL": "dijitTooltipRight",
           "BL-BR": "dijitTooltipLeft"
          }[aroundCorner + "-" + tooltipCorner];

          
         // reduce tooltip's width to the amount of width available, so that it doesn't overflow screen
         this.domNode.style.width = "auto";
         var size = dojo.contentBox(this.domNode);

         
         var width = Math.min((Math.max(tooltipSpaceAvaliableWidth,1)), size.w);
         var widthWasReduced = width < size.w;

         
         this.domNode.style.width = width+"px";

            
         //Adjust width for tooltips that have a really long word or a nowrap setting
         if(widthWasReduced){
          this.containerNode.style.overflow = "auto"; //temp change to overflow to detect if our tooltip needs to be wider to support the content
          var scrollWidth = this.containerNode.scrollWidth;
          this.containerNode.style.overflow = "visible"; //change it back
          if(scrollWidth > width){
           scrollWidth = scrollWidth + dojo.style(this.domNode,"paddingLeft") + dojo.style(this.domNode,"paddingRight");
           this.domNode.style.width = scrollWidth + "px";
          }
         }

         
         // Reposition the tooltip connector.
         if(tooltipCorner.charAt(0) == 'B' && aroundCorner.charAt(0) == 'B'){
          var mb = dojo.marginBox(node);
          var tooltipConnectorHeight = this.connectorNode.offsetHeight;
          if(mb.h > spaceAvailable.h){
           // The tooltip starts at the top of the page and will extend past the aroundNode
           var aroundNodePlacement = spaceAvailable.h - (aroundNodeCoords.h / 2) - (tooltipConnectorHeight / 2);
           this.connectorNode.style.top = aroundNodePlacement + "px";
           this.connectorNode.style.bottom = "";
          }else{
           // Align center of connector with center of aroundNode, except don't let bottom
           // of connector extend below bottom of tooltip content, or top of connector
           // extend past top of tooltip content
           this.connectorNode.style.bottom = Math.min(
            Math.max(aroundNodeCoords.h/2 - tooltipConnectorHeight/2, 0),
            mb.h - tooltipConnectorHeight) + "px";
           this.connectorNode.style.top = "";
          }
         }else{
          // reset the tooltip back to the defaults
          this.connectorNode.style.top = "";
          this.connectorNode.style.bottom = "";
         }

         
         return Math.max(0, size.w - tooltipSpaceAvaliableWidth);
        },


        _onShow: function(){
         // summary:
         //  Called at end of fade-in operation
         // tags:
         //  protected
         if(dojo.isIE){
          // the arrow won't show up on a node w/an opacity filter
          this.domNode.style.filter="";
         }
        },


        hide: function(aroundNode){
         // summary:
         //  Hide the tooltip


         if(this._onDeck && this._onDeck[1] == aroundNode){
          // this hide request is for a show() that hasn't even started yet;
          // just cancel the pending show()
          this._onDeck=null;
         }else if(this.aroundNode === aroundNode){
          // this hide request is for the currently displayed tooltip
          this.fadeIn.stop();
          this.isShowingNow = false;
          this.aroundNode = null;
          this.fadeOut.play();
         }else{
          // just ignore the call, it's for a tooltip that has already been erased
         }
        },


        _onHide: function(){
         // summary:
         //  Called at end of fade-out operation
         // tags:
         //  protected


         this.domNode.style.cssText=""; // to position offscreen again
         this.containerNode.innerHTML="";
         if(this._onDeck){
          // a show request has been queued up; do it now
          this.show.apply(this, this._onDeck);
          this._onDeck=null;
         }
        }


       }
      );


      dijit.showTooltip = function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
       // summary:
       //  Display tooltip w/specified contents in specified position.
       //  See description of dijit.Tooltip.defaultPosition for details on position parameter.
       //  If position is not specified then dijit.Tooltip.defaultPosition is used.
       if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
       return dijit._masterTT.show(innerHTML, aroundNode, position, rtl);
      };


      dijit.hideTooltip = function(aroundNode){
       // summary:
       //  Hide the tooltip
       if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
       return dijit._masterTT.hide(aroundNode);
      };


      dojo.declare(
       "dijit.Tooltip",
       dijit._Widget,
       {
        // summary:
        //  Pops up a tooltip (a help message) when you hover over a node.


        // label: String
        //  Text to display in the tooltip.
        //  Specified as innerHTML when creating the widget from markup.
        label: "",


        // showDelay: Integer
        //  Number of milliseconds to wait after hovering over/focusing on the object, before
        //  the tooltip is displayed.
        showDelay: 400,


        // connectId: String|String[]
        //  Id of domNode(s) to attach the tooltip to.
        //  When user hovers over specified dom node, the tooltip will appear.
        connectId: [],


        // position: String[]
        //  See description of `dijit.Tooltip.defaultPosition` for details on position parameter.
        position: [],


        _setConnectIdAttr: function(/*String*/ newId){
         // summary:
         //  Connect to node(s) (specified by id)


         // Remove connections to old nodes (if there are any)
         dojo.forEach(this._connections || [], function(nested){
          dojo.forEach(nested, dojo.hitch(this, "disconnect"));
         }, this);


         // Make connections to nodes in newIds.
         var ary = dojo.isArrayLike(newId) ? newId : (newId ? [newId] : []);
         this._connections = dojo.map(ary, function(id){
          var node = dojo.byId(id);
          return node ? [
           this.connect(node, "onmouseenter", "_onTargetMouseEnter"),
           this.connect(node, "onmouseleave", "_onTargetMouseLeave"),
           this.connect(node, "onfocus", "_onTargetFocus"),
           this.connect(node, "onblur", "_onTargetBlur")
          ] : [];
         }, this);

       
         this._set("connectId", newId);


         this._connectIds = ary; // save as array
        },


        addTarget: function(/*DOMNODE || String*/ node){
         // summary:
         //  Attach tooltip to specified node if it's not already connected


         // TODO: remove in 2.0 and just use set("connectId", ...) interface


         var id = node.id || node;
         if(dojo.indexOf(this._connectIds, id) == -1){
          this.set("connectId", this._connectIds.concat(id));
         }
        },


        removeTarget: function(/*DOMNODE || String*/ node){
         // summary:
         //  Detach tooltip from specified node


         // TODO: remove in 2.0 and just use set("connectId", ...) interface

         
         var id = node.id || node, // map from DOMNode back to plain id string
          idx = dojo.indexOf(this._connectIds, id);
         if(idx >= 0){
          // remove id (modifies original this._connectIds but that's OK in this case)
          this._connectIds.splice(idx, 1);
          this.set("connectId", this._connectIds);
         }
    • summary
  • dijit.Tooltip.buildRendering

    • type
      Function
    • source: [view]
         this.inherited(arguments);
         dojo.addClass(this.domNode,"dijitTooltipData");
    • summary
  • dijit.Tooltip.startup

    • type
      Function
    • source: [view]
         this.inherited(arguments);


         // If this tooltip was created in a template, or for some other reason the specified connectId[s]
         // didn't exist during the widget's initialization, then connect now.
         var ids = this.connectId;
         dojo.forEach(dojo.isArrayLike(ids) ? ids : [ids], this.addTarget, this);
    • summary
  • dijit.Tooltip._onTargetMouseEnter

    • type
      Function
    • parameters:
      • e: (typeof Event)
    • source: [view]
         this._onHover(e);
    • summary
      Handler for mouseenter event on the target node
    • tags:
  • dijit.Tooltip._onTargetMouseLeave

    • type
      Function
    • parameters:
      • e: (typeof Event)
    • source: [view]
         this._onUnHover(e);
    • summary
      Handler for mouseleave event on the target node
    • tags:
  • dijit.Tooltip._onTargetFocus

    • type
      Function
    • parameters:
      • e: (typeof Event)
    • source: [view]
         this._focus = true;
         this._onHover(e);
    • summary
      Handler for focus event on the target node
    • tags:
  • dijit.Tooltip._onTargetBlur

    • type
      Function
    • parameters:
      • e: (typeof Event)
    • source: [view]
         this._focus = false;
         this._onUnHover(e);
    • summary
      Handler for blur event on the target node
    • tags:
  • dijit.Tooltip._onHover

    • type
      Function
    • parameters:
      • e: (typeof Event)
    • source: [view]
         if(!this._showTimer){
          var target = e.target;
          this._showTimer = setTimeout(dojo.hitch(this, function(){this.open(target)}), this.showDelay);
         }
    • summary
      Despite the name of this method, it actually handles both hover and focus
      events on the target node, setting a timer to show the tooltip.
    • tags:
  • dijit.Tooltip._onUnHover

    • type
      Function
    • parameters:
      • e: (typeof Event)
    • source: [view]
      define("dijit/Tooltip", ["dojo", "dijit", "dijit/_Widget", "dijit/_Templated"], function(dojo, dijit) {


      dojo.declare(
       "dijit._MasterTooltip",
       [dijit._Widget, dijit._Templated],
       {
        // summary:
        //  Internal widget that holds the actual tooltip markup,
        //  which occurs once per page.
        //  Called by Tooltip widgets which are just containers to hold
        //  the markup
        // tags:
        //  protected


        // duration: Integer
        //  Milliseconds to fade in/fade out
        duration: dijit.defaultDuration,


        templateString: dojo.cache("dijit", "templates/Tooltip.html"),


        postCreate: function(){
         dojo.body().appendChild(this.domNode);


         this.bgIframe = new dijit.BackgroundIframe(this.domNode);


         // Setup fade-in and fade-out functions.
         this.fadeIn = dojo.fadeIn({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onShow") });
         this.fadeOut = dojo.fadeOut({ node: this.domNode, duration: this.duration, onEnd: dojo.hitch(this, "_onHide") });
        },


        show: function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
         // summary:
         //  Display tooltip w/specified contents to right of specified node
         //  (To left if there's no space on the right, or if rtl == true)


         if(this.aroundNode && this.aroundNode === aroundNode){
          return;
         }


         // reset width; it may have been set by orient() on a previous tooltip show()
         this.domNode.width = "auto";


         if(this.fadeOut.status() == "playing"){
          // previous tooltip is being hidden; wait until the hide completes then show new one
          this._onDeck=arguments;
          return;
         }
         this.containerNode.innerHTML=innerHTML;


         var pos = dijit.placeOnScreenAroundElement(this.domNode, aroundNode, dijit.getPopupAroundAlignment((position && position.length) ? position : dijit.Tooltip.defaultPosition, !rtl), dojo.hitch(this, "orient"));


         // show it
         dojo.style(this.domNode, "opacity", 0);
         this.fadeIn.play();
         this.isShowingNow = true;
         this.aroundNode = aroundNode;
        },


        orient: function(/*DomNode*/ node, /*String*/ aroundCorner, /*String*/ tooltipCorner, /*Object*/ spaceAvailable, /*Object*/ aroundNodeCoords){
         // summary:
         //  Private function to set CSS for tooltip node based on which position it's in.
         //  This is called by the dijit popup code. It will also reduce the tooltip's
         //  width to whatever width is available
         // tags:
         //  protected
         this.connectorNode.style.top = ""; //reset to default

         
         //Adjust the spaceAvailable width, without changing the spaceAvailable object
         var tooltipSpaceAvaliableWidth = spaceAvailable.w - this.connectorNode.offsetWidth;


         node.className = "dijitTooltip " +
          {
           "BL-TL": "dijitTooltipBelow dijitTooltipABLeft",
           "TL-BL": "dijitTooltipAbove dijitTooltipABLeft",
           "BR-TR": "dijitTooltipBelow dijitTooltipABRight",
           "TR-BR": "dijitTooltipAbove dijitTooltipABRight",
           "BR-BL": "dijitTooltipRight",
           "BL-BR": "dijitTooltipLeft"
          }[aroundCorner + "-" + tooltipCorner];

          
         // reduce tooltip's width to the amount of width available, so that it doesn't overflow screen
         this.domNode.style.width = "auto";
         var size = dojo.contentBox(this.domNode);

         
         var width = Math.min((Math.max(tooltipSpaceAvaliableWidth,1)), size.w);
         var widthWasReduced = width < size.w;

         
         this.domNode.style.width = width+"px";

            
         //Adjust width for tooltips that have a really long word or a nowrap setting
         if(widthWasReduced){
          this.containerNode.style.overflow = "auto"; //temp change to overflow to detect if our tooltip needs to be wider to support the content
          var scrollWidth = this.containerNode.scrollWidth;
          this.containerNode.style.overflow = "visible"; //change it back
          if(scrollWidth > width){
           scrollWidth = scrollWidth + dojo.style(this.domNode,"paddingLeft") + dojo.style(this.domNode,"paddingRight");
           this.domNode.style.width = scrollWidth + "px";
          }
         }

         
         // Reposition the tooltip connector.
         if(tooltipCorner.charAt(0) == 'B' && aroundCorner.charAt(0) == 'B'){
          var mb = dojo.marginBox(node);
          var tooltipConnectorHeight = this.connectorNode.offsetHeight;
          if(mb.h > spaceAvailable.h){
           // The tooltip starts at the top of the page and will extend past the aroundNode
           var aroundNodePlacement = spaceAvailable.h - (aroundNodeCoords.h / 2) - (tooltipConnectorHeight / 2);
           this.connectorNode.style.top = aroundNodePlacement + "px";
           this.connectorNode.style.bottom = "";
          }else{
           // Align center of connector with center of aroundNode, except don't let bottom
           // of connector extend below bottom of tooltip content, or top of connector
           // extend past top of tooltip content
           this.connectorNode.style.bottom = Math.min(
            Math.max(aroundNodeCoords.h/2 - tooltipConnectorHeight/2, 0),
            mb.h - tooltipConnectorHeight) + "px";
           this.connectorNode.style.top = "";
          }
         }else{
          // reset the tooltip back to the defaults
          this.connectorNode.style.top = "";
          this.connectorNode.style.bottom = "";
         }

         
         return Math.max(0, size.w - tooltipSpaceAvaliableWidth);
        },


        _onShow: function(){
         // summary:
         //  Called at end of fade-in operation
         // tags:
         //  protected
         if(dojo.isIE){
          // the arrow won't show up on a node w/an opacity filter
          this.domNode.style.filter="";
         }
        },


        hide: function(aroundNode){
         // summary:
         //  Hide the tooltip


         if(this._onDeck && this._onDeck[1] == aroundNode){
          // this hide request is for a show() that hasn't even started yet;
          // just cancel the pending show()
          this._onDeck=null;
         }else if(this.aroundNode === aroundNode){
          // this hide request is for the currently displayed tooltip
          this.fadeIn.stop();
          this.isShowingNow = false;
          this.aroundNode = null;
          this.fadeOut.play();
         }else{
          // just ignore the call, it's for a tooltip that has already been erased
         }
        },


        _onHide: function(){
         // summary:
         //  Called at end of fade-out operation
         // tags:
         //  protected


         this.domNode.style.cssText=""; // to position offscreen again
         this.containerNode.innerHTML="";
         if(this._onDeck){
          // a show request has been queued up; do it now
          this.show.apply(this, this._onDeck);
          this._onDeck=null;
         }
        }


       }
      );


      dijit.showTooltip = function(/*String*/ innerHTML, /*DomNode*/ aroundNode, /*String[]?*/ position, /*Boolean*/ rtl){
       // summary:
       //  Display tooltip w/specified contents in specified position.
       //  See description of dijit.Tooltip.defaultPosition for details on position parameter.
       //  If position is not specified then dijit.Tooltip.defaultPosition is used.
       if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
       return dijit._masterTT.show(innerHTML, aroundNode, position, rtl);
      };


      dijit.hideTooltip = function(aroundNode){
       // summary:
       //  Hide the tooltip
       if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
       return dijit._masterTT.hide(aroundNode);
      };


      dojo.declare(
       "dijit.Tooltip",
       dijit._Widget,
       {
        // summary:
        //  Pops up a tooltip (a help message) when you hover over a node.


        // label: String
        //  Text to display in the tooltip.
        //  Specified as innerHTML when creating the widget from markup.
        label: "",


        // showDelay: Integer
        //  Number of milliseconds to wait after hovering over/focusing on the object, before
        //  the tooltip is displayed.
        showDelay: 400,


        // connectId: String|String[]
        //  Id of domNode(s) to attach the tooltip to.
        //  When user hovers over specified dom node, the tooltip will appear.
        connectId: [],


        // position: String[]
        //  See description of `dijit.Tooltip.defaultPosition` for details on position parameter.
        position: [],


        _setConnectIdAttr: function(/*String*/ newId){
         // summary:
         //  Connect to node(s) (specified by id)


         // Remove connections to old nodes (if there are any)
         dojo.forEach(this._connections || [], function(nested){
          dojo.forEach(nested, dojo.hitch(this, "disconnect"));
         }, this);


         // Make connections to nodes in newIds.
         var ary = dojo.isArrayLike(newId) ? newId : (newId ? [newId] : []);
         this._connections = dojo.map(ary, function(id){
          var node = dojo.byId(id);
          return node ? [
           this.connect(node, "onmouseenter", "_onTargetMouseEnter"),
           this.connect(node, "onmouseleave", "_onTargetMouseLeave"),
           this.connect(node, "onfocus", "_onTargetFocus"),
           this.connect(node, "onblur", "_onTargetBlur")
          ] : [];
         }, this);

       
         this._set("connectId", newId);


         this._connectIds = ary; // save as array
        },


        addTarget: function(/*DOMNODE || String*/ node){
         // summary:
         //  Attach tooltip to specified node if it's not already connected


         // TODO: remove in 2.0 and just use set("connectId", ...) interface


         var id = node.id || node;
         if(dojo.indexOf(this._connectIds, id) == -1){
          this.set("connectId", this._connectIds.concat(id));
         }
        },


        removeTarget: function(/*DOMNODE || String*/ node){
         // summary:
         //  Detach tooltip from specified node


         // TODO: remove in 2.0 and just use set("connectId", ...) interface

         
         var id = node.id || node, // map from DOMNode back to plain id string
          idx = dojo.indexOf(this._connectIds, id);
         if(idx >= 0){
          // remove id (modifies original this._connectIds but that's OK in this case)
          this._connectIds.splice(idx, 1);
          this.set("connectId", this._connectIds);
         }
        },


        buildRendering: function(){
         this.inherited(arguments);
         dojo.addClass(this.domNode,"dijitTooltipData");
        },


        startup: function(){
         this.inherited(arguments);


         // If this tooltip was created in a template, or for some other reason the specified connectId[s]
         // didn't exist during the widget's initialization, then connect now.
         var ids = this.connectId;
         dojo.forEach(dojo.isArrayLike(ids) ? ids : [ids], this.addTarget, this);
        },


        _onTargetMouseEnter: function(/*Event*/ e){
         // summary:
         //  Handler for mouseenter event on the target node
         // tags:
         //  private
         this._onHover(e);
        },


        _onTargetMouseLeave: function(/*Event*/ e){
         // summary:
         //  Handler for mouseleave event on the target node
         // tags:
         //  private
         this._onUnHover(e);
        },


        _onTargetFocus: function(/*Event*/ e){
         // summary:
         //  Handler for focus event on the target node
         // tags:
         //  private


         this._focus = true;
         this._onHover(e);
        },


        _onTargetBlur: function(/*Event*/ e){
         // summary:
         //  Handler for blur event on the target node
         // tags:
         //  private


         this._focus = false;
         this._onUnHover(e);
        },


        _onHover: function(/*Event*/ e){
         // summary:
         //  Despite the name of this method, it actually handles both hover and focus
         //  events on the target node, setting a timer to show the tooltip.
         // tags:
         //  private
         if(!this._showTimer){
          var target = e.target;
          this._showTimer = setTimeout(dojo.hitch(this, function(){this.open(target)}), this.showDelay);
         }
        },


        _onUnHover: function(/*Event*/ e){
         // summary:
         //  Despite the name of this method, it actually handles both mouseleave and blur
         //  events on the target node, hiding the tooltip.
         // tags:
         //  private


         // keep a tooltip open if the associated element still has focus (even though the
         // mouse moved away)
         if(this._focus){ return; }


         if(this._showTimer){
          clearTimeout(this._showTimer);
          delete this._showTimer;
         }
         this.close();
    • summary
      Despite the name of this method, it actually handles both mouseleave and blur
      events on the target node, hiding the tooltip.
  • dijit.Tooltip.open

    • type
      Function
    • parameters:
      • target: (typeof DomNode)
    • source: [view]
         if(this._showTimer){
          clearTimeout(this._showTimer);
          delete this._showTimer;
         }
         dijit.showTooltip(this.label || this.domNode.innerHTML, target, this.position, !this.isLeftToRight());


         this._connectNode = target;
         this.onShow(target, this.position);
    • summary
      Display the tooltip; usually not called directly.
    • tags:
  • dijit.Tooltip.close

    • type
      Function
    • source: [view]
         if(this._connectNode){
          // if tooltip is currently shown
          dijit.hideTooltip(this._connectNode);
          delete this._connectNode;
          this.onHide();
         }
         if(this._showTimer){
          // if tooltip is scheduled to be shown (after a brief delay)
          clearTimeout(this._showTimer);
          delete this._showTimer;
         }
    • summary
      Hide the tooltip or cancel timer for show of tooltip
    • tags:
  • dijit.Tooltip.onShow

    • type
      Function
    • parameters:
      • target: (typeof )
      • position: (typeof )
    • source: [view]
         // summary:
         //  Called when the tooltip is shown
         // tags:
         //  callback
    • summary
      Called when the tooltip is shown
    • tags:
  • dijit.Tooltip.onHide

    • type
      Function
    • source: [view]
         // summary:
         //  Called when the tooltip is hidden
         // tags:
         //  callback
    • summary
      Called when the tooltip is hidden
    • tags:
  • dijit.Tooltip.uninitialize

    • type
      Function
    • source: [view]
         this.close();
         this.inherited(arguments);
    • summary
  • dijit.Tooltip._connections

    • summary
  • dijit.Tooltip._connectIds

    • summary
  • dijit.Tooltip._focus

    • summary
  • dijit.Tooltip._showTimer

    • summary
  • dijit.Tooltip._connectNode

    • summary
  • dijit.showTooltip

    • type
      Function
    • parameters:
      • innerHTML: (typeof String)
      • aroundNode: (typeof DomNode)
      • position: (typeof String[])
      • rtl: (typeof Boolean)
    • source: [view]
       if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
       return dijit._masterTT.show(innerHTML, aroundNode, position, rtl);
    • summary
      Display tooltip w/specified contents in specified position.
      See description of dijit.Tooltip.defaultPosition for details on position parameter.
      If position is not specified then dijit.Tooltip.defaultPosition is used.
  • dijit.hideTooltip

    • type
      Function
    • parameters:
      • aroundNode: (typeof )
    • source: [view]
       if(!dijit._masterTT){ dijit._masterTT = new dijit._MasterTooltip(); }
       return dijit._masterTT.hide(aroundNode);
    • summary
      Hide the tooltip
  • dijit.Tooltip.defaultPosition

    • summary
  • dijit

    • type
      Object
    • summary