1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-tip.QuickTipManager'>/**
2 </span> * @class Ext.tip.QuickTipManager
4 * Provides attractive and customizable tooltips for any element. The QuickTips
5 * singleton is used to configure and manage tooltips globally for multiple elements
6 * in a generic manner. To create individual tooltips with maximum customizability,
7 * you should consider either {@link Ext.tip.Tip} or {@link Ext.tip.ToolTip}.
9 * Quicktips can be configured via tag attributes directly in markup, or by
10 * registering quick tips programmatically via the {@link #register} method.
12 * The singleton's instance of {@link Ext.tip.QuickTip} is available via
13 * {@link #getQuickTip}, and supports all the methods, and all the all the
14 * configuration properties of Ext.tip.QuickTip. These settings will apply to all
15 * tooltips shown by the singleton.
17 * Below is the summary of the configuration properties which can be used.
18 * For detailed descriptions see the config options for the {@link Ext.tip.QuickTip QuickTip} class
20 * ## QuickTips singleton configs (all are optional)
29 * ## Target element configs (optional unless otherwise noted)
33 * - `dismissDelay` (overrides singleton value)
34 * - `target` (required)
39 * Here is an example showing how some of these config options could be used:
41 * {@img Ext.tip.QuickTipManager/Ext.tip.QuickTipManager.png Ext.tip.QuickTipManager component}
45 * // Init the singleton. Any tag-based quick tips will start working.
46 * Ext.tip.QuickTipManager.init();
48 * // Apply a set of config properties to the singleton
49 * Ext.apply(Ext.tip.QuickTipManager.getQuickTip(), {
52 * showDelay: 50 // Show 50ms after entering target
55 * // Create a small panel to add a quick tip to
56 * Ext.create('Ext.container.Container', {
57 * id: 'quickTipContainer',
61 * backgroundColor:'#000000'
63 * renderTo: Ext.getBody()
67 * // Manually register a quick tip for a specific element
68 * Ext.tip.QuickTipManager.register({
69 * target: 'quickTipContainer',
70 * title: 'My Tooltip',
71 * text: 'This tooltip was added in code',
73 * dismissDelay: 10000 // Hide after 10 seconds hover
76 * To register a quick tip in markup, you simply add one or more of the valid QuickTip attributes prefixed with
77 * the **ext** namespace. The HTML element itself is automatically set as the quick tip target. Here is the summary
78 * of supported attributes (optional unless otherwise noted):
80 * - `hide`: Specifying "user" is equivalent to setting autoHide = false. Any other value will be the same as autoHide = true.
81 * - `qclass`: A CSS class to be applied to the quick tip (equivalent to the 'cls' target element config).
82 * - `qtip (required)`: The quick tip text (equivalent to the 'text' target element config).
83 * - `qtitle`: The quick tip title (equivalent to the 'title' target element config).
84 * - `qwidth`: The quick tip width (equivalent to the 'width' target element config).
86 * Here is an example of configuring an HTML element to display a tooltip from markup:
88 * // Add a quick tip to an HTML button
89 * &lt;input type="button" value="OK" ext:qtitle="OK Button" ext:qwidth="100"
90 * data-qtip="This is a quick tip from markup!">&lt;/input>
94 Ext.define('Ext.tip.QuickTipManager', function() {
99 requires: ['Ext.tip.QuickTip'],
101 alternateClassName: 'Ext.QuickTips',
102 <span id='Ext-tip.QuickTipManager-method-init'> /**
103 </span> * Initialize the global QuickTips instance and prepare any quick tips.
104 * @param {Boolean} autoRender True to render the QuickTips container immediately to preload images. (Defaults to true)
106 init : function(autoRender){
109 Ext.onReady(function(){
110 Ext.tip.QuickTipManager.init(autoRender);
114 tip = Ext.create('Ext.tip.QuickTip', {
116 renderTo: autoRender !== false ? document.body : undefined
121 <span id='Ext-tip.QuickTipManager-method-destroy'> /**
122 </span> * Destroy the QuickTips instance.
124 destroy: function() {
132 // Protected method called by the dd classes
133 ddDisable : function(){
134 // don't disable it if we don't need to
135 if(tip && !disabled){
140 // Protected method called by the dd classes
141 ddEnable : function(){
142 // only enable it if it hasn't been disabled
143 if(tip && !disabled){
148 <span id='Ext-tip.QuickTipManager-method-enable'> /**
149 </span> * Enable quick tips globally.
158 <span id='Ext-tip.QuickTipManager-method-disable'> /**
159 </span> * Disable quick tips globally.
161 disable : function(){
168 <span id='Ext-tip.QuickTipManager-method-isEnabled'> /**
169 </span> * Returns true if quick tips are enabled, else false.
172 isEnabled : function(){
173 return tip !== undefined && !tip.disabled;
176 <span id='Ext-tip.QuickTipManager-method-getQuickTip'> /**
177 </span> * Gets the single {@link Ext.tip.QuickTip QuickTip} instance used to show tips from all registered elements.
178 * @return {Ext.tip.QuickTip}
180 getQuickTip : function(){
184 <span id='Ext-tip.QuickTipManager-method-register'> /**
185 </span> * Configures a new quick tip instance and assigns it to a target element. See
186 * {@link Ext.tip.QuickTip#register} for details.
187 * @param {Object} config The config object
189 register : function(){
190 tip.register.apply(tip, arguments);
193 <span id='Ext-tip.QuickTipManager-method-unregister'> /**
194 </span> * Removes any registered quick tip from the target element and destroys it.
195 * @param {String/HTMLElement/Element} el The element from which the quick tip is to be removed.
197 unregister : function(){
198 tip.unregister.apply(tip, arguments);
201 <span id='Ext-tip.QuickTipManager-method-tips'> /**
202 </span> * Alias of {@link #register}.
203 * @param {Object} config The config object
206 tip.register.apply(tip, arguments);
209 }());</pre></pre></body></html>