root / trunk / web / dojo / dojox / widget / DynamicTooltip.js @ 11
History | View | Annotate | Download (1.41 KB)
1 | 9 | andrej.cim | /*
|
---|---|---|---|
2 | Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
|
||
3 | Available via Academic Free License >= 2.1 OR the modified BSD license.
|
||
4 | see: http://dojotoolkit.org/license for details
|
||
5 | */
|
||
6 | |||
7 | |||
8 | if(!dojo._hasResource["dojox.widget.DynamicTooltip"]){ |
||
9 | dojo._hasResource["dojox.widget.DynamicTooltip"]=true; |
||
10 | dojo.provide("dojox.widget.DynamicTooltip");
|
||
11 | dojo.experimental("dojox.widget.DynamicTooltip");
|
||
12 | dojo.require("dijit.Tooltip");
|
||
13 | dojo.requireLocalization("dijit","loading",null,"ROOT,ar,ca,cs,da,de,el,es,fi,fr,he,hu,it,ja,ko,nb,nl,pl,pt,pt-pt,ro,ru,sk,sl,sv,th,tr,zh,zh-tw"); |
||
14 | dojo.declare("dojox.widget.DynamicTooltip",dijit.Tooltip,{hasLoaded:false,href:"",label:"",preventCache:false,postMixInProperties:function(){ |
||
15 | this.inherited(arguments); |
||
16 | this._setLoadingLabel();
|
||
17 | },_setLoadingLabel:function(){ |
||
18 | if(this.href){ |
||
19 | this.label=dojo.i18n.getLocalization("dijit","loading",this.lang).loadingState; |
||
20 | } |
||
21 | },_setHrefAttr:function(_1){ |
||
22 | this.href=_1;
|
||
23 | this.hasLoaded=false; |
||
24 | },loadContent:function(){ |
||
25 | if(!this.hasLoaded&&this.href){ |
||
26 | this._setLoadingLabel();
|
||
27 | this.hasLoaded=true; |
||
28 | dojo.xhrGet({url:this.href,handleAs:"text",tooltipWidget:this,load:function(_2,_3){ |
||
29 | this.tooltipWidget.label=_2;
|
||
30 | this.tooltipWidget.close();
|
||
31 | this.tooltipWidget.open();
|
||
32 | },preventCache:this.preventCache}); |
||
33 | } |
||
34 | },refresh:function(){ |
||
35 | this.hasLoaded=false; |
||
36 | },open:function(_4){ |
||
37 | _4=_4||this._connectNodes[0]; |
||
38 | if(!_4){
|
||
39 | return;
|
||
40 | } |
||
41 | this.loadContent();
|
||
42 | this.inherited(arguments); |
||
43 | }}); |
||
44 | } |