Web Interface For Lite Argus Control modules
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.

131 lines
5.8 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  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.dd.DropTarget"></div>/**
  16. * @class Ext.dd.DropTarget
  17. * @extends Ext.dd.DDTarget
  18. * A simple class that provides the basic implementation needed to make any element a drop target that can have
  19. * draggable items dropped onto it. The drop has no effect until an implementation of notifyDrop is provided.
  20. * @constructor
  21. * @param {Mixed} el The container element
  22. * @param {Object} config
  23. */
  24. Ext.dd.DropTarget = Ext.extend(Ext.dd.DDTarget, {
  25. constructor : function(el, config){
  26. this.el = Ext.get(el);
  27. Ext.apply(this, config);
  28. if(this.containerScroll){
  29. Ext.dd.ScrollManager.register(this.el);
  30. }
  31. Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group,
  32. {isTarget: true});
  33. },
  34. <div id="cfg-Ext.dd.DropTarget-ddGroup"></div>/**
  35. * @cfg {String} ddGroup
  36. * A named drag drop group to which this object belongs. If a group is specified, then this object will only
  37. * interact with other drag drop objects in the same group (defaults to undefined).
  38. */
  39. <div id="cfg-Ext.dd.DropTarget-overClass"></div>/**
  40. * @cfg {String} overClass
  41. * The CSS class applied to the drop target element while the drag source is over it (defaults to "").
  42. */
  43. <div id="cfg-Ext.dd.DropTarget-dropAllowed"></div>/**
  44. * @cfg {String} dropAllowed
  45. * The CSS class returned to the drag source when drop is allowed (defaults to "x-dd-drop-ok").
  46. */
  47. dropAllowed : "x-dd-drop-ok",
  48. <div id="cfg-Ext.dd.DropTarget-dropNotAllowed"></div>/**
  49. * @cfg {String} dropNotAllowed
  50. * The CSS class returned to the drag source when drop is not allowed (defaults to "x-dd-drop-nodrop").
  51. */
  52. dropNotAllowed : "x-dd-drop-nodrop",
  53. // private
  54. isTarget : true,
  55. // private
  56. isNotifyTarget : true,
  57. <div id="method-Ext.dd.DropTarget-notifyEnter"></div>/**
  58. * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source is now over the
  59. * target. This default implementation adds the CSS class specified by overClass (if any) to the drop element
  60. * and returns the dropAllowed config value. This method should be overridden if drop validation is required.
  61. * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target
  62. * @param {Event} e The event
  63. * @param {Object} data An object containing arbitrary data supplied by the drag source
  64. * @return {String} status The CSS class that communicates the drop status back to the source so that the
  65. * underlying {@link Ext.dd.StatusProxy} can be updated
  66. */
  67. notifyEnter : function(dd, e, data){
  68. if(this.overClass){
  69. this.el.addClass(this.overClass);
  70. }
  71. return this.dropAllowed;
  72. },
  73. <div id="method-Ext.dd.DropTarget-notifyOver"></div>/**
  74. * The function a {@link Ext.dd.DragSource} calls continuously while it is being dragged over the target.
  75. * This method will be called on every mouse movement while the drag source is over the drop target.
  76. * This default implementation simply returns the dropAllowed config value.
  77. * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target
  78. * @param {Event} e The event
  79. * @param {Object} data An object containing arbitrary data supplied by the drag source
  80. * @return {String} status The CSS class that communicates the drop status back to the source so that the
  81. * underlying {@link Ext.dd.StatusProxy} can be updated
  82. */
  83. notifyOver : function(dd, e, data){
  84. return this.dropAllowed;
  85. },
  86. <div id="method-Ext.dd.DropTarget-notifyOut"></div>/**
  87. * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the source has been dragged
  88. * out of the target without dropping. This default implementation simply removes the CSS class specified by
  89. * overClass (if any) from the drop element.
  90. * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target
  91. * @param {Event} e The event
  92. * @param {Object} data An object containing arbitrary data supplied by the drag source
  93. */
  94. notifyOut : function(dd, e, data){
  95. if(this.overClass){
  96. this.el.removeClass(this.overClass);
  97. }
  98. },
  99. <div id="method-Ext.dd.DropTarget-notifyDrop"></div>/**
  100. * The function a {@link Ext.dd.DragSource} calls once to notify this drop target that the dragged item has
  101. * been dropped on it. This method has no default implementation and returns false, so you must provide an
  102. * implementation that does something to process the drop event and returns true so that the drag source's
  103. * repair action does not run.
  104. * @param {Ext.dd.DragSource} source The drag source that was dragged over this drop target
  105. * @param {Event} e The event
  106. * @param {Object} data An object containing arbitrary data supplied by the drag source
  107. * @return {Boolean} True if the drop was valid, else false
  108. */
  109. notifyDrop : function(dd, e, data){
  110. return false;
  111. },
  112. destroy : function(){
  113. Ext.dd.DropTarget.superclass.destroy.call(this);
  114. if(this.containerScroll){
  115. Ext.dd.ScrollManager.unregister(this.el);
  116. }
  117. }
  118. });</pre>
  119. </body>
  120. </html>