1// Name: DragPanel.FloatingBehavior.debug.js 2// Assembly: AjaxControlToolkit 3// Version: 4.1.7.607 4// FileVersion: 4.1.7.0607 5// (c) 2010 CodePlex Foundation 6 7 8 9/// <reference name="MicrosoftAjax.debug.js" /> 10/// <reference path="../ExtenderBase/BaseScripts.js" /> 11/// <reference path="../Common/Common.js" /> 12/// <reference path="../Compat/DragDrop/DragDropScripts.js" /> 13 14(function() { 15var scriptName = "ExtendedFloating"; 16 17function execute() { 18 19Sys.Extended.UI.FloatingBehavior = function(element) { 20 Sys.Extended.UI.FloatingBehavior.initializeBase(this,[element]); 21 22 var _handle; 23 var _location; 24 var _dragStartLocation; 25 var _profileProperty; 26 var _profileComponent; 27 28 var _mouseDownHandler = Function.createDelegate(this, mouseDownHandler); 29 30 this.add_move = function(handler) { 31 this.get_events().addHandler('move', handler); 32 } 33 this.remove_move = function(handler) { 34 this.get_events().removeHandler('move', handler); 35 } 36 37 this.get_handle = function() { 38 return _handle; 39 } 40 this.set_handle = function(value) { 41 if (_handle != null) { 42 $removeHandler(_handle, "mousedown", _mouseDownHandler); 43 } 44 45 _handle = value; 46 $addHandler(_handle, "mousedown", _mouseDownHandler); 47 } 48 49 this.get_profileProperty = function() { 50 return _profileProperty; 51 } 52 this.set_profileProperty = function(value) { 53 _profileProperty = value; 54 } 55 56 this.get_profileComponent = function() { 57 return _profileComponent; 58 } 59 this.set_profileComponent = function(value) { 60 _profileComponent = value; 61 } 62 63 this.get_location = function() { 64 return _location; 65 } 66 this.set_location = function(value) { 67 if (_location != value) { 68 _location = value; 69 if (this.get_isInitialized()) { 70 $common.setLocation(this.get_element(), _location); 71 } 72 this.raisePropertyChanged('location'); 73 } 74 } 75 76 this.initialize = function() { 77 Sys.Extended.UI.FloatingBehavior.callBaseMethod(this, 'initialize'); 78 Sys.Extended.UI.DragDropManager.registerDropTarget(this); 79 80 var el = this.get_element(); 81 82 if (!_location) { 83 _location = $common.getLocation(el); 84 } 85 86 el.style.position = "fixed"; 87 $common.setLocation(el, _location); 88 } 89 90 this.dispose = function() { 91 Sys.Extended.UI.DragDropManager.unregisterDropTarget(this); 92 if (_handle && _mouseDownHandler) { 93 $removeHandler(_handle, "mousedown", _mouseDownHandler); 94 } 95 _mouseDownHandler = null; 96 Sys.Extended.UI.FloatingBehavior.callBaseMethod(this, 'dispose'); 97 } 98 99 this.checkCanDrag = function(element) { 100 var undraggableTagNames = ["input", "button", "select", "textarea", "label"]; 101 var tagName = element.tagName; 102 103 if ((tagName.toLowerCase() == "a") && (element.href != null) && (element.href.length > 0)) { 104 return false; 105 } 106 if (Array.indexOf(undraggableTagNames, tagName.toLowerCase()) > -1) { 107 return false; 108 } 109 return true; 110 } 111 112 function mouseDownHandler(ev) { 113 window._event = ev; 114 var el = this.get_element(); 115 116 if (this.checkCanDrag(ev.target)) { 117 _dragStartLocation = $common.getLocation(el); 118 119 ev.preventDefault(); 120 121 this.startDragDrop(el); 122 } 123 } 124 125 this.get_dragDataType = function() { 126 return "_floatingObject"; 127 } 128 129 this.getDragData = function(context) { 130 return null; 131 } 132 133 this.get_dragMode = function() { 134 return Sys.Extended.UI.DragMode.Move; 135 } 136 137 this.onDragStart = function() { } 138 139 this.onDrag = function() { } 140 141 this.onDragEnd = function(canceled) { 142 if (!canceled) { 143 var handler = this.get_events().getHandler('move'); 144 if(handler) { 145 var cancelArgs = new Sys.CancelEventArgs(); 146 handler(this, cancelArgs); 147 canceled = cancelArgs.get_cancel(); 148 } 149 } 150
151 var el = this.get_element(); 152 if (canceled) { 153 $common.setLocation(el, _dragStartLocation); 154 } else { 155 _location = $common.getLocation(el); 156 this.raisePropertyChanged('location'); 157 } 158 } 159 160 this.startDragDrop = function(dragVisual) { 161 Sys.Extended.UI.DragDropManager.startDragDrop(this, dragVisual, null); 162 } 163 164 this.get_dropTargetElement = function() { 165 return document.body; 166 } 167 168 this.canDrop = function(dragMode, dataType, data) { 169 return (dataType == "_floatingObject"); 170 } 171 172 this.drop = function(dragMode, dataType, data) {} 173 174 this.onDragEnterTarget = function(dragMode, dataType, data) {} 175 176 this.onDragLeaveTarget = function(dragMode, dataType, data) {} 177 178 this.onDragInTarget = function(dragMode, dataType, data) {} 179} 180Sys.Extended.UI.FloatingBehavior.registerClass('Sys.Extended.UI.FloatingBehavior', Sys.Extended.UI.BehaviorBase, Sys.Extended.UI.IDragSource, Sys.Extended.UI.IDropTarget, Sys.IDisposable); 181Sys.registerComponent(Sys.Extended.UI.FloatingBehavior, { name: "draggable" }); 182 183} // execute 184 185if (window.Sys && Sys.loader) { 186 Sys.loader.registerScript(scriptName, ["ExtendedBase", "ExtendedCommon", "ExtendedDragDrop"], execute); 187} 188else { 189 execute(); 190} 191 192})();
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.