1// Name: FloatingBehavior.debug.js 2// Assembly: AjaxControlToolkit 3// Version: 17.1.1.0 4// FileVersion: 17.1.1.0 5Sys.Extended.UI.FloatingBehavior = function(element) { 6 Sys.Extended.UI.FloatingBehavior.initializeBase(this, [element]); 7 8 var _handle, 9 _location, 10 _dragStartLocation, 11 _profileProperty, 12 _profileComponent; 13 14 var _mouseDownHandler = Function.createDelegate(this, mouseDownHandler); 15 16 ///<summary> 17 /// Move event handler. 18 ///</summary> 19 ///<member name="cE:AjaxControlToolkit.DragPanelExtender.move" /> 20 ///<event add="add_move" remove="remove_move" /> 21 this.add_move = function(handler) { 22 this.get_events().addHandler('move', handler); 23 } 24 this.remove_move = function(handler) { 25 this.get_events().removeHandler('move', handler); 26 } 27 28 ///<summary> 29 /// Handles to drag the panel around. 30 ///</summary> 31 ///<getter>get_handle</getter> 32 ///<setter>set_handle</setter> 33 ///<member name="cP:AjaxControlToolkit.DragPanelExtender.handle" /> 34 this.get_handle = function() { 35 return _handle; 36 } 37 this.set_handle = function(value) { 38 if(_handle != null) 39 $removeHandler(_handle, "mousedown", _mouseDownHandler); 40 41 _handle = value; 42 $addHandler(_handle, "mousedown", _mouseDownHandler); 43 } 44 45 this.get_profileProperty = function() { 46 return _profileProperty; 47 } 48 this.set_profileProperty = function(value) { 49 _profileProperty = value; 50 } 51 52 this.get_profileComponent = function() { 53 return _profileComponent; 54 } 55 this.set_profileComponent = function(value) { 56 _profileComponent = value; 57 } 58 59 ///<summary> 60 /// Defines the location of an element being dragged. 61 ///</summary> 62 ///<getter>get_location</getter> 63 ///<setter>set_location</setter> 64 ///<member name="cP:AjaxControlToolkit.DragPanelExtender.location" /> 65 this.get_location = function() { 66 return _location; 67 } 68 this.set_location = function(value) { 69 if(_location != value) { 70 _location = value; 71 72 if(this.get_isInitialized()) 73 $common.setLocation(this.get_element(), _location); 74 75 this.raisePropertyChanged('location'); 76 } 77 } 78 79 this.initialize = function() { 80 Sys.Extended.UI.FloatingBehavior.callBaseMethod(this, 'initialize'); 81 Sys.Extended.UI.DragDropManager.registerDropTarget(this); 82 83 var el = this.get_element(); 84 85 if(!_location) 86 _location = $common.getLocation(el); 87 88 el.style.position = "fixed"; 89 $common.setLocation(el, _location); 90 } 91 92 this.dispose = function() { 93 Sys.Extended.UI.DragDropManager.unregisterDropTarget(this); 94 if(_handle && _mouseDownHandler) 95 $removeHandler(_handle, "mousedown", _mouseDownHandler); 96 97 _mouseDownHandler = null; 98 Sys.Extended.UI.FloatingBehavior.callBaseMethod(this, 'dispose'); 99 } 100 101 this.checkCanDrag = function(element) { 102 var undraggableTagNames = ["input", "button", "select", "textarea", "label"], 103 tagName = element.tagName; 104 105 if((tagName.toLowerCase() == "a") && (element.href != null) && (element.href.length > 0)) 106 return false; 107 108 if(Array.indexOf(undraggableTagNames, tagName.toLowerCase()) > -1) 109 return false; 110 111 return true; 112 } 113 114 function mouseDownHandler(ev) { 115 window._event = ev; 116 var el = this.get_element(); 117 118 if(this.checkCanDrag(ev.target)) { 119 _dragStartLocation = $common.getLocation(el); 120 121 ev.preventDefault(); 122 123 this.startDragDrop(el); 124 } 125 } 126 127 // Type get_dataType() 128 this.get_dragDataType = function() { 129 return "_floatingObject"; 130 } 131 132 // Object get_data(Context) 133 this.getDragData = function(context) { 134 return null; 135 } 136 137 // DragMode get_dragMode() 138 this.get_dragMode = function() { 139 return Sys.Extended.UI.DragMode.Move; 140 } 141 142 // void onDragStart() 143 this.onDragStart = function() { } 144 145 // void onDrag() 146 this.onDrag = function() { } 147 148 this.onDragEnd = function(canceled) { 149 if(!canceled) { 150 var handler = this.get_events().getHandler('move'); 151 152 if(handler) { 153 var cancelArgs = new Sys.CancelEventArgs(); 154 155 handler(this, cancelArgs); 156 canceled = cancelArgs.get_cancel(); 157 } 158 } 159
160 var el = this.get_element(); 161 if(canceled) { 162 // Restore the position of the control. 163 $common.setLocation(el, _dragStartLocation); 164 } else { 165 _location = $common.getLocation(el); 166 this.raisePropertyChanged('location'); 167 } 168 } 169 170 this.startDragDrop = function(dragVisual) { 171 Sys.Extended.UI.DragDropManager.startDragDrop(this, dragVisual, null); 172 } 173 174 this.get_dropTargetElement = function() { 175 return document.body; 176 } 177 178 // bool canDrop(DragMode, DataType, Data) 179 this.canDrop = function(dragMode, dataType, data) { 180 return (dataType == "_floatingObject"); 181 } 182 183 // void drop(DragMode, DataType, Data) 184 this.drop = function(dragMode, dataType, data) { } 185 186 // void onDragEnterTarget(DragMode, DataType, Data) 187 this.onDragEnterTarget = function(dragMode, dataType, data) { } 188 189 // void onDragLeaveTarget(DragMode, DataType, Data) 190 this.onDragLeaveTarget = function(dragMode, dataType, data) { } 191 192 // void onDragInTarget(DragMode, DataType, Data) 193 this.onDragInTarget = function(dragMode, dataType, data) { } 194} 195 196Sys.Extended.UI.FloatingBehavior.registerClass('Sys.Extended.UI.FloatingBehavior', Sys.Extended.UI.BehaviorBase, Sys.Extended.UI.IDragSource, Sys.Extended.UI.IDropTarget, Sys.IDisposable);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.