tvheadend/vendor/ext-3.4.1/docs/source/TreeDragZone.html
Adam Sutton bafcfff42d webui: restructure webui/extjs source files
I want to keep the 3rd-party packages away from the main source
where possible.
2013-06-03 17:11:01 +01:00

95 lines
3.1 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The source code</title>
<link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="../resources/prettify/prettify.js"></script>
<style type="text/css">
.highlight { display: block; background-color: #ddd; }
</style>
<script type="text/javascript">
function highlight() {
document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
}
</script>
</head>
<body onload="prettyPrint(); highlight();">
<pre class="prettyprint lang-js"><span id='Ext-tree-TreeDragZone-method-constructor'><span id='Ext-tree-TreeDragZone'>/**
</span></span> * @class Ext.tree.TreeDragZone
* @extends Ext.dd.DragZone
* @constructor
* @param {String/HTMLElement/Element} tree The {@link Ext.tree.TreePanel} for which to enable dragging
* @param {Object} config
*/
if(Ext.dd.DragZone){
Ext.tree.TreeDragZone = function(tree, config){
Ext.tree.TreeDragZone.superclass.constructor.call(this, tree.innerCt, config);
<span id='Ext-tree-TreeDragZone-property-tree'> /**
</span> * The TreePanel for this drag zone
* @type Ext.tree.TreePanel
* @property
*/
this.tree = tree;
};
Ext.extend(Ext.tree.TreeDragZone, Ext.dd.DragZone, {
<span id='Ext-tree-TreeDragZone-cfg-ddGroup'> /**
</span> * @cfg {String} ddGroup
* A named drag drop group to which this object belongs. If a group is specified, then this object will only
* interact with other drag drop objects in the same group (defaults to 'TreeDD').
*/
ddGroup : &quot;TreeDD&quot;,
// private
onBeforeDrag : function(data, e){
var n = data.node;
return n &amp;&amp; n.draggable &amp;&amp; !n.disabled;
},
// private
onInitDrag : function(e){
var data = this.dragData;
this.tree.getSelectionModel().select(data.node);
this.tree.eventModel.disable();
this.proxy.update(&quot;&quot;);
data.node.ui.appendDDGhost(this.proxy.ghost.dom);
this.tree.fireEvent(&quot;startdrag&quot;, this.tree, data.node, e);
},
// private
getRepairXY : function(e, data){
return data.node.ui.getDDRepairXY();
},
// private
onEndDrag : function(data, e){
this.tree.eventModel.enable.defer(100, this.tree.eventModel);
this.tree.fireEvent(&quot;enddrag&quot;, this.tree, data.node, e);
},
// private
onValidDrop : function(dd, e, id){
this.tree.fireEvent(&quot;dragdrop&quot;, this.tree, this.dragData.node, dd, e);
this.hideProxy();
},
// private
beforeInvalidDrop : function(e, id){
// this scrolls the original position back into view
var sm = this.tree.getSelectionModel();
sm.clearSelections();
sm.select(this.dragData.node);
},
// private
afterRepair : function(){
if (Ext.enableFx &amp;&amp; this.tree.hlDrop) {
Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || &quot;c3daf9&quot;);
}
this.dragging = false;
}
});
}</pre>
</body>
</html>