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.tree.ViewDragZone', {
19 extend: 'Ext.view.DragZone',
21 isPreventDrag: function(e, record) {
22 return (record.get('allowDrag') === false) || !!e.getTarget(this.view.expanderSelector);
25 afterRepair: function() {
28 selectedRowCls = view.selectedItemCls,
29 records = me.dragData.records,
32 if (Ext.enableFx && me.repairHighlight) {
33 // Roll through all records and highlight all the ones we attempted to drag.
34 Ext.Array.forEach(records, function(record) {
35 // anonymous fns below, don't hoist up unless below is wrapped in
36 // a self-executing function passing in item.
37 var item = view.getNode(record);
39 // We must remove the selected row class before animating, because
40 // the selected row class declares !important on its background-color.
41 fly(item.firstChild).highlight(me.repairHighlightColor, {
43 beforeanimate: function() {
44 if (view.isSelected(item)) {
45 fly(item).removeCls(selectedRowCls);
48 afteranimate: function() {
49 if (view.isSelected(item)) {
50 fly(item).addCls(selectedRowCls);