Web UI for ARGUS server
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

91 lines
2.8 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>The source code</title>
  5. <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
  6. <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
  7. </head>
  8. <body onload="prettyPrint();">
  9. <pre class="prettyprint lang-js">/*!
  10. * Ext JS Library 3.3.1
  11. * Copyright(c) 2006-2010 Sencha Inc.
  12. * licensing@sencha.com
  13. * http://www.sencha.com/license
  14. */
  15. <div id="cls-Ext.tree.TreeDragZone"></div>/**
  16. * @class Ext.tree.TreeDragZone
  17. * @extends Ext.dd.DragZone
  18. * @constructor
  19. * @param {String/HTMLElement/Element} tree The {@link Ext.tree.TreePanel} for which to enable dragging
  20. * @param {Object} config
  21. */
  22. if(Ext.dd.DragZone){
  23. Ext.tree.TreeDragZone = function(tree, config){
  24. Ext.tree.TreeDragZone.superclass.constructor.call(this, tree.innerCt, config);
  25. <div id="prop-Ext.tree.TreeDragZone-tree"></div>/**
  26. * The TreePanel for this drag zone
  27. * @type Ext.tree.TreePanel
  28. * @property
  29. */
  30. this.tree = tree;
  31. };
  32. Ext.extend(Ext.tree.TreeDragZone, Ext.dd.DragZone, {
  33. <div id="cfg-Ext.tree.TreeDragZone-ddGroup"></div>/**
  34. * @cfg {String} ddGroup
  35. * A named drag drop group to which this object belongs. If a group is specified, then this object will only
  36. * interact with other drag drop objects in the same group (defaults to 'TreeDD').
  37. */
  38. ddGroup : "TreeDD",
  39. // private
  40. onBeforeDrag : function(data, e){
  41. var n = data.node;
  42. return n && n.draggable && !n.disabled;
  43. },
  44. // private
  45. onInitDrag : function(e){
  46. var data = this.dragData;
  47. this.tree.getSelectionModel().select(data.node);
  48. this.tree.eventModel.disable();
  49. this.proxy.update("");
  50. data.node.ui.appendDDGhost(this.proxy.ghost.dom);
  51. this.tree.fireEvent("startdrag", this.tree, data.node, e);
  52. },
  53. // private
  54. getRepairXY : function(e, data){
  55. return data.node.ui.getDDRepairXY();
  56. },
  57. // private
  58. onEndDrag : function(data, e){
  59. this.tree.eventModel.enable.defer(100, this.tree.eventModel);
  60. this.tree.fireEvent("enddrag", this.tree, data.node, e);
  61. },
  62. // private
  63. onValidDrop : function(dd, e, id){
  64. this.tree.fireEvent("dragdrop", this.tree, this.dragData.node, dd, e);
  65. this.hideProxy();
  66. },
  67. // private
  68. beforeInvalidDrop : function(e, id){
  69. // this scrolls the original position back into view
  70. var sm = this.tree.getSelectionModel();
  71. sm.clearSelections();
  72. sm.select(this.dragData.node);
  73. },
  74. // private
  75. afterRepair : function(){
  76. if (Ext.enableFx && this.tree.hlDrop) {
  77. Ext.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9");
  78. }
  79. this.dragging = false;
  80. }
  81. });
  82. }</pre>
  83. </body>
  84. </html>