</head>
<body onload="prettyPrint();">
<pre class="prettyprint lang-js">/*!
- * Ext JS Library 3.2.0
- * Copyright(c) 2006-2010 Ext JS, Inc.
- * licensing@extjs.com
- * http://www.extjs.com/license
+ * Ext JS Library 3.3.1
+ * Copyright(c) 2006-2010 Sencha Inc.
+ * licensing@sencha.com
+ * http://www.sencha.com/license
*/
<div id="cls-Ext.QuickTips"></div>/**
* @class Ext.QuickTips
* configuration properties of Ext.QuickTip. These settings will apply to all
* tooltips shown by the singleton.</p>
* <p>Below is the summary of the configuration properties which can be used.
- * For detailed descriptions see {@link #getQuickTip}</p>
+ * For detailed descriptions see the config options for the {@link Ext.QuickTip QuickTip} class</p>
* <p><b>QuickTips singleton configs (all are optional)</b></p>
* <div class="mdetail-params"><ul><li>dismissDelay</li>
* <li>hideDelay</li>
Ext.apply(Ext.QuickTips.getQuickTip(), {
maxWidth: 200,
minWidth: 100,
- showDelay: 50,
+ showDelay: 50, // Show 50ms after entering target
trackMouse: true
});
title: 'My Tooltip',
text: 'This tooltip was added in code',
width: 100,
- dismissDelay: 20
+ dismissDelay: 10000 // Hide after 10 seconds hover
});
</code></pre>
* <p>To register a quick tip in markup, you simply add one or more of the valid QuickTip attributes prefixed with
* @singleton
*/
Ext.QuickTips = function(){
- var tip, locks = [];
+ var tip,
+ disabled = false;
+
return {
<div id="method-Ext.QuickTips-init"></div>/**
* Initialize the global QuickTips instance and prepare any quick tips.
});
return;
}
- tip = new Ext.QuickTip({elements:'header,body'});
+ tip = new Ext.QuickTip({
+ elements:'header,body',
+ disabled: disabled
+ });
if(autoRender !== false){
tip.render(Ext.getBody());
}
}
},
+
+ // Protected method called by the dd classes
+ ddDisable : function(){
+ // don't disable it if we don't need to
+ if(tip && !disabled){
+ tip.disable();
+ }
+ },
+
+ // Protected method called by the dd classes
+ ddEnable : function(){
+ // only enable it if it hasn't been disabled
+ if(tip && !disabled){
+ tip.enable();
+ }
+ },
<div id="method-Ext.QuickTips-enable"></div>/**
* Enable quick tips globally.
*/
enable : function(){
if(tip){
- locks.pop();
- if(locks.length < 1){
- tip.enable();
- }
+ tip.enable();
}
+ disabled = false;
},
<div id="method-Ext.QuickTips-disable"></div>/**
if(tip){
tip.disable();
}
- locks.push(1);
+ disabled = true;
},
<div id="method-Ext.QuickTips-isEnabled"></div>/**
},
<div id="method-Ext.QuickTips-getQuickTip"></div>/**
- * Gets the global QuickTips instance.
+ * Gets the single {@link Ext.QuickTip QuickTip} instance used to show tips from all registered elements.
+ * @return {Ext.QuickTip}
*/
getQuickTip : function(){
return tip;
* Alias of {@link #register}.
* @param {Object} config The config object
*/
- tips :function(){
+ tips : function(){
tip.register.apply(tip, arguments);
}
- }
+ };
}();</pre>
</body>
</html>
\ No newline at end of file