MaskLayer.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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-MaskLayer'>/**
  19. </span> * @private
  20. */
  21. Ext.define('Ext.chart.MaskLayer', {
  22. extend: 'Ext.Component',
  23. constructor: function(config) {
  24. config = Ext.apply(config || {}, {
  25. style: 'position:absolute;background-color:#888;cursor:move;opacity:0.6;border:1px solid #222;'
  26. });
  27. this.callParent([config]);
  28. },
  29. initComponent: function() {
  30. var me = this;
  31. me.callParent(arguments);
  32. me.addEvents(
  33. 'mousedown',
  34. 'mouseup',
  35. 'mousemove',
  36. 'mouseenter',
  37. 'mouseleave'
  38. );
  39. },
  40. initDraggable: function() {
  41. this.callParent(arguments);
  42. this.dd.onStart = function (e) {
  43. var me = this,
  44. comp = me.comp;
  45. // Cache the start [X, Y] array
  46. this.startPosition = comp.getPosition(true);
  47. // If client Component has a ghost method to show a lightweight version of itself
  48. // then use that as a drag proxy unless configured to liveDrag.
  49. if (comp.ghost &amp;&amp; !comp.liveDrag) {
  50. me.proxy = comp.ghost();
  51. me.dragTarget = me.proxy.header.el;
  52. }
  53. // Set the constrainTo Region before we start dragging.
  54. if (me.constrain || me.constrainDelegate) {
  55. me.constrainTo = me.calculateConstrainRegion();
  56. }
  57. };
  58. }
  59. });</pre>
  60. </body>
  61. </html>