Picker.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /**
  2. * @class Ext.ux.rating.Picker
  3. */
  4. Ext.define('Ext.ux.overrides.rating.Picker', {
  5. override: 'Ext.ux.rating.Picker',
  6. //<debug>
  7. initConfig: function (config) {
  8. if (config && config.tooltip) {
  9. config.tip = config.tooltip;
  10. Ext.log.warn('[Ext.ux.rating.Picker] The "tooltip" config was replaced by "tip"');
  11. }
  12. this.callParent([ config ]);
  13. },
  14. //</debug>
  15. updateTooltipText: function (text) {
  16. var innerEl = this.innerEl,
  17. QuickTips = Ext.tip && Ext.tip.QuickTipManager,
  18. tip = QuickTips && QuickTips.tip,
  19. target;
  20. if (QuickTips) {
  21. innerEl.dom.setAttribute('data-qtip', text);
  22. this.trackerEl.dom.setAttribute('data-qtip', text);
  23. // If the QuickTipManager is active over our widget, we need to update
  24. // the tooltip text directly.
  25. target = tip && tip.activeTarget;
  26. target = target && target.el;
  27. if (target && innerEl.contains(target)) {
  28. tip.update(text);
  29. }
  30. }
  31. }
  32. });