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.

167 lines
5.0 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.dd.PanelProxy"></div>/**
  16. * @class Ext.dd.PanelProxy
  17. * A custom drag proxy implementation specific to {@link Ext.Panel}s. This class is primarily used internally
  18. * for the Panel's drag drop implementation, and should never need to be created directly.
  19. * @constructor
  20. * @param panel The {@link Ext.Panel} to proxy for
  21. * @param config Configuration options
  22. */
  23. Ext.dd.PanelProxy = Ext.extend(Object, {
  24. constructor : function(panel, config){
  25. this.panel = panel;
  26. this.id = this.panel.id +'-ddproxy';
  27. Ext.apply(this, config);
  28. },
  29. <div id="cfg-Ext.dd.PanelProxy-insertProxy"></div>/**
  30. * @cfg {Boolean} insertProxy True to insert a placeholder proxy element while dragging the panel,
  31. * false to drag with no proxy (defaults to true).
  32. */
  33. insertProxy : true,
  34. // private overrides
  35. setStatus : Ext.emptyFn,
  36. reset : Ext.emptyFn,
  37. update : Ext.emptyFn,
  38. stop : Ext.emptyFn,
  39. sync: Ext.emptyFn,
  40. <div id="method-Ext.dd.PanelProxy-getEl"></div>/**
  41. * Gets the proxy's element
  42. * @return {Element} The proxy's element
  43. */
  44. getEl : function(){
  45. return this.ghost;
  46. },
  47. <div id="method-Ext.dd.PanelProxy-getGhost"></div>/**
  48. * Gets the proxy's ghost element
  49. * @return {Element} The proxy's ghost element
  50. */
  51. getGhost : function(){
  52. return this.ghost;
  53. },
  54. <div id="method-Ext.dd.PanelProxy-getProxy"></div>/**
  55. * Gets the proxy's element
  56. * @return {Element} The proxy's element
  57. */
  58. getProxy : function(){
  59. return this.proxy;
  60. },
  61. <div id="method-Ext.dd.PanelProxy-hide"></div>/**
  62. * Hides the proxy
  63. */
  64. hide : function(){
  65. if(this.ghost){
  66. if(this.proxy){
  67. this.proxy.remove();
  68. delete this.proxy;
  69. }
  70. this.panel.el.dom.style.display = '';
  71. this.ghost.remove();
  72. delete this.ghost;
  73. }
  74. },
  75. <div id="method-Ext.dd.PanelProxy-show"></div>/**
  76. * Shows the proxy
  77. */
  78. show : function(){
  79. if(!this.ghost){
  80. this.ghost = this.panel.createGhost(this.panel.initialConfig.cls, undefined, Ext.getBody());
  81. this.ghost.setXY(this.panel.el.getXY());
  82. if(this.insertProxy){
  83. this.proxy = this.panel.el.insertSibling({cls:'x-panel-dd-spacer'});
  84. this.proxy.setSize(this.panel.getSize());
  85. }
  86. this.panel.el.dom.style.display = 'none';
  87. }
  88. },
  89. // private
  90. repair : function(xy, callback, scope){
  91. this.hide();
  92. if(typeof callback == "function"){
  93. callback.call(scope || this);
  94. }
  95. },
  96. <div id="method-Ext.dd.PanelProxy-moveProxy"></div>/**
  97. * Moves the proxy to a different position in the DOM. This is typically called while dragging the Panel
  98. * to keep the proxy sync'd to the Panel's location.
  99. * @param {HTMLElement} parentNode The proxy's parent DOM node
  100. * @param {HTMLElement} before (optional) The sibling node before which the proxy should be inserted (defaults
  101. * to the parent's last child if not specified)
  102. */
  103. moveProxy : function(parentNode, before){
  104. if(this.proxy){
  105. parentNode.insertBefore(this.proxy.dom, before);
  106. }
  107. }
  108. });
  109. // private - DD implementation for Panels
  110. Ext.Panel.DD = Ext.extend(Ext.dd.DragSource, {
  111. constructor : function(panel, cfg){
  112. this.panel = panel;
  113. this.dragData = {panel: panel};
  114. this.proxy = new Ext.dd.PanelProxy(panel, cfg);
  115. Ext.Panel.DD.superclass.constructor.call(this, panel.el, cfg);
  116. var h = panel.header,
  117. el = panel.body;
  118. if(h){
  119. this.setHandleElId(h.id);
  120. el = panel.header;
  121. }
  122. el.setStyle('cursor', 'move');
  123. this.scroll = false;
  124. },
  125. showFrame: Ext.emptyFn,
  126. startDrag: Ext.emptyFn,
  127. b4StartDrag: function(x, y) {
  128. this.proxy.show();
  129. },
  130. b4MouseDown: function(e) {
  131. var x = e.getPageX(),
  132. y = e.getPageY();
  133. this.autoOffset(x, y);
  134. },
  135. onInitDrag : function(x, y){
  136. this.onStartDrag(x, y);
  137. return true;
  138. },
  139. createFrame : Ext.emptyFn,
  140. getDragEl : function(e){
  141. return this.proxy.ghost.dom;
  142. },
  143. endDrag : function(e){
  144. this.proxy.hide();
  145. this.panel.saveState();
  146. },
  147. autoOffset : function(x, y) {
  148. x -= this.startPageX;
  149. y -= this.startPageY;
  150. this.setDelta(x, y);
  151. }
  152. });</pre>
  153. </body>
  154. </html>