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; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js">Ext.define('Ext.chart.MaskLayer', {
19 extend: 'Ext.Component',
21 constructor: function(config) {
22 config = Ext.apply(config || {}, {
23 style: 'position:absolute;background-color:#888;cursor:move;opacity:0.6;border:1px solid #222;'
25 this.callParent([config]);
28 initComponent: function() {
30 me.callParent(arguments);
40 initDraggable: function() {
41 this.callParent(arguments);
42 this.dd.onStart = function (e) {
46 // Cache the start [X, Y] array
47 this.startPosition = comp.getPosition(true);
49 // If client Component has a ghost method to show a lightweight version of itself
50 // then use that as a drag proxy unless configured to liveDrag.
51 if (comp.ghost && !comp.liveDrag) {
52 me.proxy = comp.ghost();
53 me.dragTarget = me.proxy.header.el;
56 // Set the constrainTo Region before we start dragging.
57 if (me.constrain || me.constrainDelegate) {
58 me.constrainTo = me.calculateConstrainRegion();