TipSurface.html 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>The source code</title>
  6. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  7. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  8. <style type="text/css">
  9. .highlight { display: block; background-color: #ddd; }
  10. </style>
  11. <script type="text/javascript">
  12. function highlight() {
  13. document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
  14. }
  15. </script>
  16. </head>
  17. <body onload="prettyPrint(); highlight();">
  18. <pre class="prettyprint lang-js"><span id='Ext-chart-TipSurface'>/**
  19. </span> * @private
  20. */
  21. Ext.define('Ext.chart.TipSurface', {
  22. /* Begin Definitions */
  23. extend: 'Ext.draw.Component',
  24. /* End Definitions */
  25. spriteArray: false,
  26. renderFirst: true,
  27. constructor: function(config) {
  28. this.callParent([config]);
  29. if (config.sprites) {
  30. this.spriteArray = [].concat(config.sprites);
  31. delete config.sprites;
  32. }
  33. },
  34. onRender: function() {
  35. var me = this,
  36. i = 0,
  37. l = 0,
  38. sp,
  39. sprites;
  40. this.callParent(arguments);
  41. sprites = me.spriteArray;
  42. if (me.renderFirst &amp;&amp; sprites) {
  43. me.renderFirst = false;
  44. for (l = sprites.length; i &lt; l; i++) {
  45. sp = me.surface.add(sprites[i]);
  46. sp.setAttributes({
  47. hidden: false
  48. },
  49. true);
  50. }
  51. }
  52. }
  53. });
  54. </pre>
  55. </body>
  56. </html>