1var __aspxPCWIdSuffix = "_PW"; 2function ASPxPCResizeCursorInfo(horizontalDirection, verticalDirection, horizontalOffset, verticalOffset) { 3 this.horizontalDirection = horizontalDirection; 4 this.verticalDirection = verticalDirection; 5 this.horizontalOffset = horizontalOffset; 6 this.verticalOffset = verticalOffset; 7 this.course = verticalDirection + horizontalDirection; 8} 9ASPxClientPopupControlCssClasses = {}; 10ASPxClientPopupControlCssClasses.Prefix = "dxpc-"; 11ASPxClientPopupControlCssClasses.SizeGripLiteCssClassName = ASPxClientPopupControlCssClasses.Prefix + "sizeGrip"; 12ASPxClientPopupControlCssClasses.LinkCssClassName = ASPxClientPopupControlCssClasses.Prefix + "link"; 13ASPxClientPopupControlCssClasses.ShadowLiteCssClassName = ASPxClientPopupControlCssClasses.Prefix + "shadow"; 14ASPxClientPopupControlCssClasses.MainDivLiteCssClass = ASPxClientPopupControlCssClasses.Prefix + "mainDiv"; 15ASPxClientPopupControlCssClasses.ContentWrapperCssClassName = ASPxClientPopupControlCssClasses.Prefix + "contentWrapper"; 16ASPxClientPopupControlCssClasses.ContentCssClassName = ASPxClientPopupControlCssClasses.Prefix + "content"; 17ASPxClientPopupControl = _aspxCreateClass(ASPxClientControl, { 18 constructor: function(name) { 19 this.constructor.prototype.constructor.call(this, name); 20 this.leadingAfterInitCall = true; 21 this.adjustInnerControlsSizeOnShow = true; 22 this.slideAnimationDuration = 80; 23 this.fadeAnimationDuration = 400; 24 this.appearAfter = 300; 25 this.disappearAfter = 500; 26 this.allowResize = false; 27 this.popupAnimationType = "none"; 28 this.closeAnimationType = "none"; 29 this.enableAnimation = true; 30 this.animationLockCount = 0; 31 this.shadowVisible = true; 32 this.allowCorrectYOffsetPosition = true; 33 this.contentUrl = ""; 34 this.contentUrlArray = []; 35 this.contentLoadingMode = "Default" 36 this.loadingPanels = []; 37 this.loadingDivs = []; 38 this.lpTimers = []; 39 this.windowRequestCount = []; 40 this.callbackAnimationProcessings = []; 41 this.savedCallbackResults = []; 42 this.isCallbackFinishedStates = []; 43 this.savedCallbackWindowIndex = null; 44 this.cookieName = ""; 45 this.closeAction = "OuterMouseClick"; 46 this.popupAction = "LeftMouseClick"; 47 this.closeActionArray = []; 48 this.popupActionArray = []; 49 this.windowsPopupElementIDList = []; 50 this.windowsPopupElementList = []; 51 this.windowsLastUsedPopupElementInfoList = []; 52 this.windowsIsPopupedList = []; 53 this.windowsPopupReasonMouseEventList = []; 54 this.defaultWindowPopupElementIDList = []; 55 this.defaultWindowPopupElementList = []; 56 this.defaultLastUsedPopupElementInfo = {}; 57 this.defaultIsPopuped = false; 58 this.defaultPopupReasonMouseEvent = null; 59 this.showOnPageLoad = false; 60 this.showOnPageLoadArray = []; 61 this.popupHorizontalAlign = ASPxClientPopupUtils.NotSetAlignIndicator; 62 this.popupVerticalAlign = ASPxClientPopupUtils.NotSetAlignIndicator; 63 this.popupHorizontalOffset = 0; 64 this.popupVerticalOffset = 0; 65 this.windows = []; 66 this.windowCount = 0; 67 this.isDragged = false; 68 this.isResized = false; 69 this.zIndex = -1; 70 this.left = 0; 71 this.top = 0; 72 this.iframeLoading = false; 73 this.isDraggedArray = []; 74 this.isResizedArray = []; 75 this.zIndexArray = []; 76 this.leftArray = []; 77 this.topArray = []; 78 this.height = 0; 79 this.width = 0; 80 this.minHeight = null; 81 this.minWidth = null; 82 this.maxHeight = null; 83 this.maxWidth = null; 84 this.shownArray = []; 85 this.heightArray = []; 86 this.widthArray = []; 87 this.minHeightArray = []; 88 this.minWidthArray = []; 89 this.maxHeightArray = []; 90 this.maxWidthArray = []; 91 this.iframeLoadingArray = []; 92 this.isLiveResizingMode = true; 93 this.isPopupPositionCorrectionOn = true; 94 this.isPopupFullCorrectionOn = true; 95 this.windowElements = new Object(); 96 this.hideBodyScrollWhenModal = true; 97 this.hideBodyScrollWhenMaximized = true; 98 this.autoUpdatePosition = false; 99 this.autoUpdatePositionArray = []; 100 this.cachedSize = null; 101 this.cachedSizeArray = []; 102 this.fakeDragDiv = null; 103 this.headerHeight = 0; 104 this.headerHeightArray = []; 105 this.footerHeight = 0; 106 this.footerHeightArray = []; 107 this.ResizeBorderSize = __aspxTouchUI ? 10 : 6; 108 this.ResizeCornerBorderSize = 20; 109 this.allowDragging = false; 110 this.isWindowDragging = false; 111 this.enableContentScrolling = false; 112 this.contentOverflowX = "None"; 113 this.contentOverflowY = "None"; 114 this.isPinned = false; 115 this.isPinnedArray = []; 116 this.pinX = 0; 117 this.pinXArray = []; 118 this.pinY = 0; 119 this.pinYArray = []; 120 this.lockScroll = 0; 121 this.isCollapsed = false; 122 this.isCollapsedArray = []; 123 this.isCollapsedInit = false; 124 this.isCollapsedInitArray = []; 125 this.collapseExecutingLockCount = 0; 126 this.isMaximized = false; 127 this.isMaximizedArray = []; 128 this.isMaximizedInit = false; 129 this.isMaximizedInitArray = []; 130 this.maximizationExecutingLockCount = 0; 131 this.restoredWindowValues = {}; 132 this.restoredWindowValuesArray = []; 133 this.browserResizingForMaxWindowLockCount = 0; 134 this.updateRestoredWindowSizeLockCount = 0; 135 this.iframeAdjustingPostponedArray = []; 136 this.iframeAdjustingPostponed = false; 137 this.touchUIScrollers = {}; 138 this.prohibitClearSelectionOnMouseDown = false; 139 this.CloseButtonClick = new ASPxClientEvent(); 140 this.CloseUp = new ASPxClientEvent(); 141 this.Closing = new ASPxClientEvent(); 142 this.PopUp = new ASPxClientEvent(); 143 this.Resize = new ASPxClientEvent(); 144 this.Shown = new ASPxClientEvent(); 145 this.BeforeResizing = new ASPxClientEvent(); 146 this.AfterResizing = new ASPxClientEvent(); 147 this.PinnedChanged = new ASPxClientEvent(); 148 aspxGetPopupControlCollection().Add(this); 149 }, 150 InlineInitialize: function() { 151 ASPxClientControl.prototype.InlineInitialize.call(this); 152 this.InitializeArrayCores(); 153 }, 154 Initialize: function() { 155 aspxGetPopupControlCollection().EnsureSaveScrollState(); 156 this.InitializeBeforeAnyShow(); 157 if(this.HasDefaultWindow()) 158 this.InitializeWindow(-1); 159 for(var i = 0; i < this.GetWindowCount(); i++) 160 this.InitializeWindow(i);
161 this.InitializeScrollbars(); 162 this.constructor.prototype.Initialize.call(this); 163 }, 164 InitializeBeforeAnyShow: function(){ 165 this.enableContentScrolling = this.contentOverflowX != "None" || this.contentOverflowY != "None"; 166 }, 167 InitializeScrollbars: function() { 168 if(!__aspxWebKitTouchUI || !this.enableContentScrolling) 169 return; 170 var options = { 171 showHorizontalScrollbar: this.contentOverflowX == "Auto" || this.contentOverflowX == "Scroll", 172 showVerticalScrollbar: this.contentOverflowY == "Auto" || this.contentOverflowY == "Scroll" 173 }; 174 var indicies = []; 175 for(var i = 0; i < this.GetWindowCount(); i++) 176 indicies.push(i); 177 if(this.HasDefaultWindow()); 178 indicies.push(-1); 179 for(var i = 0; i < indicies.length; i++) { 180 var windowIndex = indicies[i]; 181 var scrollElement = this.GetContentContainer(windowIndex); 182 if(scrollElement) 183 this.touchUIScrollers[windowIndex] = ASPxClientTouchUI.MakeScrollable(scrollElement, options); 184 } 185 }, 186 UpdateScrollbar: function(index) { 187 var touchUIScroller = this.touchUIScrollers[index]; 188 if(!touchUIScroller) 189 return; 190 var scrollElement = this.GetContentContainer(index); 191 if(scrollElement) 192 touchUIScroller.ChangeElement(scrollElement); 193 }, 194 AfterInitialize: function() { 195 if(this.HasDefaultWindow()) 196 this.AfterInitializeWindow(-1); 197 for(var i = 0; i < this.GetWindowCount(); i++) 198 this.AfterInitializeWindow(i); 199 this.constructor.prototype.AfterInitialize.call(this); 200 }, 201 InitializeArrayCores: function() { 202 if(this.GetWindowCountCore() > 0) { 203 this.InitializeWindowPopupElementList(); 204 this.InitializeWindowPopupElementIDList(); 205 this.InitializeWindowLastUsedPopupElementInfoList(); 206 this.InitializeArray(this.shownArray); 207 this.InitializeArray(this.windowsPopupReasonMouseEventList, null); 208 this.InitializeArray(this.windowsIsPopupedList, false); 209 this.InitializeArray(this.contentUrlArray, ""); 210 this.InitializeArray(this.popupActionArray, this.popupAction); 211 this.InitializeArray(this.closeActionArray, this.closeAction); 212 this.InitializeArray(this.showOnPageLoadArray, false); 213 this.InitializeArray(this.isDraggedArray, false); 214 this.InitializeArray(this.isPinnedArray, false); 215 this.InitializeArray(this.isCollapsedArray, false); 216 this.InitializeArray(this.isCollapsedInitArray, false); 217 this.InitializeArray(this.isMaximizedArray, false); 218 this.InitializeArray(this.isMaximizedInitArray, false); 219 this.InitializeArray(this.restoredWindowValuesArray, {}); 220 this.InitializeArray(this.iframeAdjustingPostponedArray, {}); 221 this.InitializeArray(this.isResizedArray, false); 222 this.InitializeArray(this.zIndexArray, -1); 223 this.InitializeArray(this.leftArray, 0); 224 this.InitializeArray(this.topArray, 0); 225 this.InitializeArray(this.widthArray, 0); 226 this.InitializeArray(this.heightArray, 0); 227 this.InitializeArray(this.pinXArray, 0); 228 this.InitializeArray(this.pinYArray, 0); 229 this.InitializeArray(this.minWidthArray, null); 230 this.InitializeArray(this.minHeightArray, null); 231 this.InitializeArray(this.maxWidthArray, null); 232 this.InitializeArray(this.maxHeightArray, null); 233 this.InitializeArray(this.cachedSizeArray, null); 234 this.InitializeArray(this.iframeLoadingArray, false); 235 this.InitializeArray(this.autoUpdatePositionArray, false); 236 if(__aspxIE) { 237 this.InitializeArray(this.headerHeightArray, -1); 238 this.InitializeArray(this.footerHeightArray, -1); 239 } 240 } 241 }, 242 InitializeArray: function(array, defaultValue) { 243 if(array.length == 0) { 244 for(var i = 0; i < this.GetWindowCountCore(); i++) 245 array[i] = defaultValue; 246 } 247 }, 248 InitializeWindowPopupElementIDList: function() { 249 for(var i = 0; i < this.GetWindowCountCore(); i++) { 250 if(!this.windowsPopupElementIDList[i]) 251 this.windowsPopupElementIDList[i] = []; 252 } 253 }, 254 InitializeWindowPopupElementList: function() { 255 for(var i = 0; i < this.GetWindowCountCore(); i++) { 256 if(!this.windowsPopupElementList[i]) 257 this.windowsPopupElementList[i] = []; 258 } 259 }, 260 InitializeWindowLastUsedPopupElementInfoList: function() { 261 for(var i = 0; i < this.GetWindowCountCore(); i++) { 262 if(!this.windowsLastUsedPopupElementInfoList[i]) 263 this.windowsLastUsedPopupElementInfoList[i] = {}; 264 } 265 }, 266 WindowElementIDAssignmentMap: [ 267 { cssClass: "dxpc-header", prefix: "_PWH" }, 268 { cssClass: "dxpc-headerText", prefix: "_PWH", postfix: "T" }, 269 { cssClass: "dxpc-headerImg", prefix: "_PWH", postfix: "I" }, 270 { cssClass: "dxpc-closeBtn", prefix: "_HCB" }, 271 { cssClass: "dxpc-pinBtn", prefix: "_HPB" }, 272 { cssClass: "dxpc-refreshBtn", prefix: "_HRB" }, 273 { cssClass: "dxpc-collapseBtn", prefix: "_HMNB" }, 274 { cssClass: "dxpc-maximizeBtn", prefix: "_HMXB" }, 275 { cssClass: "dxpc-content", prefix: "_PWC" }, 276 { cssClass: "dxpc-iFrame", prefix: "_CIF" }, 277 { cssClass: "dxpc-footer", prefix: "_PWF" }, 278 { cssClass: "dxpc-footerText", prefix: "_PWF", postfix: "T" }, 279 { cssClass: "dxpc-footerImg", prefix: "_PWF", postfix: "I" } 280 ], 281 SetMsTouchDefAction: function(index){ 282 var element = this.GetContentContainer(index); 283 if (element && __aspxIE && __aspxBrowserVersion>=10 && window.navigator.msPointerEnabled){ 284 element.style['-ms-touch-action'] = 'none'; 285 } 286 }, 287 AssignElementID: function(element, index, prefix, postfix) {
288 element.id = this.name + prefix + index + (postfix ? postfix : ""); 289 }, 290 AssignWindowElementsID: function(index, windowElement) { 291 for(var i = 0; i < this.WindowElementIDAssignmentMap.length; i++) { 292 var elementClass = this.WindowElementIDAssignmentMap[i].cssClass; 293 var elements = _aspxGetDescendantNodesByClassName(windowElement, elementClass); 294 for(var j = 0; j < elements.length; j++) { 295 var element = elements[j]; 296 if(this.GetFirstParentWindow(element) === windowElement) 297 this.AssignElementID(element, index, this.WindowElementIDAssignmentMap[i].prefix, this.WindowElementIDAssignmentMap[i].postfix); 298 } 299 } 300 }, 301 GetFirstParentWindow: function(el) { 302 while(el && el.tagName != "BODY") { 303 if(el.nodeType == 1 && el.className.indexOf("dxpclW") > -1 && !isNaN(this.GetWindowIndex(el))) 304 return el; 305 el = el.parentNode; 306 } 307 }, 308 PreventHeaderButtonMouseDownBubbling: function(evt, hdrButton) { 309 if(hdrButton) { 310 var source = _aspxGetEventSource(evt); 311 if(_aspxGetIsParent(hdrButton, source)) { 312 aspxPWHMDown(evt); 313 return true; 314 } 315 } 316 return false; 317 }, 318 GetWindowElementMouseDownEventHandler: function(index) { 319 var instance = this, 320 interactiveTagNames = ['INPUT', 'BUTTON', 'TEXTAREA', 'SELECT', 'OPTION', 'A', 'IFRAME']; 321 return function(evt) { 322 var content = instance.GetWindowContentElement(index), 323 target = _aspxGetEventSource(evt); 324 if(target && _aspxGetIsParent(content, target) && _aspxArrayIndexOf(interactiveTagNames, target.tagName) > -1) 325 return true; 326 if(!instance.PreventHeaderButtonMouseDownBubbling(evt, instance.GetWindowCloseButton(index)) && 327 !instance.PreventHeaderButtonMouseDownBubbling(evt, instance.GetWindowPinButton(index)) && 328 !instance.PreventHeaderButtonMouseDownBubbling(evt, instance.GetWindowRefreshButton(index)) && 329 !instance.PreventHeaderButtonMouseDownBubbling(evt, instance.GetWindowCollapseButton(index)) && 330 !instance.PreventHeaderButtonMouseDownBubbling(evt, instance.GetWindowMaximizeButton(index))) 331 aspxPWMDown(evt, instance.name, index, instance.isWindowDragging); 332 } 333 }, 334 GetWindowElementMouseMoveEventHandler: function(index) { 335 var instance = this; 336 return function(evt) { aspxPWMMove(evt, instance.name, index); }; 337 }, 338 GetWindowHeaderElementMouseDownEventHandler: function(index) { 339 var instance = this; 340 return function(evt) { 341 if(!instance.PreventHeaderButtonMouseDownBubbling(evt, instance.GetWindowCloseButton(index)) && 342 !instance.PreventHeaderButtonMouseDownBubbling(evt, instance.GetWindowPinButton(index)) && 343 !instance.PreventHeaderButtonMouseDownBubbling(evt, instance.GetWindowRefreshButton(index)) && 344 !instance.PreventHeaderButtonMouseDownBubbling(evt, instance.GetWindowCollapseButton(index)) && 345 !instance.PreventHeaderButtonMouseDownBubbling(evt, instance.GetWindowMaximizeButton(index))) 346 aspxPWDGMDown(evt, instance.name, index); 347 } 348 }, 349 AssignWindowElementsEvents: function(index, element) { 350 var instance = this; 351 var mdEventName = ASPxClientTouchUI.touchMouseDownEventName; 352 _aspxAttachEventToElement(element, mdEventName, this.GetWindowElementMouseDownEventHandler(index), true); 353 if(this.allowResize) { 354 var mmEventName = ASPxClientTouchUI.touchMouseMoveEventName; 355 _aspxAttachEventToElement(element, mmEventName, this.GetWindowElementMouseMoveEventHandler(index)); 356 } 357 var header = this.GetWindowHeaderElement(index); 358 if(header && this.allowDragging && !this.isWindowDragging) { 359 _aspxAttachEventToElement(header, mdEventName, this.GetWindowHeaderElementMouseDownEventHandler(index), true); 360 } 361 var sizeGrip = this.GetWindowSizeGripElement(index); 362 if(sizeGrip) { 363 _aspxAttachEventToElement(sizeGrip, mdEventName, function(evt) { 364 aspxPWGripMDown(evt, instance.name, index); 365 _aspxPreventEvent(evt); 366 }); 367 } 368 this.AttachClickToHeaderButton(index, this.GetWindowCloseButton(index), "aspxPWCBClick"); 369 this.AttachClickToHeaderButton(index, this.GetWindowPinButton(index), "aspxPWPBClick"); 370 this.AttachClickToHeaderButton(index, this.GetWindowRefreshButton(index), "aspxPWRBClick"); 371 this.AttachClickToHeaderButton(index, this.GetWindowCollapseButton(index), "aspxPWMNBClick"); 372 this.AttachClickToHeaderButton(index, this.GetWindowMaximizeButton(index), "aspxPWMXBClick"); 373 }, 374 AttachClickToHeaderButton: function(index, headerButton, eventFuncName) { 375 var instance = this; 376 if(headerButton) { 377 _aspxAttachEventToElement(headerButton, "click", function(evt) { 378 eval(eventFuncName)(evt, instance.name, index); 379 }); 380 } 381 }, 382 InitializeWindow: function(index) { 383 var modalElement = this.GetWindowModalElement(index); 384 if(modalElement) 385 _aspxAttachEventToElement(modalElement, "mousedown", aspxPWMEMDown); 386 this.RemoveWindowAllPopupElements(index); 387 this.PopulatePopupElements(index); 388 var element = this.GetWindowElement(index); 389 if(element != null) { 390 this.AssignWindowElementsID(index, element); 391 this.AssignWindowElementsEvents(index, element); 392 element.DXPopupWindowElement = true; 393 _aspxAttachEventToElement(element, "resize", this.CreateWindowResizeHandler(this.name, index)); 394 if(__aspxIE) 395 this.AttachOnDragStartEventToWindowImages(index); 396 var contentUrl = this.GetWindowContentIFrameUrl(index); 397 if(contentUrl != "") 398 this.SetWindowContentUrlInternal(index, contentUrl); 399 element.isHiding = false; 400 element.isContentHeightInit = false; 401 element.isPopupPositionCorrectionOn = this.isPopupPositionCorrectionOn || !this.GetShowOnPageLoad(index); 402 if(this.GetShowOnPageLoad(index) && this.GetZIndex(index) > 0) { 403 this.FirstShowWindow(index, false); 404 aspxGetPopupControlCollection().SetWindowElementZIndex(element, this.GetZIndex(index)); 405 element.isPopupPositionCorrectionOn = true; 406 } 407 } 408 this.SetMsTouchDefAction(index); 409 }, 410 CreateWindowResizeHandler: function(name, index) { 411 return function() { 412 var pc = aspxGetPopupControlCollection().Get(name); 413 if(pc) 414 pc.ResizeWindowIFrame(index); 415 }; 416 }, 417 BrowserWindowResizeSubscriber: function() { 418 return true; 419 }, 420 OnBrowserWindowResize: function(evt) { 421 window.setTimeout(this.SetPopupMaximizedPositionOnBrowserResize.aspxBind(this), 0); 422 }, 423 SetPopupMaximizedPositionOnBrowserResize: function() { 424 if(this.HasDefaultWindow())
425 this.SetMaximizedPositionOnBrowserResize(-1); 426 for(var i = 0; i < this.GetWindowCount(); i++) 427 this.SetMaximizedPositionOnBrowserResize(i); 428 }, 429 SetMaximizedPositionOnBrowserResize: function(index) { 430 var element = this.GetWindowElement(index); 431 if(element && this.GetIsMaximized(index)) { 432 var left = _aspxPrepareClientPosForElement(_aspxGetDocumentScrollLeft(), element, true); 433 var top = _aspxPrepareClientPosForElement(_aspxGetDocumentScrollTop(), element, false); 434 this.SetWindowPos(index, element, left, top); 435 } 436 }, 437 InitIFrame: function(index) { 438 var contentIFrameElement = this.GetWindowContentIFrameElement(index); 439 if(contentIFrameElement) { 440 contentIFrameElement.popupControlName = this.name; 441 contentIFrameElement.pcWndIndex = index; 442 _aspxAttachEventToElement(contentIFrameElement, "load", aspxPCIframeLoad); 443 } 444 }, 445 InitCollapsedWindows: function(index) { 446 if ((this.isCollapsedInit && index == -1) || (index >= 0 && index < this.isCollapsedInitArray.length && this.isCollapsedInitArray[index])){ 447 if (this.InternalIsWindowVisible(index)){ 448 this.DoCollapse(index, true); 449 if (index == -1) 450 this.isCollapsedInit = false; 451 else 452 this.isCollapsedInitArray[index] = false; 453 } 454 } 455 }, 456 InitMaximizedWindows: function(index) { 457 if ((this.isMaximizedInit && index == -1) || (index >= 0 && index < this.isMaximizedInitArray.length && this.isMaximizedInitArray[index])){ 458 if (this.InternalIsWindowVisible(index)){ 459 this.DoMaximize(index, true); 460 if (index == -1) 461 this.isMaximizedInit = false; 462 else 463 this.isMaximizedInitArray[index] = false; 464 } 465 } 466 }, 467 InitPinnedWindows: function(index) { 468 if ((this.isPinned && index == -1) || (index >= 0 && index < this.isPinnedArray.length && this.isPinnedArray[index])) 469 this.HoldPosition(index, true); 470 }, 471 AfterInitializeWindow: function(index) { 472 if(this.GetShowOnPageLoad(index) && this.GetZIndex(index) < 0) { 473 this.FirstShowWindow(index, true); 474 var element = this.GetWindowElement(index); 475 if(element != null) 476 element.isPopupPositionCorrectionOn = true; 477 } 478 this.EnsureContent(index, true); 479 this.InitPinnedWindows(index); 480 this.InitMaximizedWindows(index); 481 this.InitCollapsedWindows(index); 482 }, 483 AttachOnDragStartEventToWindowImages: function(index) { 484 this.AttachChildImagesPreventDragStartEvent(this.GetWindowHeaderElement(index)); 485 this.AttachChildImagesPreventDragStartEvent(this.GetWindowFooterElement(index)); 486 }, 487 AttachChildImagesPreventDragStartEvent: function(parentElem) { 488 var images = parentElem == null ? null : _aspxGetElementsByTagName(parentElem, "img"); 489 if(images != null) { 490 for(var i = 0; i < images.length; i++) 491 _aspxAttachEventToElement(images[i], "dragstart", _aspxPreventDragStart); 492 } 493 }, 494 FirstShowWindow: function(index, allowChangeZIndex) { 495 var isFreeWindow = this.GetIsDragged(index); 496 var x = __aspxInvalidPosition; 497 var y = __aspxInvalidPosition; 498 if(isFreeWindow) { 499 x = this.GetWindowLeft(index); 500 y = this.GetWindowTop(index); 501 var popupHorizontalOffsetBackup = this.popupHorizontalOffset; 502 var popupVerticalOffsetBackup = this.popupVerticalOffset; 503 this.popupHorizontalOffset = 0; 504 this.popupVerticalOffset = 0; 505 } 506 this.LockAnimation(); 507 this.DoShowWindowAtPos(index, x, y, isFreeWindow ? -1 : 0, false, allowChangeZIndex); 508 this.UnlockAnimation(); 509 if(isFreeWindow) { 510 this.popupHorizontalOffset = popupHorizontalOffsetBackup; 511 this.popupVerticalOffset = popupVerticalOffsetBackup; 512 } 513 this.CorrectElementVerticalAlignment(_aspxAdjustVerticalMarginsInContainer, this.GetWindowHeaderElement(index)); 514 }, 515 GetIsDragged: function(index) { 516 if(0 <= index && index < this.isDraggedArray.length) 517 return this.isDraggedArray[index]; 518 return this.isDragged; 519 }, 520 SetIsDragged: function(index, value) { 521 if(0 <= index && index < this.isDraggedArray.length) 522 this.isDraggedArray[index] = value; 523 else 524 this.isDragged = value; 525 }, 526 GetIsPinned: function(index) { 527 if(0 <= index && index < this.isPinnedArray.length) 528 return this.isPinnedArray[index]; 529 return this.isPinned; 530 }, 531 SetIsPinned: function(index, value) { 532 if(0 <= index && index < this.isPinnedArray.length) 533 this.isPinnedArray[index] = value; 534 else 535 this.isPinned = value; 536 }, 537 GetPinPosX: function(index) { 538 if(0 <= index && index < this.pinXArray.length) 539 return this.pinXArray[index]; 540 return this.pinX; 541 },
542 SetPinPosX: function(index, pinX) { 543 if(0 <= index && index < this.pinXArray.length) 544 this.pinXArray[index] = pinX; 545 else 546 this.pinX = pinX; 547 }, 548 GetPinPosY: function(index) { 549 if(0 <= index && index < this.pinYArray.length) 550 return this.pinYArray[index]; 551 return this.pinY; 552 }, 553 SetPinPosY: function(index, pinY) { 554 if(0 <= index && index < this.pinYArray.length) 555 this.pinYArray[index] = pinY; 556 else 557 this.pinY = pinY; 558 }, 559 GetIsCollapsed: function(index) { 560 if(0 <= index && index < this.isCollapsedArray.length) 561 return this.isCollapsedArray[index]; 562 return this.isCollapsed; 563 }, 564 SetIsCollapsed: function(index, value) { 565 if(0 <= index && index < this.isCollapsedArray.length) 566 this.isCollapsedArray[index] = value; 567 else 568 this.isCollapsed = value; 569 }, 570 GetIsMaximized: function(index) { 571 if(0 <= index && index < this.isMaximizedArray.length) 572 return this.isMaximizedArray[index]; 573 return this.isMaximized; 574 }, 575 SetIsMaximized: function(index, value) { 576 if(0 <= index && index < this.isMaximizedArray.length) 577 this.isMaximizedArray[index] = value; 578 else 579 this.isMaximized = value; 580 }, 581 GetRestoredWindowData: function(index) { 582 if(0 <= index && index < this.restoredWindowValuesArray.length) 583 return this.restoredWindowValuesArray[index]; 584 return _aspxCloneObject(this.restoredWindowValues); 585 }, 586 SetRestoredWindowData: function(index, value) { 587 if(0 <= index && index < this.restoredWindowValuesArray.length) 588 this.restoredWindowValuesArray[index] = value; 589 else 590 this.restoredWindowValues = value; 591 }, 592 GetIsResized: function(index) { 593 if(0 <= index && index < this.isResizedArray.length) 594 return this.isResizedArray[index]; 595 return this.isResized; 596 }, 597 SetIsResized: function(index, value) { 598 if(0 <= index && index < this.isResizedArray.length) 599 this.isResizedArray[index] = value; 600 else 601 this.isResized = value; 602 }, 603 GetHorizontalAlign: function() { 604 return this.popupHorizontalAlign; 605 }, 606 GetVerticalAlign: function() { 607 return this.popupVerticalAlign; 608 }, 609 GetPopupHorizontalOffset: function() { 610 return this.popupHorizontalOffset; 611 }, 612 SetPopupHorizontalOffset: function(offset) { 613 this.popupHorizontalOffset = offset; 614 }, 615 SetPopupVerticalOffset: function(offset) { 616 this.popupVerticalOffset = offset; 617 }, 618 GetPopupVerticalOffset: function() { 619 return this.popupVerticalOffset; 620 }, 621 IeWithoutSupportDisplayTable: function () { 622 return __aspxIE && __aspxBrowserVersion < 8; 623 }, 624 HasDefaultWindow: function() { 625 return this.GetWindowCountCore() == 0; 626 }, 627 GetCurrentLeft: function(index) { 628 return this.GetPosition(index, true); 629 }, 630 GetCurrentTop: function(index) { 631 return this.GetPosition(index, false); 632 }, 633 GetHeaderHeight: function(index) { 634 if(0 <= index && index < this.headerHeightArray.length) 635 return this.headerHeightArray[index]; 636 return this.headerHeight; 637 }, 638 GetFooterHeight: function(index) { 639 if(0 <= index && index < this.footerHeightArray.length) 640 return this.footerHeightArray[index]; 641 return this.footerHeight; 642 }, 643 GetWindowFooterHeightLite: function(index) { 644 var footer = this.GetWindowFooterElement(index); 645 if(footer) 646 return footer.offsetHeight; 647 return null; 648 }, 649 SetHeaderHeight: function(index, height) { 650 if(0 <= index && index < this.headerHeightArray.length) 651 this.headerHeightArray[index] = height; 652 else 653 this.headerHeight = height; 654 }, 655 SetFooterHeight: function(index, height) { 656 if(0 <= index && index < this.footerHeightArray.length) 657 return this.footerHeightArray[index] = height; 658 else 659 this.footerHeight = height; 660 }, 661 GetPosition: function(index, isLeft) { 662 if(0 <= index && index < this.GetWindowCountCore()) 663 return isLeft ? this.leftArray[index] : this.topArray[index]; 664 return isLeft ? this.left : this.top; 665 }, 666 SetPopupElementReference: function(index, popupElement, popupElementIndex, attach) { 667 if(!_aspxIsExistsElement(popupElement)) return; 668 var setReferenceFunction = attach ? _aspxAttachEventToElement : _aspxDetachEventFromElement; 669 var windowPopupAction = this.GetWindowPopupAction(index); 670 if(windowPopupAction == "LeftMouseClick") 671 setReferenceFunction(popupElement, "mouseup", aspxPEMEvent); 672 else if(windowPopupAction == "RightMouseClick") 673 setReferenceFunction(popupElement, "contextmenu", aspxPEMEvent); 674 else if(windowPopupAction == "MouseOver") { 675 var windowElement = this.GetWindowElement(index); 676 setReferenceFunction(popupElement, "mouseover", ASPxClientPopupUtils.OverControl.OnMouseOver); 677 setReferenceFunction(windowElement, "mouseover", aspxPWEMOver); 678 if(attach) 679 this.SetMSTouchMouseOverReference(popupElement, windowElement, this.name, index, this.appearAfter); 680 } 681 if(windowPopupAction == "LeftMouseClick" || windowPopupAction == "RightMouseClick") { 682 setReferenceFunction(popupElement, "mousedown", aspxPEMEvent); 683 } 684 if(attach) { 685 popupElement.DXPopupElementControl = this; 686 popupElement.DXPopupWindowIndex = index; 687 popupElement.DXPopupElementIndex = popupElementIndex; 688 } else 689 popupElement.DXPopupElementControl = popupElement.DXPopupWindowIndex = popupElement.DXPopupElementIndex = undefined; 690 }, 691 SetMSTouchMouseOverReference: function(popupElement, windowElement, popupName, index, appearAfter){ 692 if(!window.navigator.msPointerEnabled) return; 693 popupElement.dxMsTouchGesture = popupElement.dxMsTouchGesture ||
694 ASPxClientTouchUI.msTouchCreateGerturesWrapper(popupElement, function(evt){ 695 window.setTimeout(function(){ 696 aspxGetPopupControlCollection().SetAppearTimer(popupName, index, popupElement.DXPopupElementIndex, appearAfter, evt); 697 }, 0); 698 }); 699 windowElement.dxMsTouchGesture = windowElement.dxMsTouchGesture || ASPxClientTouchUI.msTouchCreateGerturesWrapper(windowElement, function(evt){ 700 window.setTimeout(function(){ 701 aspxGetPopupControlCollection().ClearDisappearTimer(); 702 }, 0); 703 }); 704 }, 705 PopulatePopupElements: function(index) { 706 var ids = this.GetPopupElementIDList(index); 707 for(var i = 0; i < ids.length; i++) { 708 var popupElement = ASPxClientPopupUtils.FindPopupElementById(ids[i]); 709 if(popupElement) 710 this.AddWindowPopupElement(index, popupElement); 711 } 712 }, 713 GetPopupElement: function(index, popupElementIndex) { 714 var popupElement = this.GetPopupElementList(index)[popupElementIndex]; 715 return popupElement ? popupElement : null; 716 }, 717 GetPopupElementIDList: function(index) { 718 if(0 <= index && index < this.GetWindowCountCore()) 719 return this.windowsPopupElementIDList[index]; 720 return this.defaultWindowPopupElementIDList; 721 }, 722 GetPopupElementList: function(index) { 723 if(0 <= index && index < this.GetWindowCountCore()) 724 return this.windowsPopupElementList[index]; 725 return this.defaultWindowPopupElementList; 726 }, 727 SetPopupElementIDs: function(index, ids) { 728 if(0 <= index && index < this.GetWindowCountCore()) 729 this.windowsPopupElementIDList[index] = ids; 730 this.defaultWindowPopupElementIDList = ids; 731 }, 732 AddPopupElementInternal: function(index, element) { 733 var popupElements = this.GetPopupElementList(index); 734 for(var i = 0; i < popupElements.length; i++) { 735 if(!popupElements[i]) { 736 popupElements[i] = element; 737 return i; 738 } 739 } 740 popupElements.push(element); 741 return popupElements.length - 1; 742 }, 743 RemovePopupElementInternal: function(index, element) { 744 var popupElements = this.GetPopupElementList(index); 745 for(var i = 0; i < popupElements.length; i++) { 746 if(popupElements[i] == element) { 747 popupElements[i] = null; 748 return; 749 } 750 } 751 }, 752 AddPopupElement: function(popupElement) { 753 this.AddWindowPopupElement(-1, popupElement); 754 }, 755 AddWindowPopupElement: function(index, popupElement) { 756 var popupElementIndex = this.AddPopupElementInternal(index, popupElement); 757 this.SetPopupElementReference(index, popupElement, popupElementIndex, true); 758 }, 759 RemovePopupElement: function(popupElement) { 760 this.RemoveWindowPopupElement(-1, popupElement); 761 }, 762 RemoveWindowPopupElement: function(index, popupElement) { 763 this.RemovePopupElementInternal(index, popupElement); 764 this.SetPopupElementReference(index, popupElement, null, false); 765 }, 766 RemoveAllPopupElements: function() { 767 this.RemoveWindowAllPopupElements(-1); 768 }, 769 RemoveWindowAllPopupElements: function(index) { 770 var popupElements = this.GetPopupElementList(index); 771 for(var i = 0; i < popupElements.length; i++) 772 this.RemoveWindowPopupElement(index, popupElements[i]); 773 }, 774 GetIsPopuped: function(index) { 775 if(0 <= index && index < this.GetWindowCountCore()) 776 return this.windowsIsPopupedList[index]; 777 return this.defaultIsPopuped; 778 }, 779 SetIsPopuped: function(index, isPopuped) { 780 if(0 <= index && index < this.GetWindowCountCore()) 781 this.windowsIsPopupedList[index] = isPopuped; 782 this.defaultIsPopuped = isPopuped; 783 }, 784 GetLastShownPopupElementIndex: function(windowIndex) { 785 var info = this.GetLastUsedPopupElementInfo(windowIndex); 786 return _aspxGetDefinedValue(info.shownPEIndex, 0); 787 }, 788 SetLastShownPopupElementIndex: function(windowIndex, popupElementIndex) { 789 var info = this.GetLastUsedPopupElementInfo(windowIndex); 790 info.shownPEIndex = popupElementIndex; 791 }, 792 GetLastOverPopupElementIndex: function(windowIndex) { 793 var info = this.GetLastUsedPopupElementInfo(windowIndex); 794 return _aspxGetDefinedValue(info.overPEIndex, -1); 795 }, 796 SetLastOverPopupElementIndex: function(windowIndex, popupElementIndex) { 797 var info = this.GetLastUsedPopupElementInfo(windowIndex); 798 info.overPEIndex = popupElementIndex; 799 }, 800 GetLastUsedPopupElementInfo: function(index) { 801 if(0 <= index && index < this.GetWindowCountCore()) 802 return this.windowsLastUsedPopupElementInfoList[index]; 803 return this.defaultLastUsedPopupElementInfo; 804 }, 805 SetWindowPopUpReasonMouseEvent: function(index, evt) { 806 evt = _aspxCloneObject(evt); 807 if(evt === undefined) 808 evt = null; 809 if(0 <= index && index < this.GetWindowCountCore()) 810 this.windowsPopupReasonMouseEventList[index] = evt; 811 this.defaultPopupReasonMouseEvent = evt; 812 }, 813 GetPopUpReasonMouseEvent: function() { 814 return this.GetWindowPopUpReasonMouseEvent(null); 815 }, 816 GetWindowPopUpReasonMouseEvent: function(window) { 817 var index = (window != null) ? window.index : -1; 818 if(0 <= index && index < this.GetWindowCountCore()) 819 return this.windowsPopupReasonMouseEventList[index]; 820 return this.defaultPopupReasonMouseEvent; 821 }, 822 GetShadowWidth: function() { 823 return this.shadowVisible ? __aspxPopupShadowWidth : 0; 824 }, 825 GetShadowHeight: function() { 826 return this.shadowVisible ? __aspxPopupShadowHeight : 0; 827 }, 828 GetShowOnPageLoad: function(index) { 829 if(0 <= index && index < this.showOnPageLoadArray.length) 830 return this.showOnPageLoadArray[index]; 831 return this.showOnPageLoad; 832 }, 833 GetWindowCountCore: function() { 834 return (this.windows.length > 0) ? this.windows.length : this.windowCount; 835 }, 836 GetWindowIFrame: function(index) { 837 var element = this.GetWindowElement(index); 838 var iFrame = element.overflowElement; 839 if(!iFrame) { 840 iFrame = this.FindWindowIFrame(index); 841 element.overflowElement = iFrame; 842 } 843 return iFrame; 844 }, 845 FindWindowIFrame: function(index) { 846 return _aspxGetElementById(this.name + "_DXPWIF" + index); 847 }, 848 GetWindowModalElement: function(index) { 849 var element = this.GetWindowElement(index); 850 if(!element) return; 851 var modalElement = element.modalElement; 852 if(!modalElement) { 853 modalElement = this.FindWindowModalElement(index); 854 element.modalElement = modalElement; 855 if(modalElement) { 856 modalElement.DXModalPopupControl = this; 857 modalElement.DXModalPopupWindowIndex = index; 858 } 859 } 860 return modalElement; 861 }, 862 GetModalElementEndAnimationOpacity: function(index) { 863 if(typeof(this.modalElementOpacity) == "undefined") 864 this.modalElementOpacity = []; 865 if(typeof(this.modalElementOpacity[index]) == "undefined") 866 this.modalElementOpacity[index] = _aspxGetElementOpacity(this.GetWindowModalElement(index)); 867 return this.modalElementOpacity[index]; 868 }, 869 FindWindowModalElement: function(index) { 870 return _aspxGetElementById(this.name + "_DXPWMB" + index); 871 }, 872 GetWindowElementId: function(index) { 873 return this.name + __aspxPCWIdSuffix + index; 874 }, 875 WindowIsModal: function(index) { 876 return !!this.GetWindowModalElement(index); 877 }, 878 GetWindowElement: function(index) { 879 if(!_aspxIsExistsElement(this.windowElements[index])) 880 this.windowElements[index] = _aspxGetElementById(this.GetWindowElementId(index)); 881 return this.windowElements[index]; 882 }, 883 GetWindowCloseButton: function(index) { 884 return _aspxGetElementById(this.name + "_HCB" + index); 885 }, 886 GetWindowPinButton: function(index) { 887 return _aspxGetElementById(this.name + "_HPB" + index); 888 }, 889 GetWindowRefreshButton: function(index) { 890 return _aspxGetElementById(this.name + "_HRB" + index); 891 }, 892 GetWindowCollapseButton: function(index) { 893 return _aspxGetElementById(this.name + "_HMNB" + index); 894 }, 895 GetWindowMaximizeButton: function(index) { 896 return _aspxGetElementById(this.name + "_HMXB" + index); 897 }, 898 GetWindowChild: function(index, idPostfix) { 899 var elem = this.GetWindowElement(index); 900 if (elem) 901 return _aspxGetChildById(elem, this.name + idPostfix); 902 return null; 903 }, 904 GetWindowContentIFrameDivElementID: function(index) { 905 return this.name + "_CIFD" + index; 906 }, 907 GetWindowContentIFrameDivElement: function(index) { 908 return this.GetWindowChild(index, "_CIFD" + index); 909 }, 910 GetWindowScrollDiv: function(index) { 911 return this.GetWindowChild(index, "_CSD" + index); 912 }, 913 GetWindowContentIFrameElementId: function(index) { 914 return this.name + "_CIF" + index; 915 }, 916 GetWindowContentIFrameElement: function(index) { 917 return this.GetWindowChild(index, "_CIF" + index); 918 }, 919 GetWindowContentIFrameUrl: function(index) { 920 if(0 <= index && index < this.contentUrlArray.length) 921 return this.contentUrlArray[index]; 922 return this.contentUrl; 923 }, 924 GetWindowPopupAction: function(index) { 925 if(0 <= index && index < this.popupActionArray.length) 926 return this.popupActionArray[index]; 927 return this.popupAction; 928 },
929 GetWindowCloseAction: function(index) { 930 if(0 <= index && index < this.closeActionArray.length) 931 return this.closeActionArray[index]; 932 return this.closeAction; 933 }, 934 SetWindowContentIFrameUrl: function(index, url) { 935 if(0 <= index && index < this.contentUrlArray.length) 936 this.contentUrlArray[index] = url; 937 else 938 this.contentUrl = url; 939 }, 940 ShowWindowContentUrl: function(index) { 941 var contentIFrame = this.GetWindowContentIFrameElement(index); 942 this.LoadWindowContentUrl(index); 943 if(contentIFrame && contentIFrame.DXReloadAfterShowRequired) { 944 this.RefreshWindowContentUrl(this.GetWindow(index)); 945 contentIFrame.DXReloadAfterShowRequired = false; 946 } 947 }, 948 LoadWindowContentUrl: function(index) { 949 var url = this.GetWindowContentIFrameUrl(index); 950 this.LoadWindowContentFromUrl(index, url); 951 }, 952 LoadWindowContentFromUrl: function(index, url) { 953 var element = this.GetWindowContentIFrameElement(index); 954 if(element && element.src != url && element.DXSrcRaw != url) { 955 this.SetSrcToIframeElement(index, element, url); 956 this.SetWindowContentIFrameUrl(index, element.src); 957 } 958 }, 959 SetSrcToIframeElement: function(index, iframeElement, src) { 960 this.SetIframeLoading(index, true); 961 iframeElement.src = src; 962 if(__aspxChrome && src.indexOf("#")) 963 this.PreventScrollingAfterIframeLoaded(iframeElement) 964 iframeElement.DXSrcRaw = src; 965 }, 966 PreventScrollingAfterIframeLoaded: function(iframeElement){ 967 var docScrollTop = _aspxGetDocumentScrollTop(); 968 var onIframeLoadedHandler = function(){ 969 window.setTimeout(function() { 970 _aspxSetDocumentScrollTop(docScrollTop); 971 _aspxDetachEventFromElement(iframeElement, "load", onIframeLoadedHandler); 972 }, 0); 973 }; 974 _aspxAttachEventToElement(iframeElement, "load", onIframeLoadedHandler); 975 }, 976 GetWindowContentElement: function(index) { 977 return this.GetWindowChild(index, "_PWC" + index); 978 }, 979 GetWindowHeaderElement: function(index) { 980 return this.GetWindowChild(index, "_PWH" + index); 981 }, 982 GetWindowHeaders: function() { 983 var elements = []; 984 if(this.HasDefaultWindow()) 985 elements = elements.concat(_aspxGetDescendantNodesByClassName(this.GetWindowElement(-1), "dxpc-header")); 986 for(var i = 0; i < this.GetWindowCount(); i++) 987 elements = elements.concat(_aspxGetDescendantNodesByClassName(this.GetWindowElement(i), "dxpc-header")); 988 return elements; 989 }, 990 GetWindowSizeGripElement: function(index) { 991 return this.GetWindowSizeGripLite(index); 992 }, 993 GetWindowSizeGripLite: function(index) { 994 var footer = this.GetWindowFooterElement(index); 995 if(!footer) 996 return null; 997 var descendants = _aspxGetDescendantNodesByClassName(footer, ASPxClientPopupControlCssClasses.SizeGripLiteCssClassName); 998 return descendants.length > 0 ? descendants[0] : null; 999 }, 1000 GetWindowFooterElement: function(index) { 1001 return this.GetWindowChild(index, "_PWF" + index); 1002 }, 1003 GetContentContainer: function(index) { 1004 return this.GetWindowContentElement(index); 1005 }, 1006 GetWindowIndex: function(element) { 1007 var id = element.id; 1008 var pos = id.lastIndexOf(__aspxPCWIdSuffix); 1009 return parseInt(id.substr(pos + __aspxPCWIdSuffix.length)); 1010 }, 1011 HaveSpecialDivForAnimation: function() { 1012 return this.enableAnimation; 1013 }, 1014 GetWindowMainCell: function (element) { 1015 if(this.IeWithoutSupportDisplayTable() && this.HaveSpecialDivForAnimation()) 1016 return _aspxGetDescendantNodesByClassName(element, ASPxClientPopupControlCssClasses.MainDivLiteCssClass)[0]; 1017 return this.HaveSpecialDivForAnimation() ? _aspxGetChildByTagName(element, "DIV", 0) : element; 1018 }, 1019 GetWindowMainTable: function(element) { 1020 return this.GetWindowMainCell(element); 1021 }, 1022 GetWindowShadowTable: function(index){ 1023 var shadowTable = this.HaveSpecialDivForAnimation() ? this.GetWindowShadowTableCore(index) : this.GetWindowElement(index); 1024 if (!shadowTable) return null; 1025 if(shadowTable.tagName != "TABLE") 1026 shadowTable = this.GetWindowShadowTableCore(index); 1027 return (shadowTable && shadowTable.tagName == "TABLE") ? shadowTable : null; 1028 }, 1029 GetWindowShadowTableCore: function(index) { 1030 return this.GetWindowChild(index, "_PWST" + index); 1031 }, 1032 GetWindowClientTable: function(index) { 1033 return this.GetWindowElement(index); 1034 }, 1035 GetWindowIsShown: function (index) { 1036 if (0 <= index && index < this.shownArray.length) 1037 return this.shownArray[index]; 1038 return this.shown; 1039 }, 1040 SetWindowIsShown: function (index, shown) { 1041 if (0 <= index && index < this.shownArray.length) 1042 this.shownArray[index] = shown; 1043 else 1044 this.shown = shown; 1045 }, 1046 GetWindowLeft: function(index) { 1047 if(0 <= index && index < this.leftArray.length) 1048 return this.leftArray[index]; 1049 return this.left; 1050 }, 1051 SetWindowLeft: function(index, left) { 1052 if(0 <= index && index < this.leftArray.length) 1053 this.leftArray[index] = left; 1054 else 1055 this.left = left; 1056 }, 1057 GetWindowHeightInternal: function(index) { 1058 if(0 <= index && index < this.heightArray.length) 1059 return this.heightArray[index]; 1060 return this.height; 1061 }, 1062 GetWindowMinHeight: function(index) { 1063 if(0 <= index && index < this.minHeightArray.length) 1064 return this.minHeightArray[index]; 1065 return this.minHeight; 1066 }, 1067 GetWindowMaxHeight: function(index) { 1068 if(0 <= index && index < this.maxHeightArray.length) 1069 return this.maxHeightArray[index]; 1070 return this.maxHeight; 1071 }, 1072 SetWindowHeight: function(index, height) { 1073 if(0 <= index && index < this.heightArray.length) 1074 this.heightArray[index] = height; 1075 else 1076 this.height = height; 1077 }, 1078 GetWindowWidthInternal: function(index) { 1079 if(0 <= index && index < this.widthArray.length) 1080 return this.widthArray[index]; 1081 return this.width; 1082 }, 1083 GetWindowMinWidth: function(index) { 1084 if(0 <= index && index < this.minWidthArray.length) 1085 return this.minWidthArray[index]; 1086 return this.minWidth; 1087 }, 1088 GetWindowMaxWidth: function(index) { 1089 if(0 <= index && index < this.maxWidthArray.length) 1090 return this.maxWidthArray[index]; 1091 return this.maxWidth; 1092 }, 1093 SetWindowWidth: function(index, width) { 1094 if(0 <= index && index < this.widthArray.length) 1095 this.widthArray[index] = width; 1096 else 1097 this.width = width; 1098 }, 1099 GetWindowTop: function(index) { 1100 if(0 <= index && index < this.topArray.length) 1101 return this.topArray[index]; 1102 return this.top; 1103 }, 1104 SetWindowTop: function(index, top) { 1105 if(0 <= index && index < this.topArray.length) 1106 return this.topArray[index] = top; 1107 else 1108 return this.top = top; 1109 }, 1110 GetWindowsStateInputElement: function() { 1111 return _aspxGetElementById(this.name + "WS"); 1112 }, 1113 GetZIndex: function(index) { 1114 if(0 <= index && index < this.zIndexArray.length) 1115 return this.zIndexArray[index]; 1116 return this.zIndex; 1117 }, 1118 GetCurrentZIndex: function(index) { 1119 var element = this.GetWindowElement(index); 1120 if(element != null) { 1121 if(element.style.zIndex != "") 1122 return element.style.zIndex; 1123 if(0 <= index && index < this.GetWindowCountCore()) 1124 return this.zIndexArray[index]; 1125 return this.zIndex; 1126 } 1127 }, 1128 GetMainWindowWidth: function(index, noCache){ 1129 return this.GetClientWindowWidth(index, true, noCache); 1130 }, 1131 GetCurrentWindowWidth: function(index) { 1132 return this.GetClientWindowWidth(index); 1133 }, 1134 GetClientWindowWidth: function(index, outerSize, noCache) { 1135 if (!noCache && (this.GetIsCollapsed(index) || this.GetIsMaximized(index))){ 1136 var cachedSize = this.GetWindowCachedSize(index); 1137 if (cachedSize != null)
1138 return cachedSize.width; 1139 } 1140 var element = this.GetWindowElement(index); 1141 if(element != null) 1142 return element.offsetWidth; 1143 }, 1144 GetMainWindowHeight: function(index, noCache){ 1145 return this.GetClientWindowHeight(index, true, noCache); 1146 }, 1147 GetCurrentWindowHeight: function(index) { 1148 return this.GetClientWindowHeight(index); 1149 }, 1150 GetClientWindowHeight: function(index, outerSize, noCache) { 1151 if (!noCache && (this.GetIsCollapsed(index) || this.GetIsMaximized(index))){ 1152 var cachedSize = this.GetWindowCachedSize(index); 1153 if (cachedSize != null) 1154 return cachedSize.height; 1155 } 1156 var element = this.GetWindowElement(index); 1157 if(element != null) 1158 return element.offsetHeight; 1159 }, 1160 GetIframeLoading: function(index) { 1161 if(0 <= index && index < this.iframeLoadingArray.length) 1162 return this.iframeLoadingArray[index]; 1163 return this.iframeLoading; 1164 }, 1165 SetIframeLoading: function(index, value) { 1166 if(0 <= index && index < this.iframeLoadingArray.length) 1167 this.iframeLoadingArray[index] = value; 1168 else 1169 this.iframeLoading = value; 1170 }, 1171 GetAutoUpdatePosition: function(index) { 1172 if(0 <= index && index < this.autoUpdatePositionArray.length) 1173 return this.autoUpdatePositionArray[index]; 1174 return this.autoUpdatePosition; 1175 }, 1176 GetClientPopupPos: function(element, popupElement, pos, isX, isDragged) { 1177 var index = this.GetWindowIndex(element); 1178 var popupPosition = null; 1179 if(isDragged) 1180 popupPosition = new _aspxPopupPosition(pos == __aspxInvalidPosition ? this.GetPosition(index, isX) : pos, false); 1181 else 1182 popupPosition = isX ? this.GetClientPopupPosX(element, popupElement, pos) : this.GetClientPopupPosY(element, popupElement, pos); 1183 popupPosition.position = _aspxPrepareClientPosForElement(popupPosition.position, element, isX); 1184 if(__aspxFirefox && __aspxBrowserVersion < 3 && this.GetWindowModalElement(index)) 1185 popupPosition.position -= isX ? _aspxGetDocumentScrollLeft() : _aspxGetDocumentScrollTop(); 1186 return popupPosition; 1187 }, 1188 GetClientPopupPosX: function(element, popupElement, x) { 1189 var mainElement = this.GetWindowMainCell(element); 1190 var popupPosition = ASPxClientPopupUtils.GetPopupAbsoluteX(mainElement, this.GetShadowWidth(), popupElement, this.popupHorizontalAlign, this.popupHorizontalOffset, 1191 x, this.GetWindowLeft(this.GetWindowIndex(element)), this.rtl, this.isPopupFullCorrectionOn); 1192 return this.CorrectPopupPositionForClientWindow(element, popupPosition, true); 1193 }, 1194 GetClientPopupPosY: function(element, popupElement, y) { 1195 var mainElement = this.GetWindowMainCell(element); 1196 var popupPosition = ASPxClientPopupUtils.GetPopupAbsoluteY(mainElement, this.GetShadowHeight(), popupElement, this.popupVerticalAlign, this.popupVerticalOffset, 1197 y, this.GetWindowTop(this.GetWindowIndex(element)), this.isPopupFullCorrectionOn); 1198 return (this.allowCorrectYOffsetPosition ? this.CorrectPopupPositionForClientWindow(element, popupPosition, false) : popupPosition); 1199 }, 1200 CorrectPopupPositionForClientWindow: function(element, popupPosition, isX) { 1201 if(element.isPopupPositionCorrectionOn && this.isPopupFullCorrectionOn) { 1202 popupPosition.position = ASPxClientPopupUtils.AdjustPositionToClientScreen(element, 1203 isX ? this.GetShadowWidth() : this.GetShadowHeight(), popupPosition.position, isX); 1204 } 1205 return popupPosition; 1206 }, 1207 DoShowWindow: function(index, popupElementIndex, evt) { 1208 if(!this.InternalIsWindowVisible(index)) { 1209 var x = _aspxGetEventX(evt); 1210 var y = _aspxGetEventY(evt); 1211 this.DoShowWindowAtPos(index, x, y, popupElementIndex, true, true, evt); 1212 } 1213 }, 1214 AdjustContentOnShow: function(index) { 1215 var windowElement = this.GetWindowElement(index); 1216 if(this.adjustInnerControlsSizeOnShow) 1217 aspxGetControlCollection().AdjustControls(windowElement); 1218 }, 1219 DoShowWindowAtPos: function(index, x, y, popupElementIndex, closeOtherWindows, allowChangeZIndex, evt) { 1220 if(!this.isInitialized) 1221 this.PopulatePopupElements(index); 1222 var element = this.GetWindowElement(index); 1223 if(element != null) { 1224 this.StopCloseAnimation(index); 1225 if(this.adjustInnerControlsSizeOnShow) { 1226 var windowContent = this.GetContentContainer(index); 1227 var collection = aspxGetControlCollection(); 1228 collection.CollapseControls(windowContent); 1229 } 1230 this.FFTextCurFixShow(index, true); 1231 if(closeOtherWindows) 1232 aspxGetPopupControlCollection().DoHideAllWindows(element, this.GetWindowElementId(index), false); 1233 var isMoving = this.InternalIsWindowVisible(index); 1234 _aspxSetElementDisplay(element, true); 1235 element.style.display = this.HasAnyScrollBars(index) || this.IeWithoutSupportDisplayTable() ? "block" : "table"; 1236 element.style.position = "absolute"; 1237 var scrollDiv = this.GetWindowScrollDiv(index), 1238 shouldResetScrollSize = scrollDiv && this.enableContentScrolling && _aspxGetDocumentMaxClientHeight() <= element.offsetHeight, 1239 savedScrollDivHeight = shouldResetScrollSize && scrollDiv.style.height; 1240 if (shouldResetScrollSize) 1241 scrollDiv.style.height = 0; 1242 var cachedSize = this.GetWindowCachedSize(index); 1243 if(cachedSize != null) {
1244 this.SetWindowSize(this.GetWindow(index), cachedSize.width, cachedSize.height); 1245 this.ResetWindowCachedSize(index); 1246 } 1247 if(!this.GetWindowIsShown(index)) { 1248 var liteWidth = Math.max(this.GetWindowWidthInternal(index), this.GetWindowMinWidth(index)); 1249 var maxWidth = this.GetWindowMaxWidth(index); 1250 if(maxWidth) 1251 liteWidth = Math.min(liteWidth, maxWidth); 1252 var liteHeight = Math.max(this.GetWindowHeightInternal(index), this.GetWindowMinHeight(index)); 1253 var maxHeight = this.GetWindowMaxHeight(index); 1254 if(maxHeight) 1255 liteHeight = Math.min(liteHeight, maxHeight); 1256 this.SetClientWindowSizeCoreLite(index, liteWidth, liteHeight); 1257 this.SetWindowIsShown(index, true); 1258 } 1259 this.RefreshRootDivElementSize(index); 1260 var popupElement = this.GetPopupElement(index, popupElementIndex); 1261 if(popupElement) 1262 this.SetLastShownPopupElementIndex(index, popupElementIndex); 1263 var isDragged = this.GetIsDragged(index); 1264 var horizontalPopupPosition = this.GetClientPopupPos(element, popupElement, x, true, isDragged); 1265 var verticalPopupPosition = this.GetClientPopupPos(element, popupElement, y, false, isDragged); 1266 var clientX = horizontalPopupPosition.position; 1267 var clientY = verticalPopupPosition.position; 1268 this.SetWindowPos(index, element, clientX, clientY); 1269 if(shouldResetScrollSize) 1270 scrollDiv.style.height = savedScrollDivHeight; 1271 if(this.hideBodyScrollWhenMaximized && this.GetIsMaximized(index)) 1272 ASPxClientPopupUtils.BodyScrollHelper.HideBodyScroll(element.id); 1273 this.DoShowWindowModalElement(index); 1274 var isAnimationNeed = this.IsAnimationAllowed() && !isMoving; 1275 if(isAnimationNeed) { 1276 if(this.popupAnimationType === 'slide') 1277 this.StartSlideAnimation(element, index, horizontalPopupPosition, verticalPopupPosition); 1278 else 1279 this.StartFadeAnimation(element, index); 1280 } else 1281 _aspxSetElementVisibility(element, true); 1282 this.SetWindowPopUpReasonMouseEvent(index, evt); 1283 if(!isAnimationNeed && __aspxNetscape && this.GetWindowModalElement(index)) { 1284 _aspxSetElementDisplay(element, false); 1285 _aspxSetElementDisplay(element, true); 1286 } 1287 this.ShowWindowContentUrl(index); 1288 this.AdjustContentOnShow(index); 1289 var scrollDiv = this.GetWindowScrollDiv(index); 1290 if(scrollDiv && this.enableContentScrolling) { 1291 var dimension = null; 1292 var windowMainCell = this.GetWindowMainCell(element); 1293 if(windowMainCell.style.width && windowMainCell.style.height) 1294 dimension = 'both'; 1295 else if(windowMainCell.style.width) 1296 dimension = 'width'; 1297 else if(windowMainCell.style.height) 1298 dimension = 'height'; 1299 if(!dimension) 1300 return; 1301 _aspxSetElementDisplay(scrollDiv, false); 1302 this.SetWindowScrollDivSize(scrollDiv, index, dimension); 1303 _aspxSetElementDisplay(scrollDiv, true); 1304 } 1305 if(!isMoving) { 1306 aspxGetPopupControlCollection().RegisterVisibleWindow(element, this, index); 1307 this.RaisePopUp(index); 1308 if(!this.IsAnimationAllowed()) 1309 this.OnWindowShown(index); 1310 } 1311 if(allowChangeZIndex) 1312 aspxGetPopupControlCollection().ActivateWindowElement(element); 1313 this.CorrectWindowSizeGripPositionLite(index); 1314 this.CorrectWindowHeaderText(index); 1315 this.InitMaximizedWindows(index); 1316 this.InitCollapsedWindows(index); 1317 if (this.GetIsPinned(index)) window.setTimeout(function(){this.HoldPosition(index, true);}.aspxBind(this), 0); 1318 if (!this.GetShowOnPageLoad(index)) 1319 this.CorrectElementVerticalAlignment(_aspxAdjustVerticalMarginsInContainer, this.GetWindowHeaderElement(index)); 1320 } 1321 }, 1322 NormalizeWindowSize: function(index, isMaximized) { 1323 var width = this.GetClientWindowWidth(index), 1324 height = this.GetClientWindowHeight(index), 1325 normWidth = width, 1326 normHeight = height, 1327 maxWidth = this.GetWindowMaxWidth(index), 1328 minWidth = this.GetWindowMinWidth(index), 1329 maxHeight = this.GetWindowMaxHeight(index), 1330 minHeight = this.GetWindowMinHeight(index); 1331 if(maxWidth) 1332 normWidth = Math.min(normWidth, maxWidth); 1333 if(minWidth) 1334 normWidth = Math.max(normWidth, minWidth); 1335 if(maxHeight) 1336 normHeight = Math.min(normHeight, maxHeight); 1337 if(minHeight) 1338 normHeight = Math.max(normHeight, minHeight); 1339 if(normWidth !== width || normHeight !== height) 1340 this.SetWindowSize(this.GetWindow(index), normWidth, normHeight); 1341 if(isMaximized) { 1342 var documentClientWidth = ASPxClientPopupUtils.GetDocumentClientWidthForPopup(); 1343 var documentClientHeight = _aspxGetDocumentClientHeight(); 1344 if(this.GetIsCollapsed(index)) { 1345 if(normWidth != documentClientWidth) { 1346 this.SetWindowSizeByIndexCore(index, documentClientWidth, normHeight, true); 1347 } 1348 } else { 1349 if(normWidth != documentClientWidth || normHeight != documentClientHeight) { 1350 this.SetWindowSizeByIndexCore(index, documentClientWidth, documentClientHeight, false); 1351 } 1352 } 1353 } 1354 }, 1355 RefreshRootDivElementSize: function(index) { 1356 if(this.IsAnimationAllowed()) { 1357 var window = this.GetWindowElement(index); 1358 var windowMainTable = this.GetWindowMainTable(window); 1359 var height = windowMainTable.offsetHeight; 1360 var width = windowMainTable.offsetWidth; 1361 height -= _aspxGetTopBottomBordersAndPaddingsSummaryValue(window); 1362 width -= _aspxGetLeftRightBordersAndPaddingsSummaryValue(window); 1363 _aspxSetStyles(window, { width: width, height: height });
1364 } 1365 }, 1366 DoShowWindowIFrame: function(index, x, y, width, height) { 1367 if(!this.renderIFrameForPopupElements) return; 1368 var element = this.GetWindowElement(index); 1369 var iFrame = this.GetWindowIFrame(index); 1370 if(element && iFrame) { 1371 var cell = this.GetWindowMainCell(element); 1372 if(width < 0) 1373 width = cell.offsetWidth; 1374 if(height < 0) 1375 height = cell.offsetHeight; 1376 _aspxSetStyles(iFrame, { width: width, height: height }); 1377 if (x != __aspxInvalidPosition && y != __aspxInvalidPosition) 1378 _aspxSetStyles(iFrame, { left: x, top: y }); 1379 if(__aspxIE || __aspxFirefox) 1380 this.ClearWindowIframeBodyInnerHtml(iFrame); 1381 _aspxSetElementDisplay(iFrame, true); 1382 } 1383 }, 1384 GetIframeBody: function(iFrame) { 1385 var document = iFrame.contentDocument || iFrame.contentWindow.document; 1386 if(document) 1387 return document.getElementsByTagName('body')[0]; 1388 }, 1389 ClearWindowIframeBodyInnerHtml: function(iFrame) { 1390 var iFrameBody = this.GetIframeBody(iFrame); 1391 if(iFrameBody) 1392 iFrameBody.innerHTML = ""; 1393 }, 1394 DoShowWindowModalElement: function(index) { 1395 var modalElement = this.GetWindowModalElement(index); 1396 if(modalElement) { 1397 var bodyScrollHasJustBeingHidden = false; 1398 if(this.hideBodyScrollWhenModal && !this.IsWindowVisible(this.GetWindow(index))) { 1399 bodyScrollHasJustBeingHidden = true; 1400 aspxGetPopupControlCollection().LockWindowResizeByBodyScrollVisibilityChanging(); 1401 ASPxClientPopupUtils.BodyScrollHelper.HideBodyScroll(this.GetWindowElementId(index)); 1402 } 1403 if (__aspxIE) 1404 _aspxAttachEventToElement(modalElement, _aspxGetMouseWheelEventName(), function (evt) { return _aspxPreventEventAndBubble(evt); }); 1405 _aspxSetElementDisplay(modalElement, true); 1406 aspxGetPopupControlCollection().AdjustModalElementBounds(modalElement); 1407 if (this.popupAnimationType == "fade") { 1408 var endOpacity = this.GetModalElementEndAnimationOpacity(index); 1409 if (__aspxIE && __aspxBrowserMajorVersion < 9) { 1410 _aspxSetElementVisibility(modalElement, true); 1411 ASPxAnimationHelper.setOpacity(modalElement, 0); 1412 } else { 1413 ASPxAnimationHelper.setOpacity(modalElement, 0); 1414 _aspxSetElementVisibility(modalElement, true); 1415 } 1416 ASPxAnimationHelper.fadeTo(modalElement, { to: endOpacity }); 1417 } else { 1418 _aspxSetElementVisibility(modalElement, true); 1419 } 1420 aspxGetPopupControlCollection().RegisterVisibleModalElement(modalElement); 1421 if(bodyScrollHasJustBeingHidden) 1422 aspxGetPopupControlCollection().UnlockWindowResizeByBodyScrollVisibilityChanging(); 1423 } 1424 }, 1425 DoHideWindowCore: function(index) { 1426 this.FFTextCurFixHide(index, true); 1427 var element = this.GetWindowElement(index); 1428 if(element != null) { 1429 if(this.HasCloseAnimation()) 1430 this.PrepareElementAfterCloseAnimation(element); 1431 element.isHiding = true; 1432 this.SetIsDragged(index, false); 1433 this.UpdateWindowsStateInputElement(); 1434 this.UpdateWindowsStateCookie(); 1435 element.isHiding = false; 1436 this.StopShowAnimation(index); 1437 _aspxSetElementDisplay(element, false); 1438 _aspxSetElementVisibility(element, false); 1439 if(this.hideBodyScrollWhenMaximized && this.GetIsMaximized(index)) 1440 ASPxClientPopupUtils.BodyScrollHelper.RestoreBodyScroll(element.id); 1441 this.DoHideWindowModalElement(element); 1442 this.DoHideWindowIFrame(element); 1443 aspxGetPopupControlCollection().UnregisterVisibleWindow(element); 1444 this.HideWindowLoadingPanel(index); 1445 } 1446 }, 1447 PrepareElementAfterCloseAnimation: function(element) { 1448 element.closeAnimationCompleted = true; 1449 if(this.closeAnimationType == "fade") 1450 _aspxSetStyles(element, { opacity: 1 }); 1451 else 1452 _aspxSetStyles(this.GetWindowMainTable(element), { 1453 left: 0, 1454 top: 0 1455 }); 1456 }, 1457 HasCloseAnimation: function(){ 1458 return this.closeAnimationType != "none"; 1459 }, 1460 StopCloseAnimation: function(index) { 1461 var element = this.GetWindowElement(index); 1462 if(this.HasCloseAnimation() && !element.closeAnimationCompleted) { 1463 ASPxAnimationHelper.cancelAnimation(element); 1464 this.DoHideWindowCore(index); 1465 } 1466 }, 1467 StopShowAnimation: function(index){ 1468 if(this.popupAnimationType != "none") { 1469 var stopAnimation = this.popupAnimationType === 'slide' ? ASPxClientPopupUtils.StopAnimation : ASPxAnimationHelper.cancelAnimation; 1470 stopAnimation(this.GetWindowElement(index)); 1471 } 1472 }, 1473 DoHideWindowCoreWithAnimation: function(index) { 1474 this.StopShowAnimation(index); 1475 var element = this.GetWindowElement(index); 1476 element.closeAnimationCompleted = false; 1477 if (this.closeAnimationType == "fade") { 1478 if (element.modalElement) 1479 ASPxAnimationHelper.fadeOut(element.modalElement, null, this.fadeAnimationDuration); 1480 ASPxAnimationHelper.fadeOut(element, function() { 1481 this.DoHideWindowCore(index); 1482 this.RaiseCloseUp(index); 1483 }.aspxBind(this), this.fadeAnimationDuration); 1484 } 1485 else 1486 this.DoHideWindowWithSlideAnimation(index); 1487 }, 1488 DoHideWindowWithSlideAnimation: function(index) { 1489 var element = this.GetWindowElement(index); 1490 var horizontalPopupPosition = this.GetClientPopupPos(element, null, __aspxInvalidPosition, true, true); 1491 var verticalPopupPosition = this.GetClientPopupPos(element, null, __aspxInvalidPosition, false, true); 1492 var horizontalDirection = ASPxClientPopupUtils.GetAnimationHorizontalDirection(horizontalPopupPosition, this.popupHorizontalAlign, this.popupVerticalAlign, this.rtl); 1493 var verticalDirection = ASPxClientPopupUtils.GetAnimationVerticalDirection(verticalPopupPosition, this.popupHorizontalAlign, this.popupVerticalAlign); 1494 ASPxClientPopupUtils.InitAnimationDivCore(element); 1495 ASPxAnimationHelper.createMultipleAnimationTransition(this.GetWindowMainTable(element), { 1496 duration: this.slideAnimationDuration, 1497 onComplete: function (element) { 1498 this.DoHideWindowCore(index); 1499 this.RaiseCloseUp(index); 1500 }.aspxBind(this) 1501 }).Start({
1502 left: { to: horizontalDirection * element.offsetWidth, unit: "px" }, 1503 top: { to: verticalDirection * element.offsetHeight, unit: "px" } 1504 }); 1505 }, 1506 DoHideWindow: function(index, dontRaiseClosing) { 1507 if(!this.InternalIsWindowVisible(index)) return; 1508 var cancel = !dontRaiseClosing && this.RaiseClosing(index); 1509 if(!cancel) { 1510 if(this.HasCloseAnimation()) 1511 this.DoHideWindowCoreWithAnimation(index); 1512 else { 1513 this.DoHideWindowCore(index); 1514 this.RaiseCloseUp(index); 1515 } 1516 } 1517 return cancel; 1518 }, 1519 DoHideWindowIFrame: function(element) { 1520 if(!this.renderIFrameForPopupElements) return; 1521 var iFrame = element.overflowElement; 1522 if(iFrame) 1523 _aspxSetElementDisplay(iFrame, false); 1524 }, 1525 DoHideWindowModalElement: function(element) { 1526 var modalElement = element.modalElement; 1527 if(modalElement) { 1528 aspxGetPopupControlCollection().UnregisterVisibleModalElement(modalElement); 1529 if(this.hideBodyScrollWhenModal) { 1530 if(__aspxWebKitFamily) 1531 aspxGetPopupControlCollection().LockScrollEvent(); 1532 ASPxClientPopupUtils.BodyScrollHelper.RestoreBodyScroll(element.id); 1533 if(__aspxWebKitFamily) 1534 aspxGetPopupControlCollection().UnlockScrollEvent(); 1535 } 1536 _aspxSetStyles(modalElement, { width: 1, height: 1 }); 1537 _aspxSetElementVisibility(modalElement, false); 1538 _aspxSetElementDisplay(modalElement, false); 1539 } 1540 }, 1541 SetWindowDisplay: function(index, value) { 1542 var pcwElement = this.GetWindowElement(index); 1543 this.SetFFTextCurFixShowing(index, value, false); 1544 _aspxSetElementDisplay(pcwElement, value); 1545 }, 1546 GetTextCurFixDiv: function(index) { 1547 return _aspxGetElementById(this.name + "_" + "TCFix" + index); 1548 }, 1549 FFTextCurFixShow: function(index, isSetVisibility) { 1550 this.SetFFTextCurFixShowing(index, true, isSetVisibility); 1551 }, 1552 FFTextCurFixHide: function(index, isSetVisibility) { 1553 this.SetFFTextCurFixShowing(index, false, isSetVisibility); 1554 }, 1555 IsFFTextCurFixRequired: function(index) { 1556 return __aspxFirefox && __aspxBrowserVersion < 3 && this.GetWindowModalElement(index); 1557 }, 1558 SetFFTextCurFixShowing: function(index, value, isSetVisibility) { 1559 if(this.IsFFTextCurFixRequired(index)) { 1560 var fixDiv = this.GetTextCurFixDiv(index); 1561 if(fixDiv) { 1562 if(isSetVisibility) 1563 _aspxSetElementVisibility(fixDiv, value); 1564 _aspxSetElementDisplay(fixDiv, value); 1565 } 1566 } 1567 }, 1568 SetWindowPos: function (index, element, x, y) { 1569 _aspxSetStyles(element, { left: x, top: y }); 1570 this.DoShowWindowIFrame(index, x, y, __aspxInvalidDimension, __aspxInvalidDimension); 1571 this.SetIsDragged(index, true); 1572 this.SetWindowLeft(index, _aspxGetAbsoluteX(element)); 1573 this.SetWindowTop(index, _aspxGetAbsoluteY(element)); 1574 this.UpdateWindowsStateInputElement(); 1575 this.UpdateWindowsStateCookie(); 1576 }, 1577 OnWindowShown: function(windowIndex) { 1578 this.EnsureContent(windowIndex, false); 1579 this.EnsureIFrameHeightAdjusted(windowIndex); 1580 this.NormalizeWindowSize(windowIndex, this.GetIsMaximized(windowIndex)); 1581 this.RaiseShown(windowIndex); 1582 var loadingElementsWillNotBeShown = !this.lpTimers[windowIndex] || this.lpTimers[windowIndex] < 0; 1583 if(this.InWindowCallback(windowIndex) && loadingElementsWillNotBeShown) { 1584 this.ShowWindowLoadingElementsInternal(windowIndex); 1585 } 1586 }, 1587 EnsureContent: function(windowIndex, isInit) { 1588 var element = this.GetWindowElement(windowIndex); 1589 if(element && !element.loaded && !element.loading) { 1590 var shouldLoad = this.contentLoadingMode == "OnPageLoad" || this.contentLoadingMode == "OnFirstShow" && !isInit; 1591 if(shouldLoad) { 1592 element.loading = true; 1593 this.CreateWindowCallback(windowIndex, windowIndex); 1594 } else if(this.contentLoadingMode == "Default") 1595 element.loaded = true; 1596 } 1597 }, 1598 CreateWindowCallback: function(windowIndex, argument) { 1599 this.IncreaseWindowRequestCount(windowIndex); 1600 var element = this.GetWindowElement(windowIndex); 1601 if(this.contentLoadingMode != "OnPageLoad" || !element.loading || this.GetShowOnPageLoad(windowIndex)) 1602 this.ShowWindowLoadingElements(windowIndex); 1603 this.CreateCallback(argument); 1604 }, 1605 OnCallback: function(result) { 1606 this.OnCallbackInternal(result.html, result.index, false); 1607 }, 1608 OnCallbackError: function(result, data) { 1609 this.OnCallbackInternal(result, _aspxIsExists(data) ? data : -1, true); 1610 }, 1611 OnCallbackErrorAfterUserHandle: function(result, data) { 1612 this.DecreaseWindowRequestCount(data); 1613 }, 1614 RaiseCallbackError: function (message) { 1615 var result = ASPxClientControl.prototype.RaiseCallbackError.call(this, message); 1616 if (result.isHandled) 1617 this.HideAllLoadingPanels(); 1618 return result; 1619 }, 1620 OnCallbackInternal: function(html, windowIndex, isError) { 1621 var element = this.GetWindowElement(windowIndex); 1622 element.loaded = !isError; 1623 element.loading = false; 1624 this.DecreaseWindowRequestCount(windowIndex); 1625 this.HideWindowLoadingPanel(windowIndex); 1626 this.SetWindowContentHtmlCore(windowIndex, html) 1627 this.savedCallbackWindowIndex = windowIndex; 1628 this.UpdateWindowsStateInputElement(); 1629 this.UpdateWindowsStateCookie(); 1630 }, 1631 IncreaseWindowRequestCount: function(index) { 1632 !this.windowRequestCount[index] ? this.windowRequestCount[index] = 1 : this.windowRequestCount[index]++; 1633 }, 1634 DecreaseWindowRequestCount: function(index) { 1635 this.windowRequestCount[index]--; 1636 }, 1637 InWindowCallback: function(windowIndex) { 1638 return this.windowRequestCount[windowIndex] > 0; 1639 }, 1640 ShowWindowLoadingElements: function(windowIndex) { 1641 if(this.lpTimers[windowIndex] && this.lpTimers[windowIndex] > -1) return;
1642 if(this.enableCallbackAnimation) 1643 this.StartWindowBeginCallbackAnimation(windowIndex); 1644 else 1645 this.ShowWindowLoadingElementsInternal(windowIndex); 1646 }, 1647 ShowWindowLoadingElementsInternal: function(windowIndex) { 1648 if(this.lpDelay > 1 && !this.enableCallbackAnimation) { 1649 var _this = this; 1650 this.lpTimers[windowIndex] = _aspxSetTimeout(function() { _this.ShowWindowLoadingPanelOnTimer(windowIndex); }, this.lpDelay); 1651 } 1652 else 1653 this.ShowWindowLoadingPanel(windowIndex); 1654 }, 1655 StartWindowBeginCallbackAnimation: function (windowIndex) { 1656 this.callbackAnimationProcessings[windowIndex] = true; 1657 this.isCallbackFinishedStates[windowIndex] = false; 1658 ASPxAnimationHelper.fadeOut(this.GetWindowContentElement(windowIndex), function() { this.FinishWindowBeginCallbackAnimation(windowIndex); }.aspxBind(this)); 1659 }, 1660 FinishWindowBeginCallbackAnimation: function (windowIndex) { 1661 this.callbackAnimationProcessings[windowIndex] = false; 1662 if(!this.isCallbackFinishedStates[windowIndex]) 1663 this.ShowWindowLoadingElementsInternal(windowIndex); 1664 else 1665 this.DoCallback(this.savedCallbackResults[windowIndex]); 1666 },
1667 CheckBeginCallbackAnimationInProgress: function(callbackResult) { 1668 var windowIndex = this.EvalCallbackResult(callbackResult).result.index; 1669 if(this.enableCallbackAnimation && this.callbackAnimationProcessings[windowIndex]) { 1670 this.savedCallbackResults[windowIndex] = callbackResult; 1671 this.isCallbackFinishedStates[windowIndex] = true; 1672 return true; 1673 } 1674 return false; 1675 }, 1676 StartWindowEndCallbackAnimation: function(windowIndex) { 1677 this.callbackAnimationProcessings[windowIndex] = true; 1678 ASPxAnimationHelper.fadeIn(this.GetWindowContentElement(windowIndex), function() { this.FinishWindowEndCallbackAnimation(windowIndex); }.aspxBind(this)); 1679 }, 1680 FinishWindowEndCallbackAnimation: function(windowIndex) { 1681 this.DoEndCallback(); 1682 this.callbackAnimationProcessings[windowIndex] = false; 1683 }, 1684 CheckEndCallbackAnimationNeeded: function() { 1685 var windowIndex = this.savedCallbackWindowIndex; 1686 this.savedCallbackWindowIndex = null; 1687 if(windowIndex !== null && !this.callbackAnimationProcessings[windowIndex]) { 1688 this.StartWindowEndCallbackAnimation(windowIndex); 1689 return true; 1690 } 1691 return false; 1692 }, 1693 CreateLoadingDiv: function(parentElement, offsetElement, windowIndex) { 1694 if(typeof(windowIndex) != "undefined") { 1695 var loadingDiv = ASPxClientControl.prototype.CreateLoadingDiv.call(this, parentElement, offsetElement); 1696 loadingDiv.id += windowIndex; 1697 return loadingDiv; 1698 } 1699 }, 1700 CreateLoadingPanelWithAbsolutePosition: function(parentElement, offsetElement, windowIndex) { 1701 if(typeof(windowIndex) != "undefined") { 1702 var loadingPanel = ASPxClientControl.prototype.CreateLoadingPanelWithAbsolutePosition.call(this, parentElement, offsetElement); 1703 loadingPanel.id += windowIndex; 1704 return loadingPanel; 1705 } 1706 }, 1707 ShowWindowLoadingPanelOnTimer: function(windowIndex) { 1708 this.ClearWindowLoadingPanelTimer(windowIndex); 1709 this.ShowWindowLoadingPanel(windowIndex); 1710 }, 1711 ClearWindowLoadingPanelTimer: function(windowIndex) { 1712 this.lpTimers[windowIndex] = _aspxClearTimer(this.lpTimers[windowIndex]); 1713 }, 1714 ShowWindowLoadingPanel: function(windowIndex) { 1715 if (!this.IsExistLoadingPanel()) 1716 return; 1717 if(!this.loadingPanels[windowIndex]) { 1718 var contentElement = this.GetWindowContentWrapperElement(windowIndex); 1719 this.loadingDivs[windowIndex] = this.CreateLoadingDiv(this.GetWindowElement(windowIndex).parentNode, contentElement, windowIndex); 1720 this.loadingPanels[windowIndex] = this.CreateLoadingPanelWithAbsolutePosition(this.GetWindowElement(windowIndex).parentNode, contentElement, windowIndex); 1721 } 1722 }, 1723 HideAllLoadingPanels: function () { 1724 if (this.HasDefaultWindow()) 1725 this.HideWindowLoadingPanel(-1); 1726 for (var i = 0; i < this.GetWindowCount() ; i++) 1727 this.HideWindowLoadingPanel(i); 1728 }, 1729 HideWindowLoadingPanel: function(windowIndex) { 1730 this.ClearWindowLoadingPanelTimer(windowIndex); 1731 if(this.loadingDivs[windowIndex]) { 1732 _aspxRemoveElement(this.loadingDivs[windowIndex]); 1733 this.loadingDivs[windowIndex] = null; 1734 } 1735 if(this.loadingPanels[windowIndex]) { 1736 _aspxRemoveElement(this.loadingPanels[windowIndex]); 1737 this.loadingPanels[windowIndex] = null; 1738 } 1739 }, 1740 ShouldHideExistingLoadingElements: function() { 1741 return false; 1742 }, 1743 IsLoadingContainerVisible: function() { 1744 return true; 1745 }, 1746 IsExistLoadingPanel: function() { 1747 return !!this.GetLoadingDiv(); 1748 }, 1749 InitializeDOM: function() { 1750 if(this.HasDefaultWindow()) { 1751 var windowElement = this.GetWindowElement(-1); 1752 if(windowElement) 1753 windowElement["dxinit"] = true; 1754 } 1755 for(var i = 0; i < this.GetWindowCount(); i++) { 1756 var windowElement = this.GetWindowElement(i); 1757 if(windowElement) 1758 windowElement["dxinit"] = true; 1759 } 1760 }, 1761 IsDOMInitialized: function() { 1762 if(this.HasDefaultWindow()) { 1763 var windowElement = this.GetWindowElement(-1); 1764 return windowElement && windowElement["dxinit"]; 1765 } 1766 for(var i = 0; i < this.GetWindowCount(); i++) { 1767 var windowElement = this.GetWindowElement(i); 1768 if(!windowElement || !windowElement["dxinit"]) 1769 return false; 1770 } 1771 return true; 1772 }, 1773 PerformCallback: function(parameter) { 1774 this.PerformWindowCallback(null, parameter); 1775 }, 1776 PerformWindowCallback: function(window, parameter) { 1777 parameter = _aspxIsExists(parameter) ? parameter.toString() : "" 1778 var index = (window != null) ? window.index : -1; 1779 if(!this.InWindowCallback(index)) { 1780 var windowCallbackArguments = index + ";" + parameter; 1781 this.CreateWindowCallback(index, windowCallbackArguments); 1782 } 1783 }, 1784 RegisterInControlTree: function(tree) { 1785 var mainNode = tree.createNode(null, this); 1786 if(this.HasDefaultWindow()) 1787 this.RegisterRelatedNodeForWindowElement(tree, -1, mainNode); 1788 for(var i = 0; i < this.GetWindowCount(); i++) 1789 this.RegisterRelatedNodeForWindowElement(tree, i, mainNode); 1790 }, 1791 RegisterRelatedNodeForWindowElement: function(tree, windowElementIndex, mainNode) { 1792 var windowElement = this.GetWindowElement(windowElementIndex); 1793 if(windowElement) { 1794 var childNode = tree.createNode(windowElement.id, null); 1795 tree.addRelatedNode(mainNode, childNode); 1796 } 1797 }, 1798 PrepareContentCellForHeigthCorrection: function(windowIndex) { 1799 if(__aspxIE) 1800 this.GetWindowContentElement(windowIndex).style.height = "0px"; 1801 }, 1802 CorrectContentCellHeight: function(element, isResizing) { 1803 if(__aspxIE) 1804 this.CorrectContentCellHeightIE(element, isResizing); 1805 if(__aspxOpera) 1806 this.CorrectContentCellHeightOpera(element, isResizing); 1807 }, 1808 CorrectContentCellHeightOpera: function(element, isResizing) { 1809 var index = this.GetWindowIndex(element); 1810 var contentIFrame = this.GetWindowContentIFrameElement(index); 1811 if(contentIFrame) { 1812 contentIFrame.style.height = "0px"; 1813 var contentIFrameDiv = this.GetWindowContentIFrameDivElement(index); 1814 if(contentIFrameDiv) 1815 contentIFrameDiv.style.height = "0px"; 1816 var contentCell = this.GetWindowContentElement(index); 1817 var height = contentCell.clientHeight; 1818 contentIFrame.style.height = height + "px"; 1819 if(contentIFrameDiv) 1820 contentIFrameDiv.style.height = contentIFrame.style.height; 1821 var correction = contentCell.clientHeight - height; 1822 contentIFrame.style.height = (height - correction) + "px"; 1823 if(contentIFrameDiv) 1824 contentIFrameDiv.style.height = contentIFrame.style.height; 1825 } 1826 }, 1827 CorrectContentCellHeightIE: function(element, isResizing) { 1828 var index = this.GetWindowIndex(element); 1829 var clientTable = this.GetWindowClientTable(index); 1830 var headerCell = this.GetWindowHeaderElement(index); 1831 var contentCell = this.GetWindowContentElement(index); 1832 var footerCell = this.GetWindowFooterElement(index); 1833 var windowMainCell = this.GetWindowMainCell(element); 1834 var mainCellHeight = windowMainCell.clientHeight - this.GetTwoVerticalPaddingSize(windowMainCell); 1835 var headerHeight = headerCell ? _aspxGetCeilOffsetHeight(headerCell) : 0; 1836 var footerHeight = footerCell ? footerCell.offsetHeight : 0; 1837 if(isResizing) { 1838 headerHeight = this.GetHeaderHeight(index); 1839 footerHeight = this.GetFooterHeight(index); 1840 } 1841 else { 1842 this.SetHeaderHeight(index, headerHeight); 1843 this.SetFooterHeight(index, footerHeight); 1844 } 1845 var correctedHeight = Math.max(0, mainCellHeight - headerHeight - footerHeight); 1846 contentCell.style.height = correctedHeight + "px"; 1847 var verticalsPaddings = contentCell.offsetHeight - correctedHeight; 1848 contentCell.style.height = correctedHeight - verticalsPaddings + "px"; 1849 }, 1850 GetTwoVerticalPaddingSize: function(element) { 1851 var heightWithBorders = element.clientHeight; 1852 var paddingTopBackup = element.style.paddingTop; 1853 var paddingBottomBackup = element.style.paddingBottom; 1854 element.style.paddingTop = "0px";
1855 element.style.paddingBottom = "0px"; 1856 var heightWithoutBorders = element.clientHeight; 1857 element.style.paddingTop = paddingTopBackup; 1858 element.style.paddingBottom = paddingBottomBackup; 1859 return (heightWithBorders - heightWithoutBorders); 1860 }, 1861 InternalIsWindowVisible: function(index) { 1862 var element = this.GetWindowElement(index); 1863 if(!element) 1864 return false; 1865 if(this.HasCloseAnimation() && !element.closeAnimationCompleted) 1866 return false; 1867 var currentStyle = _aspxGetCurrentStyle(element); 1868 return ((currentStyle && currentStyle.visibility != "hidden") && _aspxGetElementDisplay(element) ? true : false); 1869 }, 1870 InternalIsWindowDisplayed: function(index) { 1871 var element = this.GetWindowElement(index); 1872 return (element != null) ? _aspxGetElementDisplay(element) : false; 1873 }, 1874 OnActivate: function(index, evt) { 1875 var element = this.GetWindowElement(index); 1876 if(element != null) 1877 aspxGetPopupControlCollection().ActivateWindowElement(element, evt); 1878 }, 1879 OnAnimationStop: function(index) { 1880 this.OnWindowShown(index); 1881 if(__aspxFirefox) 1882 this.GetWindowElement(index).style.display = "table"; 1883 }, 1884 OnDragStart: function(evt, index) { 1885 this.SetIsDragged(index, true); 1886 this.ShowDragCursor(index); 1887 if(this.GetWindowContentIFrameElement(index)) 1888 this.HideIframeElementBeforeDragging(index); 1889 this.InitDragInfo(index, evt); 1890 }, 1891 InitDragInfo: function(index, evt) { 1892 var element = this.GetWindowElement(index); 1893 var gragXOffset = _aspxGetAbsoluteX(element) - _aspxGetEventX(evt); 1894 var gragYOffset = _aspxGetAbsoluteY(element) - _aspxGetEventY(evt); 1895 var xClientCorrection = _aspxGetPositionElementOffset(element, true); 1896 var yClientCorrection = _aspxGetPositionElementOffset(element, false); 1897 gragXOffset -= xClientCorrection; 1898 gragYOffset -= yClientCorrection; 1899 aspxGetPopupControlCollection().InitDragObject(this, index, gragXOffset, gragYOffset, xClientCorrection, yClientCorrection); 1900 }, 1901 OnDrag: function(index, x, y, xClientCorrection, yClientCorrection) { 1902 var element = this.GetWindowElement(index); 1903 if (element != null) { 1904 _aspxSetStyles(element, { left: x, top: y }); 1905 xClientCorrection = typeof(xClientCorrection) != "undefined" ? xClientCorrection : 0; 1906 yClientCorrection = typeof(yClientCorrection) != "undefined" ? yClientCorrection : 0; 1907 this.SetWindowLeft(index, x + xClientCorrection); 1908 this.SetWindowTop(index, y + yClientCorrection); 1909 var iFrame = element.overflowElement; 1910 if (iFrame) 1911 _aspxSetStyles(iFrame, { left: x, top: y }); 1912 if(__aspxOpera) 1913 _aspxClearSelection(); 1914 } 1915 }, 1916 OnDragStop: function(index) { 1917 var element = this.GetWindowElement(index); 1918 this.HideDragCursor(index); 1919 this.UpdateWindowsStateInputElement(); 1920 this.UpdateWindowsStateCookie(); 1921 if(this.GetWindowContentIFrameElement(index)) 1922 this.ShowIframeElementAfterDragging(index); 1923 }, 1924 OnPopupElementMouseOver: function(evt, popupElement) { 1925 if(popupElement != null) { 1926 var index = popupElement.DXPopupWindowIndex; 1927 var isVisible = this.InternalIsWindowVisible(index); 1928 var popupElementIndex = popupElement.DXPopupElementIndex; 1929 if(this.GetLastOverPopupElementIndex(index) != popupElementIndex) { 1930 if(aspxGetPopupControlCollection().IsAppearTimerActive()) 1931 aspxGetPopupControlCollection().ClearAppearTimer(); 1932 if(aspxGetPopupControlCollection().IsDisappearTimerActive()) 1933 aspxGetPopupControlCollection().ClearDisappearTimer(); 1934 if(isVisible) { 1935 this.DoHideWindow(index); 1936 isVisible = false; 1937 } 1938 } 1939 if(!isVisible) { 1940 aspxGetPopupControlCollection().SetAppearTimer(this.name, index, popupElement.DXPopupElementIndex, this.appearAfter, evt); 1941 aspxGetPopupControlCollection().InitOverObject(this, index, evt); 1942 } 1943 this.SetLastOverPopupElementIndex(index, popupElementIndex); 1944 } 1945 }, 1946 OnPopupElementMouseOut: function(evt, popupElement) { 1947 }, 1948 HideIframeElementBeforeDragging: function(index) { 1949 var iframeElement = this.GetWindowContentIFrameElement(index); 1950 if(__aspxIE) { 1951 this.CreateFakeDragDiv(iframeElement); 1952 _aspxSetElementDisplay(iframeElement, false); 1953 } else 1954 _aspxSetElementVisibility(iframeElement, false); 1955 }, 1956 ShowIframeElementAfterDragging: function(index) { 1957 var iframeElement = this.GetWindowContentIFrameElement(index); 1958 if(this.fakeDragDiv != null) { 1959 this.RemoveFakeDragDiv(iframeElement); 1960 _aspxSetElementDisplay(iframeElement, true); 1961 } else 1962 _aspxSetElementVisibility(iframeElement, true); 1963 }, 1964 CreateFakeDragDiv: function(iframe) { 1965 this.fakeDragDiv = document.createElement("div"); 1966 _aspxSetStyles(this.fakeDragDiv, { width: iframe.offsetWidth, height: iframe.offsetHeight });
1967 iframe.parentElement.appendChild(this.fakeDragDiv); 1968 }, 1969 RemoveFakeDragDiv: function(iframe) { 1970 iframe.parentElement.removeChild(this.fakeDragDiv); 1971 this.fakeDragDiv = null; 1972 }, 1973 CreateResizePanel: function(index) { 1974 var element = this.GetWindowElement(index); 1975 var mainCell = this.GetWindowMainCell(element); 1976 var resizePanel = document.createElement("DIV"); 1977 element.parentNode.appendChild(resizePanel); 1978 resizePanel.style.overflow = "hidden"; 1979 resizePanel.style.position = "absolute"; 1980 resizePanel.style.zIndex = __aspxPopupControlZIndex + aspxGetPopupControlCollection().visiblePopupWindowIds.length * 2 + 2; 1981 if(!this.isLiveResizingMode) 1982 resizePanel.style.border = "black 1px dotted"; 1983 return resizePanel; 1984 }, 1985 OnResizeStart: function(evt, index) { 1986 if(!aspxGetPopupControlCollection().IsResizeInint()) { 1987 this.SetIsResized(index, true); 1988 var cursor = this.CreateResizeCursorInfo(evt, index); 1989 if(cursor.course != "") { 1990 var resizePanel = this.CreateResizePanel(index); 1991 this.UpdateResizeCursor(resizePanel, cursor.verticalDirection, cursor.horizontalDirection); 1992 aspxGetPopupControlCollection().InitResizeObject(this, index, cursor, resizePanel); 1993 this.OnResize(evt, index, cursor, resizePanel); 1994 } 1995 } 1996 return aspxGetPopupControlCollection().IsResizeInint(); 1997 }, 1998 OnResize: function(evt, index, cursor, resizePanel) { 1999 this.OnResizePanelLite(evt, index, cursor, resizePanel); 2000 if(this.isLiveResizingMode) 2001 this.OnResizeWindow(index, cursor, resizePanel); 2002 _aspxClearSelection(); 2003 if(__aspxWebKitTouchUI) 2004 evt.preventDefault(); 2005 if (this.GetIsPinned(index)) 2006 this.HoldPosition(index, true, resizePanel); 2007 }, 2008 OnResizePanelLite: function(evt, index, cursor, resizePanel) { 2009 var x = _aspxGetEventX(evt); 2010 var y = _aspxGetEventY(evt); 2011 var element = this.GetWindowElement(index); 2012 if(__aspxIE && __aspxBrowserVersion >= 10) { 2013 x = Math.round(x); 2014 y = Math.round(y); 2015 } 2016 var newLeft = _aspxGetAbsoluteX(element); 2017 var newTop = _aspxGetAbsoluteY(element); 2018 var newWidth = element.offsetWidth; 2019 var newHeight = element.offsetHeight; 2020 if(cursor.verticalDirection == "n") { 2021 if(!this.fixedBottom) 2022 this.fixedBottom = newTop + newHeight; 2023 newHeight = newHeight + (newTop - y) + cursor.verticalOffset; 2024 newTop = y - cursor.verticalOffset; 2025 } 2026 if(cursor.verticalDirection == "s") { 2027 newHeight = newHeight + (y - (newTop + newHeight)) + cursor.verticalOffset; 2028 this.fixedBottom = null; 2029 } 2030 if(cursor.horizontalDirection == "w") { 2031 if(!this.fixedRight) 2032 this.fixedRight = newLeft + newWidth;
2033 newWidth = newWidth + (newLeft - x) + cursor.horizontalOffset; 2034 newLeft = x - cursor.horizontalOffset; 2035 } 2036 if(cursor.horizontalDirection == "e") { 2037 newWidth = newWidth + (x - (newLeft + newWidth)) + cursor.horizontalOffset; 2038 this.fixedRight = null; 2039 } 2040 if(newWidth > 0 && newHeight > 0) { 2041 var minWidth = this.GetWindowMinWidth(index); 2042 var maxWidth = this.GetWindowMaxWidth(index); 2043 if(minWidth && newWidth < minWidth) 2044 newWidth = minWidth; 2045 if(maxWidth && newWidth > maxWidth) 2046 newWidth = maxWidth; 2047 var minHeight = this.GetWindowMinHeight(index); 2048 var maxHeight = this.GetWindowMaxHeight(index); 2049 if(minHeight && newHeight < minHeight) 2050 newHeight = minHeight; 2051 if(maxHeight && newHeight > maxHeight) 2052 newHeight = maxHeight; 2053 newLeft = _aspxPrepareClientPosForElement(newLeft, element, true); 2054 newTop = _aspxPrepareClientPosForElement(newTop, element, false); 2055 if(__aspxIE && __aspxBrowserVersion >= 10) { 2056 newLeft = Math.round(newLeft); 2057 newTop = Math.round(newTop); 2058 newHeight = Math.round(newHeight); 2059 newWidth = Math.round(newWidth); 2060 } 2061 _aspxSetStyles(resizePanel, { 2062 left: newLeft, top: newTop, 2063 width: newWidth, height: newHeight 2064 }); 2065 this.SetWindowLeft(index, _aspxGetAbsoluteX(element)); 2066 this.SetWindowTop(index, _aspxGetAbsoluteY(element)); 2067 } 2068 }, 2069 OnResizeWindow: function(index, cursor, resizePanel) { 2070 var windowElement = this.GetWindowElement(index); 2071 var left = _aspxGetAbsoluteX(resizePanel); 2072 var top = _aspxGetAbsoluteY(resizePanel); 2073 this.SetClientWindowSizeLite(index, resizePanel.offsetWidth, resizePanel.offsetHeight); 2074 var bottom = top + windowElement.offsetHeight; 2075 var right = left + windowElement.offsetWidth; 2076 if(this.fixedBottom && (bottom > this.fixedBottom || bottom < this.fixedBottom)) 2077 top = this.fixedBottom - windowElement.offsetHeight; 2078 if(this.fixedRight && (right > this.fixedRight || right < this.fixedRight)) 2079 left = this.fixedRight - windowElement.offsetWidth; 2080 this.fixedBottom = null; 2081 this.fixedRight = null; 2082 var styleLeft = _aspxPrepareClientPosForElement(left, windowElement, true); 2083 var styleTop = _aspxPrepareClientPosForElement(top, windowElement, false); 2084 if(__aspxIE && __aspxBrowserVersion >= 10) { 2085 styleLeft = Math.round(styleLeft); 2086 styleTop = Math.round(styleTop); 2087 } 2088 _aspxSetStyles(windowElement, { 2089 left: styleLeft, 2090 top: styleTop 2091 }); 2092 if(this.InternalIsWindowVisible(index)) 2093 this.DoShowWindowIFrame(index, left, top, __aspxInvalidDimension, __aspxInvalidDimension); 2094 this.CorrectElementVerticalAlignment(_aspxAdjustVerticalMarginsInContainer, this.GetWindowHeaderElement(index), true); 2095 }, 2096 OnResizeStop: function(evt, index, cursor, resizePanel) { 2097 if(this.allowResize) { 2098 if(!this.isLiveResizingMode) { 2099 var windowElement = this.GetWindowElement(index); 2100 aspxGetControlCollection().CollapseControls(windowElement); 2101 this.OnResizeWindow(index, cursor, resizePanel); 2102 } 2103 this.CreateResizeCursorInfo(evt, index); 2104 this.UpdateWindowsStateInputElement(); 2105 this.UpdateWindowsStateCookie(); 2106 this.RaiseResize(index); 2107 if(!this.isLiveResizingMode) 2108 aspxGetControlCollection().AdjustControls(windowElement, true); 2109 this.SetWindowCachedSize(index, this.GetClientWindowWidth(index), this.GetClientWindowHeight(index)); 2110 } 2111 }, 2112 OnMouseDownModalElement: function(evt, index) { 2113 aspxGetPopupControlCollection().DoHideAllWindows(_aspxGetEventSource(evt), "", false); 2114 this.SetIsPopuped(index, true) 2115 }, 2116 IsRaiseAfterResizingLocked: function(){ 2117 return this.CollapseExecuting() || this.MaximizationExecuting(); 2118 }, 2119 SetClientWindowSizeLite: function(index, width, height, isWindowCollapsed) { 2120 this.RaiseBeforeResizing(index); 2121 this.SetClientWindowSizeCoreLite(index, width, height, isWindowCollapsed); 2122 if(!this.IsRaiseAfterResizingLocked()) 2123 this.RaiseAfterResizing(index); 2124 }, 2125 HasAnyScrollBars: function(index) { 2126 var contentElement = this.GetWindowContentElement(index); 2127 var hasBothScrollBars = contentElement.style.overflow == "scroll" || contentElement.style.overflow == "auto"; 2128 return hasBothScrollBars || contentElement.style.overflowX == "scroll" || 2129 contentElement.style.overflowY == "scroll" || contentElement.style.overflowX == "auto" || 2130 contentElement.style.overflowY == "auto"; 2131 }, 2132 SetClientWindowSizeCoreLite: function(index, width, height, isWindowCollapsed) { 2133 var contentUrl = this.GetWindowContentIFrameUrl(index); 2134 var needToHideContent = !contentUrl; 2135 var element = this.GetWindowElement(index); 2136 var contentWrapper = this.GetWindowContentWrapperElement(index); 2137 var contentElement = this.GetWindowContentElement(index); 2138 if(__aspxIE) { 2139 var scrollTop = contentElement.scrollTop; 2140 var scrollLeft = contentElement.scrollLeft; 2141 } 2142 var contentIframeElement = this.GetWindowContentIFrameElement(index); 2143 var iframeHeightCorrectionOnFirstShow = height > 0; 2144 if(contentIframeElement && (this.GetWindowIsShown(index) || iframeHeightCorrectionOnFirstShow)) 2145 contentIframeElement.style.height = "0px"; 2146 contentWrapper.style.height = ""; 2147 contentWrapper.style.width = ""; 2148 contentElement.style.height = ""; 2149 contentElement.style.width = ""; 2150 if(needToHideContent) { 2151 if(__aspxIE && __aspxBrowserMajorVersion >= 7) { 2152 var contentElementChildren = contentElement.getElementsByTagName("*"), 2153 contentElementChildrenScroll = []; 2154 for(var i = 0; i < contentElementChildren.length; i++) { 2155 var child = contentElementChildren[i]; 2156 if(!!child.scrollLeft || !!child.scrollTop) 2157 contentElementChildrenScroll.push([i, child.scrollLeft, child.scrollTop]); 2158 } 2159 } 2160 contentElement.style.display = "none"; 2161 }
2162 var hasAnyScrollBars = this.HasAnyScrollBars(index); 2163 var elementsDisplayValue = (width || height) && hasAnyScrollBars || this.IeWithoutSupportDisplayTable() ? "block" : "table"; 2164 element.style.display = elementsDisplayValue; 2165 if (!this.GetIsCollapsed(index)) 2166 contentWrapper.style.display = elementsDisplayValue; 2167 if(typeof(width) != "undefined") { 2168 var actualWidth = width - _aspxGetLeftRightBordersAndPaddingsSummaryValue(element); 2169 if(actualWidth < 0) 2170 actualWidth = 0; 2171 element.style.width = actualWidth + "px"; 2172 if(element.offsetWidth != width){ 2173 actualWidth += (width - element.offsetWidth); 2174 if(actualWidth < 0) actualWidth = 0; 2175 element.style.width = actualWidth + "px"; 2176 } 2177 if(__aspxWebKitFamily && hasAnyScrollBars) { 2178 var mainDiv = this.GetWindowMainCell(element); 2179 var dxpcMainDiv = _aspxGetDescendantNodesByClassName(mainDiv, "dxpc-mainDiv")[0]; 2180 var dxpcMainDivBordersAndPaddings = dxpcMainDiv ? _aspxGetLeftRightBordersAndPaddingsSummaryValue(dxpcMainDiv) : 0; 2181 contentWrapper.style.width = width - _aspxGetLeftRightBordersAndPaddingsSummaryValue(mainDiv) - dxpcMainDivBordersAndPaddings + "px"; 2182 } 2183 } 2184 if(typeof(height) != "undefined") { 2185 var actualHeight = height - _aspxGetTopBottomBordersAndPaddingsSummaryValue(element); 2186 if(actualHeight < 0) 2187 actualHeight = 0; 2188 element.style.height = actualHeight + "px"; 2189 if(element.offsetHeight != height){ 2190 actualHeight += (height - element.offsetHeight); 2191 if(actualHeight < 0) actualHeight = 0; 2192 element.style.height = actualHeight + "px"; 2193 } 2194 } 2195 this.CorrectWindowSizeGripPositionLite(index); 2196 this.CorrectWindowHeaderText(index); 2197 this.SetContentWrapperHeightLite(index); 2198 var correctContentElementSize = hasAnyScrollBars || contentElement.style.overflow == "hidden" || contentElement.style.overflowX == "hidden" || contentElement.style.overflowY == "hidden"; 2199 if((correctContentElementSize || contentUrl) && height) { 2200 var contentHeight = _aspxGetClearClientHeight(contentWrapper) - 2201 _aspxGetTopBottomBordersAndPaddingsSummaryValue(contentElement); 2202 if(contentHeight < 0) 2203 contentHeight = 0; 2204 contentElement.style.height = contentHeight + "px"; 2205 } 2206 if(correctContentElementSize && width) 2207 _aspxSetOffsetWidth(contentElement, _aspxGetClearClientWidth(contentWrapper)); 2208 contentElement.style.display = "block"; 2209 if(this.IeWithoutSupportDisplayTable() && _aspxGetClearClientHeight(contentWrapper) < contentElement.offsetHeight) { 2210 contentWrapper.style.height = contentElement.offsetHeight + "px"; 2211 contentWrapper.style.height = ""; 2212 } 2213 if(_aspxIsExists(contentElementChildrenScroll) && contentElementChildrenScroll.length > 0) { 2214 for(var i = 0; i < contentElementChildrenScroll.length; i++) { 2215 var childScroll = contentElementChildrenScroll[i], 2216 childIndex = childScroll[0], 2217 childScrollLeft = childScroll[1], 2218 childScrollTop = childScroll[2]; 2219 if(!!childScrollLeft) 2220 contentElementChildren[childIndex].scrollLeft = childScrollLeft; 2221 if(!!childScrollTop) 2222 contentElementChildren[childIndex].scrollTop = childScrollTop; 2223 } 2224 } 2225 if(__aspxIE) { 2226 contentElement.scrollTop = scrollTop; 2227 contentElement.scrollLeft = scrollLeft; 2228 } 2229 if(contentIframeElement) 2230 contentIframeElement.style.height = "100%"; 2231 this.SetWindowWidth(index, width); 2232 this.SetWindowHeight(index, height); 2233 if (isWindowCollapsed) 2234 this.ResetWindowHeight(index); 2235 }, 2236 SetContentWrapperHeightLite: function(index) { 2237 var windowElem = this.GetWindowElement(index); 2238 if(!windowElem.style.height || _aspxIsPercentageSize(windowElem.style.height)) 2239 return; 2240 var borderOwner; 2241 if (_aspxElementHasCssClass(windowElem, ASPxClientPopupControlCssClasses.MainDivLiteCssClass)) 2242 borderOwner = windowElem; 2243 else 2244 borderOwner = _aspxGetDescendantNodesByClassName(windowElem, ASPxClientPopupControlCssClasses.MainDivLiteCssClass)[0]; 2245 var height = windowElem.offsetHeight - _aspxGetTopBottomBordersAndPaddingsSummaryValue(borderOwner); 2246 if (this.IeWithoutSupportDisplayTable() && height == 1) 2247 height = 0; 2248 var extenders = [ 2249 this.GetWindowHeaderElement(index), 2250 this.GetWindowFooterElement(index) 2251 ]; 2252 for(var i = 0; i < extenders.length; i++) { 2253 if(extenders[i]) 2254 height -= extenders[i].offsetHeight; 2255 } 2256 var contentWrapper = this.GetWindowContentWrapperElement(index); 2257 if(height > 0) 2258 contentWrapper.style.height = height + "px"; 2259 }, 2260 GetWindowContentWrapperElement: function(index) { 2261 var windowElem = this.GetWindowElement(index); 2262 var mainDiv = this.GetWindowMainCell(windowElem); 2263 var contentWrapperParent = mainDiv; 2264 if(this.IeWithoutSupportDisplayTable() && !this.HaveSpecialDivForAnimation()) { 2265 var predicate = function(e) { return e.tagName == 'TD' }; 2266 contentWrapperParent = _aspxGetDescendantNodes(mainDiv, predicate)[0]; 2267 } 2268 return _aspxGetChildNodesByClassName(contentWrapperParent, ASPxClientPopupControlCssClasse
2268s.ContentWrapperCssClassName)[0]; 2269 }, 2270 SetWindowScrollDivSize: function(scrollDiv, index, dimension) { 2271 var windowClientTable = this.GetWindowClientTable(index); 2272 var headerElement = this.GetWindowHeaderElement(index); 2273 var height = windowClientTable.offsetHeight; 2274 if(headerElement) 2275 height -= headerElement.offsetHeight; 2276 height -= this.GetWindowFooterHeightLite(index); 2277 if(dimension == 'height' || dimension == 'both') 2278 _aspxSetOffsetHeight(scrollDiv, height); 2279 if(dimension == 'width' || dimension == 'both') { 2280 var width = windowClientTable.offsetWidth; 2281 var contentElement = this.GetWindowContentElement(index); 2282 width -= _aspxGetLeftRightBordersAndPaddingsSummaryValue(scrollDiv) + _aspxGetHorizontalBordersWidth(contentElement); 2283 if(width > -1) 2284 scrollDiv.style.width = width + "px"; 2285 } 2286 scrollDiv.style.marginRight = "0px"; 2287 }, 2288 CorrectWindowSizeGripPositionLite: function(index) { 2289 var sizeGrip = this.GetWindowSizeGripElement(index); 2290 if(!sizeGrip || sizeGrip.corrected) return; 2291 if (this.rtl) 2292 sizeGrip.style.marginRight = "-" + sizeGrip.offsetWidth + "px"; 2293 else 2294 sizeGrip.style.marginLeft = "-" + sizeGrip.offsetWidth + "px"; 2295 sizeGrip.style.marginTop = "-" + sizeGrip.offsetHeight + "px"; 2296 sizeGrip.corrected = true; 2297 }, 2298 CorrectWindowHeaderText: function(index) { 2299 var headerElement = this.GetWindowHeaderElement(index); 2300 if(!headerElement || headerElement.corrected) return; 2301 var leftChildrenWidth = 0, rightChildrenWidth = 0, headerContentElement; 2302 for(var i = 0; i < headerElement.childNodes.length; i++){ 2303 var child = headerElement.childNodes[i]; 2304 if(!child.offsetWidth) continue; 2305 if(_aspxGetElementFloat(child) === "right") 2306 rightChildrenWidth += child.offsetWidth + _aspxGetLeftRightMargins(child); 2307 else if(_aspxGetElementFloat(child) === "left") 2308 leftChildrenWidth += child.offsetWidth + _aspxGetLeftRightMargins(child); 2309 else if(!headerContentElement) 2310 headerContentElement = child; 2311 } 2312 if(headerContentElement && (leftChildrenWidth > 0 || rightChildrenWidth > 0)) { 2313 var headerContentElementStyle = _aspxGetCurrentStyle(headerContentElement); 2314 var originalPaddingLeft = parseInt(headerContentElementStyle.paddingLeft); 2315 var originalPaddingRight = parseInt(headerContentElementStyle.paddingRight); 2316 _aspxSetStyles(headerContentElement, { 2317 paddingLeft: leftChildrenWidth + originalPaddingLeft, 2318 paddingRight: rightChildrenWidth + originalPaddingRight 2319 }, true); 2320 if (__aspxIE && __aspxBrowserVersion < 8) 2321 headerContentElement.style.zoom = 1; 2322 } 2323 headerElement.corrected = true; 2324 }, 2325 GetIsSafariGreater4OrChromeGreater2: function() { 2326 return (__aspxSafari && __aspxBrowserVersion >= 4) || (__aspxChrome && __aspxBrowserVersion >= 2); 2327 }, 2328 SetWindowCachedSize: function(index, width, height) { 2329 if(0 <= index && index < this.heightArray.length) 2330 this.cachedSizeArray[index] = new _aspxSize(width, height); 2331 else 2332 this.cachedSize = new _aspxSize(width, height); 2333 }, 2334 GetWindowCachedSize: function(index) { 2335 if(0 <= index && index < this.heightArray.length) 2336 return this.cachedSizeArray[index]; 2337 else 2338 return this.cachedSize; 2339 }, 2340 ResetWindowCachedSize: function(index) { 2341 if(0 <= index && index < this.heightArray.length) 2342 this.cachedSizeArray[index] = null; 2343 else 2344 this.cachedSize = null; 2345 }, 2346 SetWindowSizeByIndex: function(index, width, height) { 2347 var minWidth = this.GetWindowMinWidth(index); 2348 var minHeight = this.GetWindowMinHeight(index); 2349 var maxWidth = this.GetWindowMaxWidth(index); 2350 var maxHeight = this.GetWindowMaxHeight(index); 2351 if(minWidth) 2352 width = Math.max(width, minWidth); 2353 if(minHeight) 2354 height = Math.max(height, minHeight); 2355 if(maxWidth) 2356 width = Math.min(width, maxWidth); 2357 if(maxHeight) 2358 height = Math.min(height, maxHeight); 2359 var isWindowMaximized = this.GetIsMaximized(index); 2360 var isWindowCollapsed = this.GetIsCollapsed(index); 2361 var isWindowMaximizedAndCollapsed = (isWindowMaximized && isWindowCollapsed); 2362 if(this.InternalIsWindowDisplayed(index) && (!isWindowMaximizedAndCollapsed || this.ResizingForMaxWindowLocked())) { 2363 if (!this.CollapseExecuting() && !this.MaximizationExecuting() && !this.ResizingForMaxWindowLocked()){ 2364 this.SetWindowCachedSize(index, width, height); 2365 this.SetIsResized(index, true); 2366 } 2367 if (isWindowCollapsed && !this.MaximizationExecuting() && !this.ResizingForMaxWindowLocked()){ 2368 this.SetWindowCachedSize(index, width, height); 2369 this.UpdateRestoredWindowSize(index, width, height); 2370 height = 0; 2371 } 2372 if (isWindowMaximized && !this.CollapseExecuting() && !this.ResizingForMaxWindowLocked()){ 2373 this.SetWindowCachedSize(index, width, height); 2374 this.UpdateRestoredWindowSize(index, width, height); 2375 } else { 2376 this.SetWindowSizeByIndexCore(index, width, height, isWindowCollapsed); 2377 } 2378 } else 2379 this.SetWindowCachedSize(index, width, height); 2380 }, 2381 SetWindowSizeByIndexCore: function(index, width, height, isWindowCollapsed) { 2382 this.SetClientWindowSizeLite(index, width, height, isWindowCollapsed); 2383 var iFrame = this.GetWindowIFrame(index); 2384 if(iFrame && !isWindowCollapsed) { 2385 var winElememnt = this.GetWindowElement(index); 2386 var realWidth = winElememnt.offsetWidth; 2387 var realHeight = winElememnt.offsetHeight; 2388 _aspxSetStyles(iFrame, { width: realWidth, height: realHeight });
2389 } 2390 this.UpdateWindowsStateInputElement(); 2391 this.UpdateWindowsStateCookie(); 2392 }, 2393 CreateResizeCursorInfo: function(evt, index) { 2394 var element = this.GetWindowElement(index); 2395 var mainCell = this.GetWindowMainCell(element); 2396 var clientWindow = this.GetWindowClientTable(index); 2397 var headerElement = this.GetWindowHeaderElement(index); 2398 var left = _aspxGetAbsoluteX(mainCell); 2399 var top = _aspxGetAbsoluteY(mainCell); 2400 var x = _aspxGetEventX(evt); 2401 var y = _aspxGetEventY(evt); 2402 var mainCellWidth = mainCell.offsetWidth; 2403 var mainCellHeight = mainCell.offsetHeight; 2404 var leftOffset = Math.abs(x - left); 2405 var rightOffset = Math.abs(x - left - mainCellWidth); 2406 var topOffset = Math.abs(y - top); 2407 var bottomOffset = Math.abs(y - top - mainCellHeight); 2408 var cursorInfo = this.CreateResizeBorderCursorInfo(index, leftOffset, rightOffset, topOffset, bottomOffset); 2409 var grip = this.GetWindowSizeGripElement(index); 2410 if(grip) { 2411 var gripCursorInfo = this.CreateGripCursorInfo(index, mainCell, grip, leftOffset, rightOffset, bottomOffset); 2412 if(gripCursorInfo) 2413 cursorInfo = gripCursorInfo; 2414 } 2415 this.UpdateResizeCursor(clientWindow, cursorInfo.verticalDirection, cursorInfo.horizontalDirection); 2416 this.UpdateResizeCursor(mainCell, cursorInfo.verticalDirection, cursorInfo.horizontalDirection); 2417 if(headerElement) 2418 this.UpdateResizeCursor(headerElement, cursorInfo.verticalDirection, cursorInfo.horizontalDirection); 2419 return cursorInfo; 2420 }, 2421 CreateGripCursorInfo: function(index, mainCell, grip, leftOffset, rightOffset, bottomOffset) { 2422 var gripWidth = this.rtl 2423 ? _aspxGetAbsoluteX(grip) - _aspxGetAbsoluteX(mainCell) + grip.offsetWidth 2424 : mainCell.offsetWidth - (_aspxGetAbsoluteX(grip) - _aspxGetAbsoluteX(mainCell)); 2425 var gripHeight = mainCell.offsetHeight - (_aspxGetAbsoluteY(grip) - _aspxGetAbsoluteY(mainCell)); 2426 if(gripHeight > bottomOffset) { 2427 if(this.rtl && gripWidth > leftOffset) 2428 return new ASPxPCResizeCursorInfo("w", "s", leftOffset, bottomOffset); 2429 if(gripWidth > rightOffset) 2430 return new ASPxPCResizeCursorInfo("e", "s", rightOffset, bottomOffset); 2431 } 2432 return null; 2433 }, 2434 CreateResizeBorderCursorInfo: function(index, leftOffset, rightOffset, topOffset, bottomOffset) { 2435 var ResizeBorderSize = this.ResizeBorderSize; 2436 var verticalDirection = this.GetResizeVerticalCourse(ResizeBorderSize, topOffset, bottomOffset); 2437 ResizeBorderSize = verticalDirection != "" ? this.ResizeCornerBorderSize : this.ResizeBorderSize; 2438 var horizontalDirection = this.GetResizeHorizontalCourse(ResizeBorderSize, leftOffset, rightOffset); 2439 if(verticalDirection == "" && horizontalDirection != "") 2440 verticalDirection = this.GetResizeVerticalCourse(this.ResizeCornerBorderSize, topOffset, bottomOffset); 2441 var horizontalOffset = leftOffset < rightOffset ? leftOffset : rightOffset; 2442 var verticalOffset = topOffset < bottomOffset ? topOffset : bottomOffset; 2443 return new ASPxPCResizeCursorInfo(horizontalDirection, verticalDirection, horizontalOffset, verticalOffset); 2444 }, 2445 GetResizeVerticalCourse: function(ResizeBorderSize, topOffset, bottomOffset) { 2446 if(ResizeBorderSize > topOffset) return "n"; 2447 if(ResizeBorderSize > bottomOffset) return "s"; 2448 return ""; 2449 }, 2450 GetResizeHorizontalCourse: function(ResizeBorderSize, leftOffset, rightOffset) { 2451 if(ResizeBorderSize > leftOffset) return "w"; 2452 if(ResizeBorderSize > rightOffset) return "e"; 2453 return ""; 2454 }, 2455 UpdateResizeCursor: function(element, verticalDirection, horizontalDirection) { 2456 var cursor = verticalDirection + horizontalDirection; 2457 if(cursor != "") { 2458 cursor += "-resize"; 2459 this.ShowTemporaryCursor(element, cursor); 2460 } 2461 else 2462 this.HideTemporaryCursor(element); 2463 }, 2464 ShowTemporaryCursor: function(element, cursor) { 2465 _aspxChangeStyleAttribute(element, "cursor", cursor); 2466 }, 2467 HideTemporaryCursor: function(element) { 2468 _aspxRestoreStyleAttribute(element, "cursor"); 2469 }, 2470 ResizeWindowIFrame: function(index) { 2471 if(!this.renderIFrameForPopupElements) return; 2472 if(!this.InternalIsWindowVisible(index)) return; 2473 var iFrame = this.GetWindowIFrame(index); 2474 if(iFrame) { 2475 var cell = this.GetWindowMainCell(this.GetWindowElement(index)); 2476 _aspxSetStyles(iFrame, { width: cell.offsetWidth, height: cell.offsetHeight });
2477 } 2478 }, 2479 GetContentIFrameWindow: function() { 2480 var iframeElement = this.GetContentIFrame(); 2481 return iframeElement.contentWindow; 2482 }, 2483 ShowDragCursor: function(index) { 2484 var dragElement = this.GetDragElement(index); 2485 if(dragElement) 2486 this.ShowTemporaryCursor(dragElement, "move"); 2487 }, 2488 HideDragCursor: function(index) { 2489 var dragElement = this.GetDragElement(index); 2490 if(dragElement != null) 2491 this.HideTemporaryCursor(dragElement); 2492 }, 2493 GetDragElement: function(index) { 2494 var headerElement = this.GetWindowHeaderElement(index); 2495 var element = this.GetWindowElement(index); 2496 if(element != null) 2497 return (headerElement != null ? headerElement : this.GetWindowMainCell(element)); 2498 return null; 2499 }, 2500 OnActivateMouseDown: function(evt, index) { 2501 this.OnActivate(index, evt); 2502 }, 2503 OnCloseButtonClick: function(index) { 2504 this.RaiseCloseButtonClick(index); 2505 if(this.GetWindowCloseAction(index) != "None") 2506 this.DoHideWindow(index); 2507 }, 2508 OnRefreshButtonClick: function(index) { 2509 var contentIFrame = this.GetWindowContentIFrameElement(index); 2510 if (contentIFrame) 2511 this.RefreshWindowContentUrl(this.GetWindow(index)); 2512 else 2513 this.PerformWindowCallback(this.GetWindow(index)); 2514 }, 2515 OnPinButtonClick: function(index) { 2516 var value = this.GetIsPinned(index); 2517 this.SetPinCore(index, !value); 2518 }, 2519 SetPinCore: function(index, value) { 2520 if (this.GetIsPinned(index) != value) { 2521 this.SetIsPinned(index, value); 2522 this.HoldPosition(index, value); 2523 this.UpdateWindowsStateInputElement(); 2524 this.UpdateWindowsStateCookie(); 2525 this.OnPinned(index, value); 2526 } 2527 }, 2528 OnPinned: function(index, pinned) { 2529 this.RaisePinnedChanged(index, pinned); 2530 }, 2531 HoldPosition: function(index, hold, element) { 2532 if (hold){ 2533 var element = element || this.GetWindowElement(index); 2534 if (!element) return; 2535 var x = _aspxGetAbsoluteX(element); 2536 var y = _aspxGetAbsoluteY(element); 2537 scrollX = _aspxGetDocumentScrollLeft(); 2538 scrollY = _aspxGetDocumentScrollTop(); 2539 this.SetPinPosX(index, x - scrollX); 2540 this.SetPinPosY(index, y - scrollY); 2541 } 2542 this.UpdateHeaderButtonSelected(index, "GetWindowPinButton", hold);
2543 this.CheckHeaderCursor(index); 2544 }, 2545 GetBodyWidth: function(){ 2546 return aspxGetPopupControlCollection().GetSavedBodyWidth(); 2547 }, 2548 GetBodyHeight: function(){ 2549 return aspxGetPopupControlCollection().GetSavedBodyHeight(); 2550 }, 2551 GetIsOutFromViewPort: function(index){ 2552 var element = this.GetWindowElement(index); 2553 if (!element) return false; 2554 var pinXTarget = this.GetPinPosX(index); 2555 var pinYTarget = this.GetPinPosY(index); 2556 var popupWindowWidth = this.GetClientWindowWidth(index); 2557 var docClientWidth = _aspxGetDocumentClientWidth(); 2558 var rightOutOffset = (pinXTarget + popupWindowWidth) - docClientWidth; 2559 var popupWindowHeight = this.GetClientWindowHeight(index); 2560 var docClientHeight = _aspxGetDocumentClientHeight(); 2561 var bottomOutOffset = (pinYTarget + popupWindowHeight) - docClientHeight; 2562 return (rightOutOffset > 0 || bottomOutOffset > 0); 2563 }, 2564 AdjustPinPositionWhileScroll: function(index){ 2565 var element = this.GetWindowElement(index); 2566 if (!element) return; 2567 var x = _aspxGetAbsoluteX(element); 2568 var y = _aspxGetAbsoluteY(element); 2569 var scrollX = _aspxGetDocumentScrollLeft(); 2570 var scrollY = _aspxGetDocumentScrollTop(); 2571 var pinX = x - scrollX; 2572 var pinY = y - scrollY; 2573 var pinXTarget = this.GetPinPosX(index); 2574 var pinYTarget = this.GetPinPosY(index); 2575 if ((pinX != pinXTarget) || (pinY != pinYTarget)){ 2576 this.lockScroll++; 2577 var xNew = pinXTarget + scrollX; 2578 var yNew = pinYTarget + scrollY; 2579 var bodyWidth = this.GetBodyWidth(); 2580 var bodyHeight = this.GetBodyHeight(); 2581 var popupWindowWidth = this.GetClientWindowWidth(index); 2582 var docClientWidth = _aspxGetDocumentClientWidth(); 2583 var rightOutOffset = (pinXTarget + popupWindowWidth) - docClientWidth; 2584 var popupWindowHeight = this.GetClientWindowHeight(index); 2585 var docClientHeight = _aspxGetDocumentClientHeight(); 2586 var bottomOutOffset = (pinYTarget + popupWindowHeight) - docClientHeight; 2587 var cancelScrollX = false; 2588 if (xNew + (popupWindowWidth - rightOutOffset) > bodyWidth){ 2589 xNew -= (xNew + (popupWindowWidth - rightOutOffset) - bodyWidth); 2590 cancelScrollX = true; 2591 } 2592 var cancelScrollY = false; 2593 if (yNew + (popupWindowHeight - bottomOutOffset) > bodyHeight){ 2594 yNew -= (yNew + (popupWindowHeight - bottomOutOffset) - bodyHeight); 2595 cancelScrollY = true; 2596 } 2597 xNew = _aspxPrepareClientPosForElement(xNew, element, true); 2598 yNew = _aspxPrepareClientPosForElement(yNew, element, false); 2599 this.SetWindowPos(index, element, xNew, yNew); 2600 if (cancelScrollX){ 2601 var scrollLeftMax = bodyWidth - _aspxGetDocumentClientWidth(); 2602 if ((rightOutOffset > 0) && (scrollX > scrollLeftMax)){ 2603 this.lockScroll++; 2604 _aspxSetDocumentScrollLeft(scrollLeftMax); 2605 this.lockScroll--; 2606 } 2607 } 2608 if (cancelScrollY){ 2609 var scrollTopMax = bodyHeight - _aspxGetDocumentClientHeight(); 2610 if ((bottomOutOffset > 0) && (scrollY > scrollTopMax)){ 2611 this.lockScroll++; 2612 _aspxSetDocumentScrollTop(scrollTopMax); 2613 this.lockScroll--; 2614 } 2615 } 2616 this.lockScroll--; 2617 } 2618 }, 2619 OnScroll: function(evt, index){ 2620 if (!this.GetIsPinned(index) || (this.lockScroll > 0)) return; 2621 this.AdjustPinPositionWhileScroll(index); 2622 }, 2623 OnCollapseButtonClick: function(index) { 2624 this.SetCollapsedCore(index, !this.GetIsCollapsed(index)); 2625 }, 2626 SetCollapsedCore: function(index, minimization) { 2627 if(this.GetIsCollapsed(index) == minimization) return; 2628 this.DoCollapse(index, minimization); 2629 this.OnCollapsed(index, minimization); 2630 }, 2631 DoCollapse: function(index, minimization) { 2632 if (this.GetIsCollapsed(index) == minimization) return; 2633 this.StartCollapse(); 2634 if (minimization){ 2635 var cachedWidth = this.GetClientWindowWidth(index); 2636 var cachedHeight = this.GetClientWindowHeight(index); 2637 var shouldUpdateRestoredSize = this.ShoulUpdatedRestoredWindowSizeOnCollapse(index); 2638 var width = this.GetMainWindowWidth(index, !shouldUpdateRestoredSize); 2639 var height = this.GetMainWindowHeight(index, !shouldUpdateRestoredSize); 2640 this.SetWindowSizeByIndex(index, width, 0); 2641 this.SetWindowContentVisible(index, false); 2642 this.SetWindowFooterVisible(index, false); 2643 this.ResetWindowHeight(index); 2644 this.SetIsCollapsed(index, minimization); 2645 this.SetWindowCachedSize(index, cachedWidth, cachedHeight); 2646 if(shouldUpdateRestoredSize) 2647 this.UpdateRestoredWindowSize(index, width, height); 2648 } 2649 else{ 2650 if (this.MaximizationExecuting()){ 2651 var element = this.GetWindowElement(index); 2652 if (element){ 2653 element.style.left = _aspxGetDocumentScrollLeft(); 2654 element.style.top = _aspxGetDocumentScrollTop(); 2655 } 2656 } 2657 this.SetWindowContentVisible(index, true); 2658 this.SetWindowFooterVisible(index, true); 2659 this.SetIsCollapsed(index, minimization); 2660 if (this.GetIsMaximized(index)){ 2661 var documentClientWidth = ASPxClientPopupUtils.GetDocumentClientWidthForPopup(); 2662 var documentClientHeight = _aspxGetDocumentClientHeight(); 2663 this.SetWindowSizeByIndex(index, documentClientWidth, documentClientHeight); 2664 } else { 2665 var restoredWindowData = this.GetRestoredWindowData(index); 2666 this.SetWindowSizeByIndex(index, restoredWindowData.width, restoredWindowData.height); 2667 } 2668 }
2669 this.UpdateHeaderButtonSelected(index, "GetWindowCollapseButton", minimization); 2670 this.EndCollapse(); 2671 this.UpdateWindowsStateInputElement(); 2672 this.UpdateWindowsStateCookie(); 2673 }, 2674 ResetWindowHeight: function(index) { 2675 var element = this.GetWindowElement(index); 2676 if (element) 2677 element.style.height = ""; 2678 }, 2679 ShoulUpdatedRestoredWindowSizeOnCollapse: function(index) { 2680 return !this.GetIsMaximized(index); 2681 }, 2682 OnCollapsed: function(index, value){ 2683 if (value) 2684 this.RaiseCollapsed(index); 2685 else 2686 this.RaiseExpanded(index); 2687 this.RaiseAfterResizing(index); 2688 }, 2689 OnMaximizeButtonClick: function(index) { 2690 this.SetMaximizedCore(index, !this.GetIsMaximized(index)); 2691 }, 2692 SetMaximizedCore: function(index, maximization) { 2693 if(this.GetIsMaximized(index) == maximization) return; 2694 this.DoMaximize(index, maximization); 2695 this.OnMaximizedChanged(index, maximization); 2696 }, 2697 DoMaximize: function(index, maximization) { 2698 if (this.GetIsMaximized(index) == maximization) return; 2699 var element = this.GetWindowElement(index); 2700 if (!element) return; 2701 this.StartMaximization(); 2702 if (maximization){ 2703 if(this.hideBodyScrollWhenMaximized) 2704 ASPxClientPopupUtils.BodyScrollHelper.HideBodyScroll(element.id); 2705 if (this.GetIsCollapsed(index)) 2706 this.DoCollapse(index, false); 2707 var cachedWidth = this.GetClientWindowWidth(index); 2708 var cachedHeight = this.GetClientWindowHeight(index); 2709 var restoredWindowData = this.GetInitRestoredWindowData(index); 2710 var documentClientWidth = ASPxClientPopupUtils.GetDocumentClientWidthForPopup(); 2711 var documentClientHeight = _aspxGetDocumentClientHeight(); 2712 var currentStyle = _aspxGetCurrentStyle(element); 2713 var windowClientTable = this.GetWindowClientTable(index); 2714 var windowClientTableParent = windowClientTable.parentNode; 2715 childStyle = _aspxGetCurrentStyle(windowClientTableParent); 2716 var left = _aspxPrepareClientPosForElement(_aspxGetDocumentScrollLeft(), element, true); 2717 var top = _aspxPrepareClientPosForElement(_aspxGetDocumentScrollTop(), element, false); 2718 this.SetWindowPos(index, element, left, top); 2719 this.SetWindowSizeByIndex(index, documentClientWidth, documentClientHeight); 2720 this.SetWindowCachedSize(index, cachedWidth, cachedHeight); 2721 this.SetRestoredWindowData(index, restoredWindowData); 2722 this.SetIsMaximized(index, maximization); 2723 } 2724 else{ 2725 var restoredWindowData = this.GetRestoredWindowData(index); 2726 var width = restoredWindowData.width || this.GetMainWindowWidth(index); 2727 var height = restoredWindowData.height || this.GetMainWindowHeight(index); 2728 this.SetIsMaximized(index, maximization); 2729 var left = _aspxPrepareClientPosForElement(restoredWindowData.left, element, true); 2730 var top = _aspxPrepareClientPosForElement(restoredWindowData.top, element, false); 2731 this.SetWindowPos(index, element, left, top); 2732 this.SetWindowSizeByIndex(index, width, height); 2733 if (this.GetIsCollapsed(index)){ 2734 this.SetIsCollapsed(index, false); 2735 this.DoCollapse(index, true); 2736 } 2737 if(this.hideBodyScrollWhenMaximized) 2738 ASPxClientPopupUtils.BodyScrollHelper.RestoreBodyScroll(element.id); 2739 } 2740 if (this.GetIsPinned(index)) 2741 this.HoldPosition(index, true, element); 2742 this.UpdateHeaderButtonSelected(index, "GetWindowMaximizeButton", maximization); 2743 this.EndMaximization(); 2744 this.UpdateWindowsStateInputElement(); 2745 this.UpdateWindowsStateCookie(); 2746 this.CheckHeaderCursor(index); 2747 }, 2748 OnMaximizedChanged: function(index, value){ 2749 if (value) 2750 this.RaiseMaximized(index); 2751 else 2752 this.RaiseRestoredAfterMaximized(index); 2753 this.RaiseAfterResizing(index); 2754 }, 2755 GetInitRestoredWindowData: function (index) { 2756 var restoredWindowData = this.GetRestoredWindowData(index); 2757 restoredWindowData.left = this.GetCurrentLeft(index); 2758 restoredWindowData.top = this.GetCurrentTop(index); 2759 restoredWindowData.width = this.GetMainWindowWidth(index); 2760 restoredWindowData.height = this.GetMainWindowHeight(index); 2761 return restoredWindowData; 2762 }, 2763 UpdateMaximizedWindowSizeOnResize: function(index){
2764 this.StartUpdateMaximizedWindowSizeOnResize(); 2765 var documentClientWidth = ASPxClientPopupUtils.GetDocumentClientWidthForPopup(); 2766 var documentClientHeight = _aspxGetDocumentClientHeight(); 2767 if (this.GetIsCollapsed(index)) documentClientHeight = 0; 2768 this.SetWindowSizeByIndex(index, documentClientWidth, documentClientHeight); 2769 if (this.GetIsCollapsed(index)){ 2770 this.CorrectCollapsedSize(index); 2771 } 2772 window.setTimeout(function() { this.SetMaximizedWindowSizeAfterOnResize(index); }.aspxBind(this), 0); 2773 this.EndUpdateMaximizedWindowSizeOnResize(); 2774 }, 2775 SetMaximizedWindowSizeAfterOnResize: function(index){ 2776 this.StartUpdateMaximizedWindowSizeOnResize(); 2777 var documentClientWidth = ASPxClientPopupUtils.GetDocumentClientWidthForPopup(); 2778 var documentClientHeight = _aspxGetDocumentClientHeight(); 2779 windowWidthCurrent = this.GetMainWindowWidth(index, true); 2780 windowHeightCurrent = this.GetMainWindowHeight(index, true); 2781 if (this.GetIsCollapsed(index)) 2782 documentClientHeight = 0; 2783 if (documentClientWidth != windowWidthCurrent || documentClientHeight != windowHeightCurrent){ 2784 this.SetWindowSizeByIndex(index, documentClientWidth, documentClientHeight); 2785 if (this.GetIsCollapsed(index)){ 2786 this.CorrectCollapsedSize(index); 2787 } 2788 } 2789 this.EndUpdateMaximizedWindowSizeOnResize(); 2790 }, 2791 CorrectCollapsedSize: function(index){ 2792 var contentWrapper = this.GetWindowContentWrapperElement(index); 2793 if (contentWrapper && _aspxElementIsVisible(contentWrapper)) 2794 contentWrapper.style.display = 'none'; 2795 }, 2796 UpdateHeaderButtonSelected: function(index, methodGetWindowButton, flagSelected){ 2797 if(typeof(aspxGetStateController) != "undefined"){ 2798 button = this[methodGetWindowButton](index); 2799 var method = flagSelected ? "SelectElementBySrcElement" : "DeselectElementBySrcElement"; 2800 aspxGetStateController()[method](button); 2801 } 2802 }, 2803 CheckHeaderCursor: function(index){ 2804 if (!this.allowDragging) return; 2805 var dragElement = this.GetDragElement(index); 2806 if (!dragElement) return; 2807 var styleCursor = dragElement.style.cursor; 2808 var isPinned = this.GetIsPinned(index); 2809 var isMaximized = this.GetIsMaximized(index); 2810 if ((isPinned || isMaximized) && styleCursor != "default") 2811 dragElement.style.cursor = "default"; 2812 else if (!isPinned && !isMaximized && styleCursor != "move") 2813 dragElement.style.cursor = "move"; 2814 }, 2815 LockAnimation: function() { 2816 this.animationLockCount++; 2817 }, 2818 UnlockAnimation: function() { 2819 this.animationLockCount--; 2820 }, 2821 IsAnimationLocked: function() { 2822 return this.animationLockCount > 0; 2823 }, 2824 IsAnimationAllowed: function() { 2825 return this.enableAnimation && !this.IsAnimationLocked(); 2826 }, 2827 StartCollapse: function(){ 2828 this.collapseExecutingLockCount++; 2829 }, 2830 EndCollapse: function(){ 2831 this.collapseExecutingLockCount--; 2832 }, 2833 CollapseExecuting: function(){ 2834 return this.collapseExecutingLockCount > 0; 2835 }, 2836 StartMaximization: function(){ 2837 this.maximizationExecutingLockCount++; 2838 }, 2839 EndMaximization: function(){ 2840 this.maximizationExecutingLockCount--; 2841 }, 2842 MaximizationExecuting: function(){ 2843 return this.maximizationExecutingLockCount > 0; 2844 }, 2845 StartUpdateMaximizedWindowSizeOnResize: function(){ 2846 this.browserResizingForMaxWindowLockCount++; 2847 }, 2848 EndUpdateMaximizedWindowSizeOnResize: function(){ 2849 this.browserResizingForMaxWindowLockCount--; 2850 }, 2851 ResizingForMaxWindowLocked: function(){ 2852 return this.browserResizingForMaxWindowLockCount > 0; 2853 }, 2854 UpdateRestoredWindowSizeLock: function () { 2855 this.updateRestoredWindowSizeLockCount ++; 2856 }, 2857 UpdateRestoredWindowSizeUnlock: function () { 2858 this.updateRestoredWindowSizeLockCount --; 2859 }, 2860 UpdateRestoredWindowSizeLocked: function () { 2861 return this.updateRestoredWindowSizeLockCount > 0; 2862 }, 2863 UpdateRestoredWindowSize: function (index, width, height) { 2864 if (!this.UpdateRestoredWindowSizeLocked()) { 2865 restoredMinWindowData = this.GetRestoredWindowData(index); 2866 restoredMinWindowData.width = width; 2867 restoredMinWindowData.height = height; 2868 this.SetRestoredWindowData(index, restoredMinWindowData); 2869 } 2870 }, 2871 OnMouseDown: function(evt, index, isDraggingAllowed, pointOnScrollBar) { 2872 if(_aspxGetIsLeftButtonPressed(evt)) { 2873 if((this.allowResize || isDraggingAllowed) && !this.prohibitClearSelectionOnMouseDown) 2874 _aspxClearSelection(); 2875 var isResizing = false; 2876 if(this.allowResize && !this.GetIsCollapsed(index) && !this.GetIsMaximized(index)) { 2877 var eventSourceControl = _aspxGetEventSource(evt); 2878 var eventFromPopupContainer = _aspxElementHasCssClass(eventSourceControl, ASPxClientPopupControlCssClasse
2878s.ContentCssClassName) || 2879 !_aspxGetParentByClassName(eventSourceControl, ASPxClientPopupControlCssClasses.ContentCssClassName) || 2880 this.eventFromOwnPopupContent(eventSourceControl); 2881 if (eventFromPopupContainer) 2882 isResizing = this.OnResizeStart(evt, index); 2883 } 2884 if(isResizing && __aspxWebKitTouchUI) 2885 aspxGetPopupControlCollection().OverStop(); 2886 var clickedOnScroll = pointOnScrollBar && this.enableContentScrolling; 2887 if(isDraggingAllowed && !isResizing && !clickedOnScroll && !this.GetIsPinned(index) && !this.GetIsMaximized(index)) 2888 this.OnDragStart(evt, index); 2889 } 2890 }, 2891 eventFromOwnPopupContent: function(element) { 2892 while(element != null) { 2893 if(element.tagName == "BODY") 2894 return false; 2895 if (element.style.position == "absolute") { 2896 var windowIndex = this.GetWindowIndex(element); 2897 if (!isNaN(windowIndex)) { 2898 if (this.GetWindowElementId(windowIndex) == element.id) 2899 return true; 2900 return false; 2901 } 2902 } 2903 element = element.parentNode; 2904 } 2905 return false; 2906 }, 2907 OnMouseMove: function(evt, index) { 2908 if(this.allowResize && !this.GetIsCollapsed(index) && !this.GetIsMaximized(index)) 2909 this.CreateResizeCursorInfo(evt, index); 2910 }, 2911 SetShadowVisibility: function(visible, index) { 2912 var shadowTable = this.GetWindowShadowTable(index); 2913 if(shadowTable && shadowTable.rows.length > 1) { 2914 var shadowCol = shadowTable.rows[0].cells[1]; 2915 var shadowRow = shadowTable.rows[1]; 2916 _aspxSetElementVisibility(shadowCol, visible); 2917 _aspxSetElementVisibility(shadowRow, visible); 2918 } 2919 }, 2920 StartFadeAnimation: function(element, index) { 2921 if(__aspxIE && __aspxBrowserMajorVersion < 9) { 2922 _aspxSetElementVisibility(element, true); 2923 ASPxAnimationHelper.setOpacity(element, 0); 2924 this.SetShadowVisibility(false, index); 2925 } else { 2926 ASPxAnimationHelper.setOpacity(element, 0); 2927 _aspxSetElementVisibility(element, true); 2928 } 2929 var callback = function () { 2930 if (__aspxIE && __aspxBrowserVersion < 9 && element.style.filter) { 2931 if (element.style.filter) 2932 element.style.filter = ""; 2933 this.SetShadowVisibility(true, index); 2934 } 2935 this.OnAnimationStop(index); 2936 } .aspxBind(this); 2937 ASPxAnimationHelper.fadeIn(element, callback, this.fadeAnimationDuration); 2938 }, 2939 StartSlideAnimation: function(animationDivElement, index, horizontalPopupPosition, verticalPopupPosition) { 2940 var element = this.GetWindowMainTable(animationDivElement); 2941 var clientX = horizontalPopupPosition.position; 2942 var clientY = verticalPopupPosition.position; 2943 var args = "(\"" + this.name + "\", " + index + ")"; 2944 var onAnimStopCallString = "aspxPCAStop" + args; 2945 if(__aspxFirefox) 2946 animationDivElement.style.display = "block"; 2947 ASPxClientPopupUtils.InitAnimationDiv(animationDivElement, clientX, clientY, onAnimStopCallString, true); 2948 var horizontalDirection = ASPxClientPopupUtils.GetAnimationHorizontalDirection(horizontalPopupPosition, this.popupHorizontalAlign, this.popupVerticalAlign, this.rtl); 2949 var verticalDirection = ASPxClientPopupUtils.GetAnimationVerticalDirection(verticalPopupPosition, this.popupHorizontalAlign, this.popupVerticalAlign); 2950 var xPos = horizontalDirection * animationDivElement.offsetWidth; 2951 var yPos = verticalDirection * animationDivElement.offsetHeight; 2952 _aspxSetStyles(element, { left: xPos, top: yPos }); 2953 _aspxSetElementVisibility(animationDivElement, true); 2954 this.DoShowWindowIFrame(index, clientX, clientY, 0, 0); 2955 ASPxClientPopupUtils.StartSlideAnimation(animationDivElement, element, this.GetWindowIFrame(index), this.slideAnimationDuration); 2956 }, 2957 GetWindowsState: function() { 2958 var state = ""; 2959 if(this.HasDefaultWindow()) { 2960 state += this.GetWindowState(-1); 2961 } 2962 for(var i = 0; i < this.GetWindowCountCore(); i++) { 2963 state += this.GetWindowState(i); 2964 if(i < this.GetWindowCountCore() - 1) state += ";"; 2965 } 2966 return state; 2967 }, 2968 GetWindowState: function(index) { 2969 var element = this.GetWindowElement(index); 2970 if(element != null) { 2971 var visibleFlag = (!this.InternalIsWindowVisible(index) || element.isHiding) ? "0" : "1"; 2972 var isDraggedFlag = this.GetIsDragged(index) ? "1" : "0"; 2973 var zIndex = this.GetCurrentZIndex(index); 2974 var isResized = this.GetIsResized(index); 2975 var isResizedFlag = isResized ? "1" : "0"; 2976 var width = isResized ? this.GetCurrentWindowWidth(index) : __aspxInvalidDimension; 2977 var height = isResized ? this.GetCurrentWindowHeight(index) : __aspxInvalidDimension; 2978 var contentWasLoaded = element.loaded ? "1" : "0"; 2979 var left, top; 2980 var isMaximized = this.GetIsMaximized(index); 2981 if (isMaximized && !this.MaximizationExecuting()){ 2982 var restoredWindowData = this.GetRestoredWindowData(index); 2983 left = restoredWindowData.left; 2984 top = restoredWindowData.top; 2985 } else { 2986 left = this.GetCurrentLeft(index); 2987 top = this.GetCurrentTop(index); 2988 } 2989 var isPinned = this.GetIsPinned(index); 2990 if (isPinned){ 2991 left -= _aspxGetDocumentScrollLeft(); 2992 top -= _aspxGetDocumentScrollTop(); 2993 }
2994 left = Math.ceil(left); 2995 top = Math.ceil(top); 2996 var pinFlag = isPinned ? "1" : "0"; 2997 var minFlag = this.GetIsCollapsed(index) ? "1" : "0"; 2998 var maxFlag = isMaximized ? "1" : "0"; 2999 return [visibleFlag, isDraggedFlag, zIndex, left, top, isResizedFlag, width, height, contentWasLoaded, pinFlag, minFlag, maxFlag].join(":"); 3000 } 3001 return ""; 3002 }, 3003 UpdateWindowsStateCookie: function() { 3004 if(this.cookieName == "") return; 3005 _aspxDelCookie(this.cookieName); 3006 _aspxSetCookie(this.cookieName, this.GetWindowsState()); 3007 }, 3008 UpdateWindowsStateInputElement: function() { 3009 var element = this.GetWindowsStateInputElement(); 3010 if(element != null) element.value = this.GetWindowsState(); 3011 }, 3012 OnIFrameLoad: function(index) { 3013 this.SetIframeLoading(index, false); 3014 }, 3015 OnPWHBClickCore: function(evt, index, method){ 3016 if (ASPxClientTouchUI.handleFastTapIfRequired(evt, 3017 function(){ this[method](index); }.aspxBind(this), true)) { 3018 return; 3019 } 3020 if((__aspxIE && __aspxBrowserVersion < 9) || __aspxOpera) 3021 _aspxEmulateDocumentOnMouseDown(evt); 3022 this[method](index); 3023 }, 3024 CreateWindows: function(windowsNames) { 3025 for(var i = 0; i < windowsNames.length; i++) { 3026 var window = new ASPxClientPopupWindow(this, i, windowsNames[i]); 3027 this.windows.push(window); 3028 } 3029 }, 3030 RaiseCloseButtonClick: function(index) { 3031 var window = index < 0 ? null : this.GetWindow(index); 3032 if(!this.CloseButtonClick.IsEmpty()) { 3033 var args = new ASPxClientPopupWindowEventArgs(window); 3034 this.CloseButtonClick.FireEvent(this, args); 3035 } 3036 }, 3037 RaiseClosing: function(index) { 3038 var window = index < 0 ? null : this.GetWindow(index); 3039 var cancel = false; 3040 if(!this.Closing.IsEmpty()) { 3041 var args = new ASPxClientPopupWindowCancelEventArgs(window); 3042 this.Closing.FireEvent(this, args); 3043 cancel = args.cancel; 3044 } 3045 return cancel; 3046 }, 3047 RaiseCloseUp: function(index) { 3048 var window = index < 0 ? null : this.GetWindow(index); 3049 if(!this.CloseUp.IsEmpty()) { 3050 var args = new ASPxClientPopupWindowEventArgs(window); 3051 this.CloseUp.FireEvent(this, args); 3052 } 3053 }, 3054 RaisePopUp: function(index) { 3055 var window = index < 0 ? null : this.GetWindow(index); 3056 if(!this.PopUp.IsEmpty()) { 3057 var args = new ASPxClientPopupWindowEventArgs(window); 3058 this.PopUp.FireEvent(this, args); 3059 } 3060 }, 3061 RaiseResize: function(index, resizeState) { 3062 var window = index < 0 ? null : this.GetWindow(index); 3063 if(!this.Resize.IsEmpty()) { 3064 if(!resizeState) 3065 resizeState = ASPxClientPopupControlResizeState.Resized; 3066 var args = new ASPxClientPopupWindowResizeEventArgs(window, resizeState); 3067 this.Resize.FireEvent(this, args); 3068 } 3069 }, 3070 RaiseBeforeResizing: function(index) { 3071 var window = index < 0 ? null : this.GetWindow(index); 3072 if(!this.BeforeResizing.IsEmpty()) { 3073 var args = new ASPxClientPopupWindowEventArgs(window); 3074 this.BeforeResizing.FireEvent(this, args); 3075 } 3076 }, 3077 RaiseAfterResizing: function(index) { 3078 var window = index < 0 ? null : this.GetWindow(index); 3079 if(!this.AfterResizing.IsEmpty()) { 3080 var args = new ASPxClientPopupWindowEventArgs(window); 3081 this.AfterResizing.FireEvent(this, args); 3082 } 3083 }, 3084 RaiseShown: function(index) { 3085 var window = index < 0 ? null : this.GetWindow(index); 3086 if(!this.Shown.IsEmpty()) { 3087 var args = new ASPxClientPopupWindowEventArgs(window); 3088 this.Shown.FireEvent(this, args); 3089 } 3090 }, 3091 RaisePinnedChanged: function (index, pinned) { 3092 var window = index < 0 ? null : this.GetWindow(index); 3093 if(!this.PinnedChanged.IsEmpty()) { 3094 var args = new ASPxClientPopupWindowPinnedChangedEventArgs(window, pinned); 3095 this.PinnedChanged.FireEvent(this, args); 3096 } 3097 }, 3098 RaiseCollapsed: function (index) { 3099 this.RaiseResize(index, ASPxClientPopupControlResizeState.Collapsed); 3100 }, 3101 RaiseExpanded: function(index) { 3102 this.RaiseResize(index, ASPxClientPopupControlResizeState.Expanded); 3103 }, 3104 RaiseMaximized: function(index) { 3105 this.RaiseResize(index, ASPxClientPopupControlResizeState.Maximized); 3106 }, 3107 RaiseRestoredAfterMaximized: function(index) { 3108 this.RaiseResize(index, ASPxClientPopupControlResizeState.RestoredAfterMaximized); 3109 }, 3110 AdjustSize: function() { 3111 if(this.enableContentScrolling) 3112 return; 3113 this.SetSize(1, 1); 3114 }, 3115 GetHeight: function() { 3116 return this.GetWindowHeight(null); 3117 }, 3118 GetWidth: function() { 3119 return this.GetWindowWidth(null); 3120 }, 3121 GetContentWidth: function() { 3122 return this.GetWindowContentWidth(null); 3123 }, 3124 GetContentHeight: function() { 3125 return this.GetWindowContentHeight(null); 3126 }, 3127 SetSize: function(width, height) { 3128 this.SetWindowSize(null, width, height); 3129 }, 3130 SetWidth: function(width) { 3131 var height = this.GetHeight(); 3132 this.SetSize(width, height); 3133 }, 3134 SetHeight: function(height) { 3135 var width = this.GetWidth(); 3136 this.SetSize(width, height); 3137 }, 3138 GetWindowDimensionByIndex: function(index, isWidth, forceFromCache) { 3139 var cachedSize = this.GetWindowCachedSize(index); 3140 var dimensionValue = null; 3141 if (forceFromCache == undefined && !this.GetWindowElement(index)) 3142 forceFromCache = true; 3143 if(cachedSize && forceFromCache)
3144 dimensionValue = isWidth ? cachedSize.width : cachedSize.height; 3145 if(dimensionValue) 3146 return dimensionValue; 3147 else { 3148 var element = this.GetWindowElement(index); 3149 var sizeFromDOM = 0; 3150 if (this.GetIsCollapsed(index)){ 3151 var headerCell = this.GetWindowHeaderElement(index); 3152 sizeFromDOM = isWidth ? headerCell.offsetWidth : headerCell.offsetHeight; 3153 } 3154 else{ 3155 var mainCell = this.GetWindowMainCell(element); 3156 sizeFromDOM = isWidth ? mainCell.offsetWidth : mainCell.offsetHeight; 3157 } 3158 if(sizeFromDOM === 0 && cachedSize) 3159 sizeFromDOM = isWidth ? cachedSize.width : cachedSize.height; 3160 return sizeFromDOM; 3161 } 3162 }, 3163 GetWindowDimension: function(window, isWidth, forceFromCache) { 3164 var index = (window != null) ? window.index : -1; 3165 return this.GetWindowDimensionByIndex(index, isWidth, forceFromCache); 3166 }, 3167 GetWindowContentDimension: function(window, isWidth) { 3168 var index = (window != null) ? window.index : -1, 3169 dimension = 0, 3170 contentElem = this.GetWindowContentElement(index), 3171 dimensionHolder = contentElem.parentNode, 3172 paddingsHolder = contentElem; 3173 return isWidth ? 3174 (dimensionHolder.offsetWidth - _aspxGetLeftRightBordersAndPaddingsSummaryValue(paddingsHolder)) : 3175 (dimensionHolder.offsetHeight - _aspxGetTopBottomBordersAndPaddingsSummaryValue(paddingsHolder)); 3176 }, 3177 GetWindowContentWidth: function(window) { 3178 return this.GetWindowContentDimension(window, true); 3179 }, 3180 GetWindowContentHeight: function(window) { 3181 return this.GetWindowContentDimension(window, false); 3182 }, 3183 GetWindowHeight: function(window) { 3184 return this.GetWindowDimension(window, false); 3185 }, 3186 GetWindowWidth: function(window) { 3187 return this.GetWindowDimension(window, true); 3188 }, 3189 SetWindowSize: function(window, width, height) { 3190 var index = (window != null) ? window.index : -1; 3191 this.SetWindowSizeByIndex(index, width, height); 3192 }, 3193 GetContentHTML: function() { 3194 return this.GetContentHtml(); 3195 }, 3196 SetContentHTML: function(html) { 3197 this.SetContentHtml(html); 3198 }, 3199 GetContentHtml: function() { 3200 return this.GetWindowContentHtml(null); 3201 }, 3202 SetContentHtml: function(html, useAnimation) { 3203 this.SetWindowContentHtml(null, html, useAnimation); 3204 }, 3205 GetContentIFrame: function(window) { 3206 return this.GetWindowContentIFrame(null); 3207 }, 3208 GetContentUrl: function() { 3209 return this.GetWindowContentUrl(null); 3210 }, 3211 SetContentUrl: function(url) { 3212 this.SetWindowContentUrl(null, url); 3213 }, 3214 RefreshContentUrl: function() { 3215 this.RefreshWindowContentUrl(null); 3216 }, 3217 SetWindowPopupElementID: function(window, popupElementId) { 3218 var index = (window != null) ? window.index : -1; 3219 this.RemoveWindowAllPopupElements(index); 3220 this.SetPopupElementIDs(index, popupElementId.split(';')); 3221 if(aspxGetPopupControlCollection().IsDisappearTimerActive()) { 3222 aspxGetPopupControlCollection().ClearDisappearTimer(); 3223 this.Hide(index); 3224 } 3225 this.PopulatePopupElements(index); 3226 }, 3227 SetPopupElementID: function(popupElementId) { 3228 this.SetWindowPopupElementID(null, popupElementId); 3229 }, 3230 GetCurrentPopupElementIndex: function() { 3231 return this.GetWindowCurrentPopupElementIndex(null); 3232 }, 3233 GetWindowCurrentPopupElementIndex: function(window) { 3234 var popupElement = this.GetWindowCurrentPopupElement(window); 3235 return popupElement ? popupElement.DXPopupElementIndex : -1; 3236 }, 3237 GetCurrentPopupElement: function() { 3238 return this.GetWindowCurrentPopupElement(null); 3239 }, 3240 GetWindowCurrentPopupElement: function(window) { 3241 var index = (window != null) ? window.index : -1; 3242 var popupElement = this.GetPopupElement(index, this.GetLastShownPopupElementIndex(index)); 3243 if(popupElement && popupElement.DXPopupElementControl) 3244 return popupElement; 3245 return null; 3246 }, 3247 Show: function(popupElementIndex) { 3248 this.ShowWindow(null, popupElementIndex); 3249 }, 3250 ShowAtElement: function(htmlElement) { 3251 this.ShowWindowAtElement(null, htmlElement); 3252 }, 3253 ShowAtElementByID: function(id) { 3254 var htmlElement = document.getElementById(id); 3255 this.ShowWindowAtElement(null, htmlElement); 3256 }, 3257 ShowAtPos: function(x, y) { 3258 this.ShowWindowAtPos(null, Math.round(x), Math.round(y)); 3259 }, 3260 BringToFront: function() { 3261 this.BringWindowToFront(null); 3262 }, 3263 Hide: function() { 3264 this.HideWindow(null); 3265 }, 3266 IsWindowVisible: function(window) { 3267 var index = (window != null) ? window.index : -1; 3268 return this.InternalIsWindowVisible(index); 3269 }, 3270 IsVisible: function() { 3271 return this.InternalIsWindowVisible(-1); 3272 }, 3273 GetWindow: function(index) { 3274 return (0 <= index && index < this.windows.length) ? this.windows[index] : null; 3275 }, 3276 GetWindowByName: function(name) { 3277 for(var i = 0; i < this.windows.length; i++) 3278 if(this.windows[i].name == name) return this.windows[i]; 3279 return null; 3280 }, 3281 GetWindowCount: function() { 3282 return this.GetWindowCountCore(); 3283 }, 3284 ShowWindow: function(window, popupElementIndex) { 3285 var index = (window != null) ? window.index : -1; 3286 if(popupElementIndex === undefined) 3287 popupElementIndex = this.GetLastShownPopupElementIndex(index); 3288 this.DoShowWindowAtPos(index, __aspxInvalidPosition, __aspxInvalidPosition, popupElementIndex, false, true); 3289 }, 3290 ShowWindowAtElement: function(window, htmlElement) { 3291 var index = (window != null) ? window.index : -1; 3292 var lastIndexBackup = this.GetLastShownPopupElementIndex(index); 3293 this.ShowWindow(window, this.AddPopupElementInternal(index, htmlElement)); 3294 this.RemovePopupElementInternal(index, htmlElement); 3295 this.SetLastShownPopupElementIndex(index, lastIndexBackup); 3296 }, 3297 ShowWindowAtElementByID: function(window, id) { 3298 var htmlElement = document.getElementById(id); 3299 this.ShowWindowAtElement(window, htmlElement); 3300 }, 3301 ShowWindowAtPos: function(window, x, y) { 3302 var index = (window != null) ? window.index : -1; 3303 this.DoShowWindowAtPos(index, x, y, -1, false, true); 3304 }, 3305 BringWindowToFront: function(window) { 3306 var index = (window != null) ? window.index : -1; 3307 var element = this.GetWindowElement(index); 3308 aspxGetPopupControlCollection().ActivateWindowElement(element); 3309 }, 3310 HideWindow: function(window) { 3311 var index = (window != null) ? window.index : -1; 3312 this.DoHideWindow(index); 3313 }, 3314 GetWindowContentHTML: function(window) { 3315 return this.GetWindowContentHtml(window); 3316 }, 3317 SetWindowContentHTML: function(window, html) { 3318 this.SetWindowContentHtml(window, html); 3319 }, 3320 GetWindowContentHtml: function(window) { 3321 var index = (window != null) ? window.index : -1; 3322 var element = this.GetContentContainer(index); 3323 return (element != null) ? element.innerHTML : ""; 3324 }, 3325 SetWindowContentHtml: function(window, html, useAnimation) { 3326 var index = (window != null) ? window.index : -1; 3327 this.SetWindowContentHtmlCore(index, html, useAnimation); 3328 }, 3329 SetWindowContentHtmlCore: function(index, html, useAnimation) { 3330 var element = this.GetContentContainer(index); 3331 if(element != null) { 3332 _aspxSetInnerHtml(element, html); 3333 if(this.IeWithoutSupportDisplayTable()) 3334 element.style.zoom = 1; 3335 this.RecalculateWindowSize(index); 3336 if(useAnimation && typeof(ASPxAnimationHelper) != "undefined") 3337 ASPxAnimationHelper.fadeIn(element, function(){ this.ResizeWindowIFrame(index); }.aspxBind(this)); 3338 else 3339 this.ResizeWindowIFrame(index); 3340 this.UpdateScrollbar(index); 3341 } 3342 }, 3343 RecalculateWindowSize: function(index) { 3344 var window = this.GetWindowElement(index); 3345 var displayAfterSetSize = window.style.display; 3346 this.SetClientWindowSizeCoreLite(index, this.GetWindowWidthInternal(index), this.GetWindowHeightInternal(index), this.GetIsCollapsed(index)); 3347 window.style.display = displayAfterSetSize; 3348 }, 3349 GetWindowContentIFrame: function(window) { 3350 var index = (window != null) ? window.index : -1; 3351 return this.GetWindowContentIFrameElement(index); 3352 }, 3353 GetWindowContentUrl: function(window) { 3354 var index = (window != null) ? window.index : -1; 3355 if(!this.IsWindowVisible(window)) 3356 return this.GetWindowContentIFrameUrl(index); 3357 var element = this.GetWindowContentIFrameElement(index); 3358 return (element != null) ? element.src : ""; 3359 }, 3360 SetWindowContentUrl: function(window, url) { 3361 var index = (window != null) ? window.index : -1; 3362 this.SetWindowContentUrlInternal(index, url); 3363 }, 3364 SetWindowContentUrlInternal: function(index, url) { 3365 var element = this.GetWindowContentIFrameElement(index); 3366 var windowVisible = this.InternalIsWindowVisible(index); 3367 if(windowVisible && element != null) 3368 this.ShowIframeElementAfterDragging(index); 3369 this.SetWindowContentIFrameUrl(index, url); 3370 var src = !windowVisible ? ASPx.SSLSecureBlankUrl : url; 3371 if(element == null) { 3372 this.CreateWindowContentIFrameElement(index, src); 3373 if(_aspxElementIsVisible(this.GetWindowElement(index))) { 3374 var windowWidth = this.GetWindowDimensionByIndex(index, true, false); 3375 var windowHeight = this.GetWindowDimensionByIndex(index, false, false); 3376 this.SetClientWindowSizeCoreLite(index, windowWidth, windowHeight); 3377 } 3378 } 3379 else 3380 this.SetSrcToIframeElement(index, element, src); 3381 }, 3382 GetPinned: function() { 3383 return this.GetIsPinned(-1); 3384 },
3385 SetPinned: function(value) { 3386 this.SetPinCore(-1, value); 3387 }, 3388 GetWindowPinned: function(window) { 3389 var index = (window != null) ? window.index : -1; 3390 return this.GetIsPinned(index); 3391 }, 3392 SetWindowPinned: function(window, value) { 3393 var index = (window != null) ? window.index : -1; 3394 this.SetPinCore(index, value); 3395 }, 3396 GetMaximized: function() { 3397 return this.GetIsMaximized(-1); 3398 }, 3399 SetMaximized: function(value) { 3400 this.SetMaximizedCore(-1, value); 3401 }, 3402 GetWindowMaximized: function(window) { 3403 var index = (window != null) ? window.index : -1; 3404 return this.GetIsMaximized(index); 3405 }, 3406 SetWindowMaximized: function(window, value) { 3407 var index = (window != null) ? window.index : -1; 3408 this.SetMaximizedCore(index, value); 3409 }, 3410 GetCollapsed: function() { 3411 return this.GetIsCollapsed(-1); 3412 }, 3413 SetCollapsed: function(value) { 3414 this.SetCollapsedCore(-1, value); 3415 }, 3416 GetWindowCollapsed: function(window) { 3417 var index = (window != null) ? window.index : -1; 3418 return this.GetIsCollapsed(index); 3419 }, 3420 SetWindowCollapsed: function(window, value) { 3421 var index = (window != null) ? window.index : -1; 3422 this.SetCollapsedCore(index, value); 3423 }, 3424 RefreshWindowContentUrl: function(window) { 3425 var index = (window != null) ? window.index : -1; 3426 if(__aspxIE) 3427 this.RefreshWindowContentUrlIE(index, window); 3428 else 3429 this.RefreshWindowContentUrlCommon(window); 3430 }, 3431 RefreshWindowContentUrlIE: function(index, window) { 3432 var windowVisible = this.InternalIsWindowVisible(index); 3433 if(windowVisible) 3434 this.RefreshWindowContentUrlIECore(index, window); 3435 else { 3436 var iframe = this.GetWindowContentIFrameElement(index); 3437 if(iframe) 3438 iframe.DXReloadAfterShowRequired = true; 3439 } 3440 }, 3441 RefreshWindowContentUrlIECore: function(index, window) { 3442 try { 3443 if(!this.GetIframeLoading(index)) { 3444 var iframe = this.GetWindowContentIFrameElement(index); 3445 if(iframe) 3446 iframe.contentWindow.location.reload(); 3447 } 3448 } catch(e) { 3449 this.RefreshWindowContentUrlCommon(window); 3450 } 3451 }, 3452 RefreshWindowContentUrlCommon: function(window) { 3453 this.SetWindowContentUrl(window, this.GetWindowContentUrl(window)); 3454 }, 3455 SetWindowContentVisible: function(index, visible){ 3456 var contentElement = this.GetWindowContentWrapperElement(index); 3457 if (contentElement) 3458 this.SetWindowPartVisibleCore(contentElement, "DXPopupWindowContentDisplay", visible); 3459 }, 3460 SetWindowFooterVisible: function(index, visible){ 3461 var footerElement = this.GetWindowFooterElement(index); 3462 if (footerElement) 3463 this.SetWindowPartVisibleCore(footerElement, "DXPopupWindowFooterDisplay", visible); 3464 }, 3465 SetWindowPartVisibleCore: function(partElement, displayCacheName, visible){ 3466 var nothingChanged = _aspxElementIsVisible(partElement) && visible; 3467 if(nothingChanged) return; 3468 if(!(_aspxIsExists(partElement[displayCacheName]))) 3469 partElement[displayCacheName] = partElement.style.display; 3470 partElement.style.display = visible ? partElement[displayCacheName] : 'none'; 3471 }, 3472 UpdatePosition: function() { 3473 this.UpdatePositionAtElement(this.GetPopupElement(-1, this.GetLastShownPopupElementIndex(-1))); 3474 }, 3475 UpdatePositionAtElement: function(popupElement) { 3476 this.UpdateWindowPositionAtElement(null, popupElement); 3477 }, 3478 UpdateWindowPosition: function(window) { 3479 var index = (window != null) ? window.index : -1; 3480 this.UpdateWindowPositionAtElement(window, this.GetPopupElement(index, this.GetLastShownPopupElementIndex(index))); 3481 }, 3482 UpdateWindowPositionAtElement: function(window, popupElement) { 3483 var index = (window != null) ? window.index : -1; 3484 this.UpdateWindowPositionInternal(index, popupElement); 3485 }, 3486 UpdateWindowPositionInternal: function(index, popupElement) { 3487 var element = this.GetWindowElement(index); 3488 if(this.InternalIsWindowVisible(index) && element != null) { 3489 var horizontalPopupPosition = this.GetClientPopupPos(element, popupElement, __aspxInvalidPosition, true, false); 3490 var verticalPopupPosition = this.GetClientPopupPos(element, popupElement, __aspxInvalidPosition, false, false); 3491 this.SetWindowPos(index, element, horizontalPopupPosition.position, verticalPopupPosition.position); 3492 } else 3493 this.DoShowWindowAtPos(index, __aspxInvalidDimension, __aspxInvalidDimension, this.GetLastShownPopupElementIndex(index), false, false); 3494 }, 3495 TryAutoUpdatePosition: function(index) { 3496 if(this.GetAutoUpdatePosition(index)) 3497 this.UpdateWindowPositionInternal(index, this.GetPopupElement(index, this.GetLastShownPopupElementIndex(index))); 3498 if(this.GetIsMaximized(index)) 3499 this.UpdateMaximizedWindowSizeOnResize(index); 3500 }, 3501 CreateWindowContentIFrameElement: function(index, src) { 3502 var content = this.GetContentContainer(index); 3503 var iframeParent = content; 3504 content.innerHTML = ""; 3505 var iframe = this.CreateContentIFrameElement(index, src); 3506 this.RequireIFrameHeightAdjusting(index, iframe); 3507 iframeParent.appendChild(iframe); 3508 this.InitIFrame(index); 3509 return iframe; 3510 }, 3511 RequireIFrameHeightAdjusting: function(index, iframe) { 3512 if(this.InternalIsWindowVisible(index)) 3513 this.AdjustIFrameHeight(index, iframe); 3514 else 3515 this.PostponeIframeAdjusting(index); 3516 }, 3517 EnsureIFrameHeightAdjusted: function(index) { 3518 if(this.GetIframeAdjustingPostponed(index)) { 3519 var iframe = this.GetWindowContentIFrameElement(index); 3520 this.AdjustIFrameHeight(index, iframe); 3521 } 3522 }, 3523 PostponeIframeAdjusting: function(index) { 3524 this.SetIframeAdjustingPostponed(index, true); 3525 }, 3526 SetIframeAdjustingPostponed: function(index, value) { 3527 if(0 <= index && index < this.iframeAdjustingPostponedArray.length) 3528 this.iframeAdjustingPostponedArray[index] = value; 3529 else 3530 this.iframeAdjustingPostponed = value; 3531 }, 3532 GetIframeAdjustingPostponed: function(index) { 3533 if(0 <= index && index < this.iframeAdjustingPostponedArray.length) 3534 return this.iframeAdjustingPostponedArray[index]; 3535 return this.iframeAdjustingPostponed; 3536 }, 3537 AdjustIFrameHeight: function(index, iframe) { 3538 if(!this.InternalIsWindowVisible(index) || !iframe) return; 3539 this.SetIframeAdjustingPostponed(index, false); 3540 var content = this.GetContentContainer(index); 3541 var contentWrapper = this.GetWindowContentWrapperElement(index); 3542 iframe.style.verticalAlign = "text-bottom"; 3543 var iframeHeight = contentWrapper.offsetHeight - _aspxGetTopBottomBordersAndPaddingsSummaryValue(content); 3544 if(iframeHeight >= 0) 3545 iframe.style.height = iframeHeight + "px"; 3546 }, 3547 CreateContentIFrameElement: function(index, src) {
3548 var iframe = document.createElement("IFRAME"); 3549 iframe.id = this.GetWindowContentIFrameElementId(index); 3550 iframe.scrolling = "auto"; 3551 iframe.frameBorder = 0; 3552 iframe.style.width = "100%"; 3553 iframe.style.height = "100%"; 3554 iframe.style.overflow = "auto"; 3555 this.SetSrcToIframeElement(index, iframe, src); 3556 return iframe; 3557 }, 3558 CreateContentIFrameDivElement: function(index) { 3559 var iframeDiv = document.createElement("DIV"); 3560 iframeDiv.id = this.GetWindowContentIFrameDivElementID(index); 3561 iframeDiv.style.width = "100%"; 3562 iframeDiv.style.height = "100%"; 3563 return iframeDiv; 3564 }, 3565 GetWindowHeaderTextCell: function(index) { 3566 return this.GetWindowChild(index, "_PWH" + index + "T"); 3567 }, 3568 GetWindowHeaderImageCell: function(index) { 3569 return this.GetWindowChild(index, "_PWH" + index + "I"); 3570 }, 3571 GetWindowFooterTextCell: function(index) { 3572 return this.GetWindowChild(index, "_PWF" + index + "T"); 3573 }, 3574 GetWindowFooterImageCell: function(index) { 3575 return this.GetWindowChild(index, "_PWF" + index + "I"); 3576 }, 3577 GetWindowHeaderImageUrl: function(index) { 3578 var element = this.GetWindowHeaderImageCell(index); 3579 return element ? element.src : ""; 3580 }, 3581 SetWindowHeaderImageUrl: function(index, url) { 3582 var element = this.GetWindowHeaderImageCell(index); 3583 if(element != null) 3584 element.src = url; 3585 }, 3586 GetWindowFooterImageUrl: function(index) { 3587 var element = this.GetWindowFooterImageCell(index); 3588 return element ? element.src : ""; 3589 }, 3590 SetWindowFooterImageUrl: function(index, url) { 3591 var element = this.GetWindowFooterImageCell(index); 3592 if(element != null) { 3593 element.src = url; 3594 this.CorrectWindowSizeGripPositionLite(index); 3595 } 3596 }, 3597 GetWindowHeaderNavigateUrl: function(index) { 3598 var header = this.GetWindowHeaderElement(index); 3599 if(header) { 3600 var link = _aspxGetDescendantNodesByClassName(header, ASPxClientPopupControlCssClasses.LinkCssClassName)[0]; 3601 if(link) 3602 return link.href; 3603 } 3604 return ""; 3605 }, 3606 SetWindowHeaderNavigateUrl: function(index, url) { 3607 var header = this.GetWindowHeaderElement(index); 3608 if(header) { 3609 var link = _aspxGetDescendantNodesByClassName(header, ASPxClientPopupControlCssClasses.LinkCssClassName)[0]; 3610 if(link) 3611 link.href = url; 3612 } 3613 }, 3614 GetWindowFooterNavigateUrl: function(index) { 3615 var footer = this.GetWindowFooterElement(index); 3616 if(footer) { 3617 var link = _aspxGetDescendantNodesByClassName(footer, ASPxClientPopupControlCssClasses.LinkCssClassName)[0]; 3618 if(link) 3619 return link.href; 3620 } 3621 return ""; 3622 }, 3623 SetWindowFooterNavigateUrl: function(index, url) { 3624 var footer = this.GetWindowFooterElement(index); 3625 if(footer) { 3626 var link = _aspxGetDescendantNodesByClassName(footer, ASPxClientPopupControlCssClasses.LinkCssClassName)[0]; 3627 if(link) 3628 link.href = url; 3629 } 3630 return; 3631 }, 3632 GetWindowHeaderText: function(index) { 3633 var element = this.GetWindowHeaderTextCell(index); 3634 if(element != null) { 3635 var link = _aspxGetChildByTagName(element, "A", 0); 3636 if(link != null) 3637 return link.innerHTML; 3638 else 3639 return element.innerHTML; 3640 } 3641 return ""; 3642 }, 3643 SetWindowHeaderText: function(index, text) { 3644 var element = this.GetWindowHeaderTextCell(index); 3645 if(element != null) { 3646 var link = _aspxGetChildByTagName(element, "A", 0); 3647 if(link != null) 3648 link.innerHTML = text; 3649 else 3650 element.innerHTML = text; 3651 this.CorrectElementVerticalAlignment(_aspxAdjustVerticalMarginsInContainer, this.GetWindowHeaderElement(index), true); 3652 } 3653 }, 3654 GetWindowFooterText: function(index) { 3655 var element = this.GetWindowFooterTextCell(index); 3656 if(element != null) { 3657 var link = _aspxGetChildByTagName(element, "A", 0); 3658 if(link != null) 3659 return link.innerHTML; 3660 else 3661 return element.innerHTML; 3662 } 3663 return ""; 3664 }, 3665 SetWindowFooterText: function(index, text) { 3666 var element = this.GetWindowFooterTextCell(index); 3667 if(element != null) { 3668 var link = _aspxGetChildByTagName(element, "A", 0); 3669 if(link != null) 3670 link.innerHTML = text; 3671 else 3672 element.innerHTML = text; 3673 this.CorrectWindowSizeGripPositionLite(index); 3674 } 3675 }, 3676 RefreshPopupElementConnection: function() { 3677 var index = this.HasDefaultWindow() ? -1 : 0; 3678 for(; index < this.GetWindowCount(); index++) { 3679 this.RemoveWindowAllPopupElements(index); 3680 this.PopulatePopupElements(index); 3681 } 3682 }, 3683 GetHeaderImageUrl: function() { 3684 return this.GetWindowHeaderImageUrl(-1); 3685 }, 3686 SetHeaderImageUrl: function(value) { 3687 this.SetWindowHeaderImageUrl(-1, value); 3688 }, 3689 GetFooterImageUrl: function() { 3690 return this.GetWindowFooterImageUrl(-1); 3691 }, 3692 SetFooterImageUrl: function(value) { 3693 this.SetWindowFooterImageUrl(-1, value); 3694 }, 3695 GetHeaderNavigateUrl: function() { 3696 return this.GetWindowHeaderNavigateUrl(-1); 3697 }, 3698 SetHeaderNavigateUrl: function(value) { 3699 this.SetWindowHeaderNavigateUrl(-1, value); 3700 }, 3701 GetFooterNavigateUrl: function() { 3702 return this.GetWindowFooterNavigateUrl(-1); 3703 }, 3704 SetFooterNavigateUrl: function(value) { 3705 this.SetWindowFooterNavigateUrl(-1, value); 3706 }, 3707 GetHeaderText: function() { 3708 return this.GetWindowHeaderText(-1); 3709 }, 3710 SetHeaderText: function(value) { 3711 this.SetWindowHeaderText(-1, value); 3712 }, 3713 GetFooterText: function() { 3714 return this.GetWindowFooterText(-1); 3715 }, 3716 SetFooterText: function(value) { 3717 this.SetWindowFooterText(-1, value); 3718 }, 3719 GetVisible: function() { 3720 return this.IsVisible(); 3721 }, 3722 SetVisible: function(visible) { 3723 if(visible && !this.IsVisible()) 3724 this.Show(); 3725 else if(!visible && this.IsVisible()) 3726 this.Hide(); 3727 } 3728}); 3729ASPxClientPopupControl.Cast = ASPxClientControl.Cast; 3730ASPxClientPopupControl.GetPopupControlCollection = function () { 3731 return aspxGetPopupControlCollection(); 3732} 3733var ASPxClientPopupControlResizeState = { 3734 Resized : 0, 3735 Collapsed : 1, 3736 Expanded : 2, 3737 Maximized : 3, 3738 RestoredAfterMaximized : 4 3739}; 3740ASPxClientPopupControlCollection = _aspxCreateClass(ASPxClientControlCollection, { 3741 constructor: function () { 3742 this.constructor.prototype.constructor.call(this); 3743 this.draggingControl = null; 3744 this.draggingWindowIndex = -1; 3745 this.gragXOffset = 0; 3746 this.gragYOffset = 0; 3747 this.visibleModalElements = new Array(); 3748 this.visiblePopupWindowIds = new Array(); 3749 this.zIndex = __aspxPopupControlZIndex; 3750 this.windowResizeByBodyScrollVisibilityChangingLockCount = 0; 3751 this.savedBodyWidth = 0; 3752 this.savedBodyHeight = 0; 3753 this.overControl = null; 3754 this.overWindowIndex = -1; 3755 this.overXPos = __aspxInvalidPosition; 3756 this.overYPos = __aspxInvalidPosition; 3757 this.appearTimerID = -1; 3758 this.disappearTimerID = -1; 3759 this.scrollEventLockCount = 0; 3760 this.currentActiveWindowElement = null; 3761 this.resizeControl = null; 3762 this.resizeIndex = -2; 3763 this.resizeCursor = ""; 3764 this.resizePanel = null; 3765 this.selectBanned = false; 3766 this.pcWindowsAreRestrictedByDocumentWindow = true; 3767 this.searchForTabIndexInAllElements = false; 3768 this.docScrollLeft = -1; 3769 this.docScrollTop = -1; 3770 this.EnsureSaveScrollState(); 3771 }, 3772 EnsureSaveScrollState: function () { 3773 if (__aspxDocumentLoaded && this.docScrollLeft < 0 && this.docScrollTop < 0) 3774 this.SaveScrollState(); 3775 }, 3776 GetPopupWindowFromID: function (id) { 3777 var pos = id.lastIndexOf(__aspxPCWIdSuffix); 3778 var name = id.substring(0, pos); 3779 var index = id.substr(pos + __aspxPCWIdSuffix.length); 3780 var popupControl = aspxGetPopupControlCollection().Get(name); 3781 return new _aspxPopupWindow(popupControl, index); 3782 }, 3783 DoHideAllWindows: function (srcElement, excptId, applyToAll) { 3784 for (var i = this.visiblePopupWindowIds.length - 1; i >= 0; i--) { 3785 var id = this.visiblePopupWindowIds[i]; 3786 if (id == excptId) continue; 3787 if (srcElement != null && _aspxGetParentById(srcElement, id) != null) continue; 3788 var popupWindow = this.GetPopupWindowFromID(id);
3789 var windowCloseAction = popupWindow.popupControl.GetWindowCloseAction(popupWindow.windowIndex); 3790 if (popupWindow.popupControl != null) { 3791 var popupWindowZIndexArray = ASPxClientPopupUtils.GetElementZIndexArray(popupWindow.popupControl.GetWindowElement(popupWindow.windowIndex)); 3792 var isPopupHigherSrcElement = ASPxClientPopupUtils.IsHigher(popupWindowZIndexArray, ASPxClientPopupUtils.GetElementZIndexArray(srcElement)) || !popupWindow.popupControl.HasDefaultWindow(); 3793 } 3794 if (popupWindow.popupControl != null && ( 3795 (windowCloseAction != "CloseButton" && windowCloseAction != "None") && isPopupHigherSrcElement || applyToAll)) { 3796 popupWindow.popupControl.DoHideWindow(parseInt(popupWindow.windowIndex)); 3797 } 3798 } 3799 }, 3800 DoShowAtCurrentPos: function (name, index, popupElementIndex, evtClone) { 3801 var pc = this.Get(name); 3802 if (pc != null && !pc.InternalIsWindowVisible(index)) 3803 pc.DoShowWindowAtPos(index, this.overXPos, this.overYPos, popupElementIndex, true, true, evtClone); 3804 }, 3805 ActivateWindowElement: function (element, evt) { 3806 var visibleWindowsCount = this.visiblePopupWindowIds.length; 3807 if (__aspxPopupControlZIndex <= element.style.zIndex && element.style.zIndex != visibleWindowsCount * 2 + __aspxPopupControlZIndex) { 3808 this.DeleteWindowFromZIndexOrder(element); 3809 } 3810 this.SetWindowElementZIndex(element, __aspxPopupControlZIndex + visibleWindowsCount * 2); 3811 var pcWElementEventSource = ASPxClientPopupUtils.FindEventSourceParentByTestFunc(evt, aspxTestPopupWindowElement); 3812 if (!evt || (evt && pcWElementEventSource == element)) { 3813 if (this.GetCurrentActiveWindowElement() != element) { 3814 this.RefreshTabIndexes(false); 3815 this.SaveCurrentActiveWindowElement(element); 3816 } 3817 } 3818 }, 3819 RefreshTabIndexes: function (forceRecalculate) { 3820 var topModalWindow = this.GetTopModalWindow(); 3821 if (topModalWindow != null || forceRecalculate) { 3822 var topModalWindowZIndexArray = ASPxClientPopupUtils.GetElementZIndexArray(topModalWindow); 3823 this.CalculateTabIndexes(topModalWindowZIndexArray); 3824 } 3825 }, 3826 ElementHasTabIndex: function (element) { 3827 if (__aspxIE && __aspxBrowserVersion < 8) { 3828 var elementHtml = element.outerHTML; 3829 var attributeIndex = elementHtml.indexOf('tabIndex'); 3830 return attributeIndex != -1 && attributeIndex < elementHtml.indexOf(">"); 3831 } 3832 else 3833 return _aspxIsExists(_aspxGetAttribute(element, "tabindex")); 3834 }, 3835 IsElementCanBeActive: function (element) { 3836 return element.tagName === "INPUT" || element.tagName === "A" || 3837 element.tagName === "BUTTON" || element.tagName === "TEXTAREA" || 3838 element.tagName === "SELECT" || this.ElementHasTabIndex(element); 3839 }, 3840 GetCanBeActiveElements: function () { 3841 var searchForTabIndexInAllElements = aspxGetPopupControlCollection().searchForTabIndexInAllElements; 3842 if (searchForTabIndexInAllElements) { 3843 var elements = document.getElementsByTagName("*"); 3844 var canBeActiveElements = []; 3845 for (var i = 0; i < elements.length; i++) { 3846 if (this.IsElementCanBeActive(elements[i], searchForTabIndexInAllElements)) 3847 canBeActiveElements.push(elements[i]); 3848 } 3849 return canBeActiveElements; 3850 } else { 3851 var inputs = document.getElementsByTagName("INPUT"); 3852 var links = document.getElementsByTagName("A"); 3853 var lists = document.getElementsByTagName("UL"); 3854 var buttons = document.getElementsByTagName("BUTTON"); 3855 var textareas = document.getElementsByTagName("TEXTAREA"); 3856 var selects = document.getElementsByTagName("SELECT"); 3857 var union = _aspxCollectionsUnionToArray(inputs, links); 3858 union = _aspxCollectionsUnionToArray(union, buttons); 3859 union = _aspxCollectionsUnionToArray(union, textareas); 3860 union = _aspxCollectionsUnionToArray(union, selects); 3861 return _aspxCollectionsUnionToArray(union, lists); 3862 } 3863 }, 3864 CalculateTabIndexes: function (topModalWindowZIndexArray) { 3865 var elements = this.GetCanBeActiveElements(); 3866 for (var i = 0; i < elements.length; i++) { 3867 var currentElementZIndexArray = ASPxClientPopupUtils.GetElementZIndexArray(elements[i]); 3868 if (ASPxClientPopupUtils.IsHigher(currentElementZIndexArray, topModalWindowZIndexArray)) 3869 _aspxRestoreTabIndexAttribute(elements[i]); 3870 else 3871 _aspxChangeTabIndexAttribute(elements[i]); 3872 } 3873 }, 3874 PopupWindowIsModalByVisibleIndex: function (visiblePopupWindowIndex) { 3875 return this.PopupWindowIsModalByID(this.visiblePopupWindowIds[visiblePopupWindowIndex]); 3876 }, 3877 PopupWindowIsModalByID: function (windowElementID) { 3878 var popupWindow = this.GetPopupWindowFromID(windowElementID); 3879 return popupWindow.popupControl.WindowIsModal(popupWindow.windowIndex); 3880 }, 3881 SaveCurrentActiveWindowElement: function (windowElement) { 3882 this.currentActiveWindowElement = windowElement; 3883 }, 3884 SkipCurrentActiveWindowElement: function (element) { 3885 if (element == this.GetCurrentActiveWindowElement()) 3886 this.SaveCurrentActiveWindowElement(null); 3887 }, 3888 GetCurrentActiveWindowElement: function () { 3889 return this.currentActiveWindowElement; 3890 }, 3891 GetTopModalWindow: function () { 3892 var topWindow = null; 3893 var topWindowZIndexArray = null; 3894 for (var i = 0; i < this.visiblePopupWindowIds.length; i++) { 3895 var currentWindow = _aspxGetElementById(this.visiblePopupWindowIds[i]); 3896 if (this.PopupWindowIsModalByVisibleIndex(i) && _aspxElementIsVisible(currentWindow)) { 3897 var currentWindowZIndexArray = ASPxClientPopupUtils.GetElementZIndexArray(currentWindow); 3898 if (topWindow == null || ASPxClientPopupUtils.IsHigher(currentWindowZIndexArray, topWindowZIndexArray)) { 3899 topWindow = currentWindow; 3900 topWindowZIndexArray = currentWindowZIndexArray; 3901 } 3902 } 3903 } 3904 return topWindow; 3905 }, 3906 DeleteWindowFromZIndexOrder: function (element) { 3907 for (var i = this.visiblePopupWindowIds.length - 1; i >= 0; i--) { 3908 var windowElement = _aspxGetElementById(this.visiblePopupWindowIds[i]); 3909 if (!windowElement) 3910 _aspxArrayRemoveAt(this.visiblePopupWindowIds, i); 3911 else if (windowElement.style.zIndex > element.style.zIndex) 3912 this.SetWindowElementZIndex(windowElement, windowElement.style.zIndex - 2); 3913 } 3914 }, 3915 SetWindowElementZIndex: function (element, zIndex) { 3916 element.style.zIndex = zIndex; 3917 var iFrame = element.overflowElement; 3918 if (iFrame) 3919 iFrame.style.zIndex = zIndex - 1; 3920 var modalElement = element.modalElement; 3921 if (modalElement) 3922 modalElement.style.zIndex = zIndex - 1;
3923 this.UpdateWindowsStateInputElement(element.id); 3924 this.UpdateWindowsStateCookie(element.id); 3925 }, 3926 AdjustModalElementsBounds: function () { 3927 for (var i = 0; i < this.visibleModalElements.length; i++) 3928 this.AdjustModalElementBounds(this.visibleModalElements[i]); 3929 }, 3930 AdjustModalElementBounds: function (element) { 3931 if (!_aspxIsExistsElement(element)) return; 3932 var x = _aspxPrepareClientPosForElement(0, element, true); 3933 var y = _aspxPrepareClientPosForElement(0, element, false); 3934 _aspxSetStyles(element, { left: x, top: y }); 3935 if (__aspxNetscapeFamily && !__aspxFirefox) 3936 _aspxSetStyles(element, { width: 1, height: 1 }); 3937 _aspxSetStyles(element, { width: _aspxGetDocumentWidth(), height: _aspxGetDocumentHeight() }); 3938 }, 3939 ClearAppearTimer: function () { 3940 this.appearTimerID = _aspxClearTimer(this.appearTimerID); 3941 }, 3942 ClearDisappearTimer: function () { 3943 this.disappearTimerID = _aspxClearTimer(this.disappearTimerID); 3944 }, 3945 IsAppearTimerActive: function () { 3946 return this.appearTimerID > -1; 3947 }, 3948 IsDisappearTimerActive: function () { 3949 return this.disappearTimerID > -1; 3950 }, 3951 SetAppearTimer: function (name, index, popupElementIndex, timeout, evt) { 3952 var evtClone = _aspxCloneObject(evt); 3953 this.appearTimerID = _aspxSetTimeout(function() { 3954 aspxGetPopupControlCollection().DoShowAtCurrentPos(name, index, popupElementIndex, evtClone); 3955 }, timeout); 3956 }, 3957 SetDisappearTimer: function (name, index, timeout) { 3958 this.disappearTimerID = _aspxSetTimeout("aspxPWDisappearTimer(\"" + name + "\", " + index + ")", timeout); 3959 }, 3960 GetDocScrollDifference: function () { 3961 return new _aspxScrollDifference(_aspxGetDocumentScrollLeft() - this.docScrollLeft, _aspxGetDocumentScrollTop() - this.docScrollTop); 3962 }, 3963 IsDocScrolled: function (scroll) { 3964 return scroll.horizontal != 0 || scroll.vertical != 0; 3965 }, 3966 SaveScrollState: function () { 3967 this.docScrollLeft = _aspxGetDocumentScrollLeft(); 3968 this.docScrollTop = _aspxGetDocumentScrollTop(); 3969 }, 3970 InitDragObject: function (control, index, x, y, xClientCorrection, yClientCorrection) { 3971 this.draggingControl = control; 3972 this.draggingWindowIndex = index; 3973 this.gragXOffset = x; 3974 this.gragYOffset = y; 3975 this.xClientCorrection = xClientCorrection; 3976 this.yClientCorrection = yClientCorrection; 3977 this.SetDocumentSelectionBan(true); 3978 }, 3979 InitOverObject: function (control, index, evt) { 3980 this.overControl = control; 3981 this.overWindowIndex = index; 3982 if (evt) 3983 this.SaveCurrentMouseOverPos(evt); 3984 }, 3985 InitResizeObject: function (control, index, cursor, resizePanel) { 3986 this.resizeControl = control; 3987 this.resizeIndex = index; 3988 this.resizeCursor = cursor; 3989 this.resizePanel = resizePanel; 3990 this.SetDocumentSelectionBan(true); 3991 }, 3992 SetDocumentSelectionBan: function (value) { 3993 if (this.selectBanned === value) 3994 return; 3995 this.selectBanned = value; 3996 if (__aspxWebKitFamily) { 3997 if (value) { 3998 if (!this.webkitUserSelectBackup && document.body.style.webkitUserSelect) 3999 this.webkitUserSelectBackup = document.body.style.webkitUserSelect; 4000 document.body.style.webkitUserSelect = "none"; 4001 } else { 4002 if (this.webkitUserSelectBackup) { 4003 document.body.style.webkitUserSelect = this.webkitUserSelectBackup; 4004 delete this.webkitUserSelectBackup; 4005 } else 4006 document.body.style.webkitUserSelect = "auto"; 4007 } 4008 } 4009 }, 4010 IsResizeInint: function () { 4011 return this.resizeControl != null; 4012 }, 4013 ClearDragObject: function () { 4014 this.draggingControl = null; 4015 this.draggingWindowIndex = -1; 4016 this.gragXOffset = 0; 4017 this.gragYOffset = 0; 4018 this.SetDocumentSelectionBan(this.resizeControl != null); 4019 }, 4020 ClearResizeObject: function () { 4021 this.resizeControl = null; 4022 this.resizeIndex = -2; 4023 this.resizeCursor = ""; 4024 this.SetDocumentSelectionBan(this.draggingControl != null); 4025 this.resizePanel.parentNode.removeChild(this.resizePanel); 4026 }, 4027 Drag: function (evt) { 4028 if(window["__aspxTableColumnResizing"] || window["__aspxDragHelper"]) 4029 return; 4030 if (!_aspxGetIsLeftButtonPressed(evt)) return; 4031 var x = _aspxGetEventX(evt); 4032 var y = _aspxGetEventY(evt); 4033 if (this.pcWindowsAreRestrictedByDocumentWindow && ASPxClientPopupUtils.CoordinatesInDocumentRect(x, y)) { 4034 x += this.gragXOffset; 4035 y += this.gragYOffset; 4036 this.draggingControl.OnDrag(this.draggingWindowIndex, x, y, this.xCl
4036ientCorrection, this.yClientCorrection, evt); 4037 if(__aspxWebKitTouchUI) 4038 evt.preventDefault(); 4039 } 4040 }, 4041 DragStop: function () { 4042 this.draggingControl.OnDragStop(this.draggingWindowIndex); 4043 this.ClearDragObject(); 4044 }, 4045 ResizeStop: function (evt) { 4046 this.resizeControl.OnResizeStop(evt, this.resizeIndex, this.resizeCursor, this.resizePanel); 4047 aspxGetPopupControlCollection().ClearResizeObject(); 4048 }, 4049 OnPWMouseMove: function (evt, name, index) { 4050 if (this.draggingControl == null && 4051 this.overControl == null && 4052 this.resizeControl == null) { 4053 var pc = aspxGetPopupControlCollection().Get(name); 4054 if (pc != null) pc.OnMouseMove(evt, index); 4055 } 4056 }, 4057 OnPWMouseOver: function (evt) { 4058 if (!this.overControl || this.draggingControl) return; 4059 if (this.IsOverPopupWindow(evt)) 4060 this.ClearDisappearTimer(); 4061 }, 4062 IsOverPopupWindow: function (evt) { 4063 return ASPxClientPopupUtils.FindEventSourceParentByTestFunc(evt, aspxTestPopupControlOverElement) != null; 4064 }, 4065 OnDocumentMouseDown: function (evt) { 4066 var popupElement = ASPxClientPopupUtils.FindEventSourceParentByTestFunc(evt, aspxTestPopupControlElement); 4067 var excptId = popupElement == null ? "" : 4068 popupElement.DXPopupElementControl.GetWindowElementId(popupElement.DXPopupWindowIndex); 4069 this.OnMouseDownCore(evt, excptId); 4070 }, 4071 OnMouseDown: function (evt) { 4072 this.OnMouseDownCore(evt, ""); 4073 }, 4074 OnMouseDownCore: function (evt, excptId) { 4075 var srcElement = _aspxGetEventSource(evt); 4076 this.DoHideAllWindows(srcElement, excptId, false); 4077 aspxGetPopupControlCollection().ClearAppearTimer(); 4078 }, 4079 OnMouseMove: function (evt) { 4080 if(__aspxWebKitTouchUI && ASPxClientTouchUI.isGesture) 4081 return; 4082 if (this.draggingControl != null) { 4083 this.Drag(evt); 4084 } 4085 else if (this.overControl != null) { 4086 this.OnMouseOver(evt); 4087 } 4088 else if (this.resizeControl != null) { 4089 if (__aspxIE && !_aspxGetIsLeftButtonPressed(evt)) 4090 this.ResizeStop(evt); 4091 else 4092 this.resizeControl.OnResize(evt, this.resizeIndex, this.resizeCursor, this.resizePanel); 4093 } 4094 }, 4095 OnMouseOver: function (evt) { 4096 var element = ASPxClientPopupUtils.FindEventSourceParentByTestFunc(evt, aspxTestPopupControlOverElement); 4097 var curPopupElementIndex = this.overControl.GetWindowCurrentPopupElementIndex(this.overWindowIndex); 4098 var curPopupElement = this.overControl.GetPopupElementList()[curPopupElementIndex]; 4099 var popup = element != null ? element.DXPopupElementControl : null; 4100 var isPopupActionMouseOver = popup && popup.popupAction == 'MouseOver'; 4101 var isCurPopupElement = element === curPopupElement; 4102 var isCurPopupWindow = element != null && element.id === this.overControl.GetWindowElementId(this.overWindowIndex); 4103 var isCurPopupElementOrCurPopupWindow = isCurPopupElement || isCurPopupWindow || isPopupActionMouseOver; 4104 if(isCurPopupElementOrCurPopupWindow) { 4105 var clearTimer = true; 4106 var popup = element.DXPopupElementControl; 4107 if(popup && popup.GetLastShownPopupElementIndex(element.DXPopupWindowIndex) != element.DXPopupElementIndex) 4108 clearTimer = false; 4109 if(clearTimer) 4110 this.ClearDisappearTimer(); 4111 this.SaveCurrentMouseOverPos(evt); 4112 if (__aspxTouchUI && !ASPxClientTouchUI.IsNativeScrolling()) 4113 return; 4114 return _aspxCancelBubble(evt); 4115 } 4116 this.OnMouseOut(); 4117 }, 4118 OnMouseOut: function (evt) { 4119 if (!this.overControl || this.draggingControl) return; 4120 this.ClearAppearTimer(); 4121 var windowCloseAction = this.overControl.GetWindowCloseAction(this.overWindowIndex); 4122 if (windowCloseAction == "MouseOut" && this.overControl.InternalIsWindowVisible(this.overWindowIndex)) { 4123 if (!this.IsDisappearTimerActive() && this.IsDisappearAllowedByMouseOut(evt)) 4124 this.SetDisappearTimer(this.overControl.name, this.overWindowIndex, this.overControl.disappearAfter); 4125 } 4126 else 4127 this.OverStop(); 4128 }, 4129 IsDisappearAllowedByMouseOut: function (evt) { 4130 return __aspxFirefox ? !this.IsOverPopupWindow(evt) : true; 4131 }, 4132 OnMouseUp: function (evt) { 4133 if (this.draggingControl != null) 4134 this.DragStop(); 4135 if (this.resizeControl != null) 4136 this.ResizeStop(evt); 4137 }, 4138 OnResize: function (evt) { 4139 this.AutoUpdateElementsPosition(); 4140 this.AdjustModalElementsBounds(); 4141 }, 4142 OnScroll: function (evt) { 4143 if (this.scrollEventLockCount > 0) 4144 return; 4145 var scroll = this.GetDocScrollDifference(); 4146 if (this.IsDocScrolled(scroll)) { 4147 this.CorrectPositionAtScroll(scroll); 4148 this.AdjustModalElementsBounds(); 4149 this.SaveScrollState(); 4150 } 4151 if (__aspxIE && __aspxBrowserVersion <= 8){
4152 this.CalculateDocumentDimensionsWithoutPinnedWindowsOldIE(function(){ 4153 this.FireScrollEventToWindowsOldIE(evt); 4154 }.aspxBind(this), evt); 4155 } 4156 else { 4157 this.CalculateDocumentDimensionsWithoutPinnedWindows(evt); 4158 this.FireScrollEventToWindows(evt); 4159 } 4160 }, 4161 GetSavedBodyWidth: function(){ 4162 if (this.savedBodyWidth == 0) 4163 this.CalculateDocumentDimensionsWithoutPinnedWindows(); 4164 return this.savedBodyWidth; 4165 }, 4166 GetSavedBodyHeight: function(){ 4167 if (this.savedBodyHeight == 0) 4168 this.CalculateDocumentDimensionsWithoutPinnedWindows(); 4169 return this.savedBodyHeight; 4170 }, 4171 HidePinnedPopupsThatOutFromViewPort: function(){ 4172 var popupsToRestoreVisible = []; 4173 for (var i = 0; i < this.visiblePopupWindowIds.length; i++) { 4174 var popupWindow = this.GetPopupWindowFromID(this.visiblePopupWindowIds[i]); 4175 var popupControl = popupWindow.popupControl; 4176 if (!(popupControl.GetIsPinned(popupWindow.windowIndex) && popupControl.GetIsOutFromViewPort(popupWindow.windowIndex))) 4177 continue; 4178 var element = popupControl.GetWindowElement(popupWindow.windowIndex); 4179 if (!element) continue; 4180 var restoreData = {}; 4181 restoreData.element = element; 4182 restoreData.display = element.style.display; 4183 element.style.display = "none"; 4184 popupsToRestoreVisible.push(restoreData); 4185 } 4186 return popupsToRestoreVisible; 4187 }, 4188 RestorePinnedPopupsThatOutFromViewPort: function(popupsToRestoreVisible){ 4189 if (popupsToRestoreVisible.length > 0){ 4190 for (var i = 0; i < popupsToRestoreVisible.length; i++) { 4191 var restoreData = popupsToRestoreVisible[i]; 4192 restoreData.element.style.display = restoreData.display; 4193 } 4194 } 4195 }, 4196 CalculateDocumentDimensionsWithoutPinnedWindows: function (evt) { 4197 var popupsToRestoreVisible = []; 4198 var needToHideRestorePopupsThatOutFromViewPort = !!evt && _aspxGetEventSource(evt) == document; 4199 if (needToHideRestorePopupsThatOutFromViewPort) 4200 popupsToRestoreVisible = this.HidePinnedPopupsThatOutFromViewPort(); 4201 this.savedBodyWidth = _aspxGetDocumentWidth(); 4202 this.savedBodyHeight = _aspxGetDocumentHeight(); 4203 if (needToHideRestorePopupsThatOutFromViewPort) 4204 this.RestorePinnedPopupsThatOutFromViewPort(popupsToRestoreVisible); 4205 }, 4206 FireScrollEventToWindows: function(evt) { 4207 for (var i = 0; i < this.visiblePopupWindowIds.length; i++) { 4208 var popupWindow = this.GetPopupWindowFromID(this.visiblePopupWindowIds[i]); 4209 var popupControl = popupWindow.popupControl; 4210 popupControl.OnScroll(evt, popupWindow.windowIndex); 4211 } 4212 }, 4213 CalculateDocumentDimensionsWithoutPinnedWindowsOldIE: function (onCalculateFinished, evt) { 4214 var popupsToRestoreVisible = []; 4215 var needToHideRestorePopupsThatOutFromViewPort = !!evt && _aspxGetEventSource(evt) == document; 4216 if (needToHideRestorePopupsThatOutFromViewPort) 4217 popupsToRestoreVisible = this.HidePinnedPopupsThatOutFromViewPort(); 4218 this.scrollEventLockCount++; 4219 window.setTimeout(function(){ 4220 this.savedBodyWidth = _aspxGetDocumentWidth(); 4221 this.savedBodyHeight = _aspxGetDocumentHeight(); 4222 if (needToHideRestorePopupsThatOutFromViewPort) 4223 this.RestorePinnedPopupsThatOutFromViewPort(popupsToRestoreVisible); 4224 if(onCalculateFinished) 4225 window.setTimeout(function(){onCalculateFinished(); }.aspxBind(this), 0); 4226 this.scrollEventLockCount--; 4227 }.aspxBind(this), 0); 4228 }, 4229 FireScrollEventToWindowsOldIE: function(evt) { 4230 this.scrollEventLockCount++; 4231 this.FireScrollEventToWindows(evt); 4232 this.scrollEventLockCount--; 4233 }, 4234 LockScrollEvent: function () { 4235 this.scrollEventLockCount++; 4236 }, 4237 UnlockScrollEvent: function () { 4238 this.scrollEventLockCount--; 4239 }, 4240 CorrectPositionAtScroll: function (scroll) { 4241 for (var i = 0; i < this.visiblePopupWindowIds.length; i++) { 4242 var popupWindow = this.GetPopupWindowFromID(this.visiblePopupWindowIds[i]); 4243 var popupControl = popupWindow.popupControl; 4244 if (popupControl != null && popupControl.InternalIsWindowVisible(popupWindow.windowIndex)) { 4245 if (popupControl.GetAutoUpdatePosition(popupWindow.windowIndex)) 4246 popupWindow.popupControl.TryAutoUpdatePosition(popupWindow.windowIndex); 4247 } 4248 } 4249 }, 4250 FFScrollEmulation: function (scroll, popupWindow) { 4251 var windowElement = popupWindow.popupControl.GetWindowElement(popupWindow.windowIndex); 4252 windowElement.style.left = (windowElement.offsetLeft - scroll.horizontal) + "px"; 4253 windowElement.style.top = (windowElement.offsetTop - scroll.vertical) + "px"; 4254 }, 4255 OnSelectStart: function () { 4256 return !this.selectBanned; 4257 }, 4258 OverStop: function () { 4259 this.overControl = null; 4260 this.overWindowIndex = -1; 4261 }, 4262 OnPWDisappearTimer: function (name, index) { 4263 var pc = this.Get(name); 4264 if (pc != null) { 4265 if (!pc.DoHideWindow(index)) 4266 this.OverStop(); 4267 this.ClearDisappearTimer(); 4268 } 4269 }, 4270 SaveCurrentMouseOverPos: function (evt) { 4271 this.overXPos = _aspxGetEventX(evt); 4272 this.overYPos = _aspxGetEventY(evt); 4273 }, 4274 RegisterVisibleModalElement: function (element) { 4275 if (_aspxArrayIndexOf(this.visibleModalElements, element) == -1) 4276 this.visibleModalElements.push(element); 4277 }, 4278 UnregisterVisibleModalElement: function (element) { 4279 _aspxArrayRemove(this.visibleModalElements, element); 4280 }, 4281 RegisterVisibleWindow: function (element, popupControl, index) {
4282 if (_aspxArrayIndexOf(this.visiblePopupWindowIds, element.id) == -1) { 4283 this.visiblePopupWindowIds.push(element.id); 4284 if (popupControl && popupControl.GetWindowCloseAction(index) == "MouseOut") 4285 aspxGetPopupControlCollection().InitOverObject(popupControl, index, null); 4286 this.OnRegisteredVisibleWindow(element); 4287 } 4288 }, 4289 OnRegisteredVisibleWindow: function (element) { 4290 var elementIndex = _aspxArrayIndexOf(this.visiblePopupWindowIds, element.id); 4291 if (this.PopupWindowIsModalByVisibleIndex(elementIndex)) 4292 ASPxClientPopupUtils.RemoveFocus(element); 4293 }, 4294 UnregisterVisibleWindow: function (element) { 4295 this.DeleteWindowFromZIndexOrder(element); 4296 _aspxArrayRemove(this.visiblePopupWindowIds, element.id); 4297 var forceRecalculate = this.PopupWindowIsModalByID(element.id); 4298 this.RefreshTabIndexes(forceRecalculate); 4299 this.SkipCurrentActiveWindowElement(element); 4300 }, 4301 UpdateWindowsStateCookie: function (id) { 4302 var pos = id.lastIndexOf(__aspxPCWIdSuffix); 4303 var name = id.substring(0, pos); 4304 var popupControl = aspxGetPopupControlCollection().Get(name); 4305 if (popupControl != null) 4306 popupControl.UpdateWindowsStateCookie(false); 4307 }, 4308 UpdateWindowsStateInputElement: function (id) { 4309 var pos = id.lastIndexOf(__aspxPCWIdSuffix); 4310 var name = id.substring(0, pos); 4311 var popupControl = aspxGetPopupControlCollection().Get(name); 4312 if (popupControl != null) 4313 popupControl.UpdateWindowsStateInputElement(false); 4314 }, 4315 AutoUpdateElementsPosition: function () { 4316 for (var i = 0; i < this.visiblePopupWindowIds.length; i++) { 4317 var popupWindow = this.GetPopupWindowFromID(this.visiblePopupWindowIds[i]); 4318 var popupControl = popupWindow.popupControl; 4319 if (popupControl != null && popupControl.InternalIsWindowVisible(popupWindow.windowIndex)) 4320 popupControl.TryAutoUpdatePosition(popupWindow.windowIndex); 4321 } 4322 }, 4323 IsDocumentIsCoveredByModalElement: function () { 4324 for (var i = 0; i < this.visiblePopupWindowIds.length; i++) { 4325 var popupWindow = this.GetPopupWindowFromID(this.visiblePopupWindowIds[i]); 4326 var popupControl = popupWindow.popupControl; 4327 if (popupControl && popupControl.GetWindowModalElement(popupWindow.windowIndex)) 4328 return true; 4329 } 4330 return false; 4331 }, 4332 LockWindowResizeByBodyScrollVisibilityChanging: function () { 4333 this.windowResizeByBodyScrollVisibilityChangingLockCount++; 4334 }, 4335 UnlockWindowResizeByBodyScrollVisibilityChanging: function () { 4336 this.windowResizeByBodyScrollVisibilityChangingLockCount--; 4337 }, 4338 WindowResizeByBodyScrollVisibilityChangingLocked: function () { 4339 return this.windowResizeByBodyScrollVisibilityChangingLockCount > 0; 4340 }, 4341 HideAllWindows: function () { 4342 this.DoHideAllWindows(null, "", true); 4343 } 4344}); 4345var __aspxPopupControlCollection = null; 4346function aspxGetPopupControlCollection() { 4347 if (__aspxPopupControlCollection == null) 4348 __aspxPopupControlCollection = new ASPxClientPopupControlCollection(); 4349 return __aspxPopupControlCollection; 4350}
4351ASPxClientPopupWindow = _aspxCreateClass(null, { 4352 constructor: function (popupControl, index, name) { 4353 this.popupControl = popupControl; 4354 this.index = index; 4355 this.name = name; 4356 }, 4357 GetHeaderImageUrl: function () { 4358 return this.popupControl.GetWindowHeaderImageUrl(this.index); 4359 }, 4360 SetHeaderImageUrl: function (value) { 4361 this.popupControl.SetWindowHeaderImageUrl(this.index, value); 4362 }, 4363 GetFooterImageUrl: function () { 4364 return this.popupControl.GetWindowFooterImageUrl(this.index); 4365 }, 4366 SetFooterImageUrl: function (value) { 4367 this.popupControl.SetWindowFooterImageUrl(this.index, value); 4368 }, 4369 GetHeaderNavigateUrl: function () { 4370 return this.popupControl.GetWindowHeaderNavigateUrl(this.index); 4371 }, 4372 SetHeaderNavigateUrl: function (value) { 4373 this.popupControl.SetWindowHeaderNavigateUrl(this.index, value); 4374 }, 4375 GetFooterNavigateUrl: function () { 4376 return this.popupControl.GetWindowFooterNavigateUrl(this.index); 4377 }, 4378 SetFooterNavigateUrl: function (value) { 4379 this.popupControl.SetWindowFooterNavigateUrl(this.index, value); 4380 }, 4381 GetHeaderText: function () { 4382 return this.popupControl.GetWindowHeaderText(this.index); 4383 }, 4384 SetHeaderText: function (value) { 4385 this.popupControl.SetWindowHeaderText(this.index, value); 4386 }, 4387 GetFooterText: function () { 4388 return this.popupControl.GetWindowFooterText(this.index); 4389 }, 4390 SetFooterText: function (value) { 4391 this.popupControl.SetWindowFooterText(this.index, value); 4392 } 4393}); 4394ASPxClientPopupWindowEventArgs = _aspxCreateClass(ASPxClientEventArgs, { 4395 constructor: function (window) { 4396 this.constructor.prototype.constructor.call(this); 4397 this.window = window; 4398 } 4399}); 4400ASPxClientPopupWindowCancelEventArgs = _aspxCreateClass(ASPxClientCancelEventArgs, { 4401 constructor: function (window) { 4402 this.constructor.prototype.constructor.call(this); 4403 this.window = window; 4404 } 4405}); 4406ASPxClientPopupWindowResizeEventArgs = _aspxCreateClass(ASPxClientPopupWindowEventArgs, { 4407 constructor: function (window, resizeState) { 4408 this.constructor.prototype.constructor.call(this, window); 4409 this.resizeState = resizeState; 4410 } 4411}); 4412ASPxClientPopupWindowPinnedChangedEventArgs = _aspxCreateClass(ASPxClientPopupWindowEventArgs, { 4413 constructor: function (window, pinned) { 4414 this.constructor.prototype.constructor.call(this, window); 4415 this.pinned = pinned; 4416 } 4417}); 4418function _aspxPopupWindow(popupControl, windowIndex) { 4419 this.popupControl = popupControl; 4420 this.windowIndex = windowIndex; 4421} 4422function _aspxScrollDifference(horizontal, vertical) { 4423 this.horizontal = horizontal; 4424 this.vertical = vertical; 4425} 4426function aspxPWDisappearTimer(name, index) { 4427 aspxGetPopupControlCollection().OnPWDisappearTimer(name, index); 4428} 4429function aspxPWHMDown(evt) { 4430 return _aspxCancelBubble(evt); 4431} 4432function aspxPWCBClick(evt, name, index) { 4433 var pc = aspxGetPopupControlCollection().Get(name); 4434 if (pc != null) pc.OnPWHBClickCore(evt, index, "OnCloseButtonClick"); 4435} 4436function aspxPWPBClick(evt, name, index) { 4437 var pc = aspxGetPopupControlCollection().Get(name); 4438 if (pc != null) pc.OnPWHBClickCore(evt, index, "OnPinButtonClick"); 4439} 4440function aspxPWRBClick(evt, name, index) { 4441 var pc = aspxGetPopupControlCollection().Get(name); 4442 if (pc != null) pc.OnPWHBClickCore(evt, index, "OnRefreshButtonClick"); 4443} 4444function aspxPWMNBClick(evt, name, index) { 4445 var pc = aspxGetPopupControlCollection().Get(name); 4446 if (pc != null) pc.OnPWHBClickCore(evt, index, "OnCollapseButtonClick"); 4447} 4448function aspxPWMXBClick(evt, name, index) { 4449 var pc = aspxGetPopupControlCollection().Get(name); 4450 if (pc != null) pc.OnPWHBClickCore(evt, index, "OnMaximizeButtonClick"); 4451} 4452function aspxPWEMOver(evt) { 4453 aspxGetPopupControlCollection().OnPWMouseOver(evt); 4454} 4455function aspxPWMEMDown(evt) { 4456 var internalScrollableModalDiv = __aspxAndroidDefaultBrowser ? _aspxGetEventSource(evt) : null; 4457 var modalDiv = internalScrollableModalDiv ? internalScrollableModalDiv.parentNode : _aspxGetEventSource(evt); 4458 if (modalDiv != null) 4459 modalDiv.DXModalPopupControl.OnMouseDownModalElement(evt, modalDiv.DXModalPopupWindowIndex); 4460} 4461function aspxPEMEvent(evt) { 4462 var element = ASPxClientPopupUtils.FindEventSourceParentByTestFunc(evt, aspxTestPopupControlElement); 4463 if(element != null) { 4464 var popupControl = element.DXPopupElementControl; 4465 var index = element.DXPopupWindowIndex; 4466 if(evt.type == "mousedown") { 4467 popupControl.SetIsPopuped(index, popupControl.InternalIsWindowVisible(index)); 4468 aspxGetPopupControlCollection().OnMouseDown(evt); 4469 } 4470 else { 4471 var windowPopupAction = popupControl.GetWindowPopupAction(element.DXPopupWindowIndex); 4472 var leftMouseButtonAction = windowPopupAction == "LeftMouseClick" && _aspxGetIsLeftButtonPressed(evt); 4473 var rightMouseButtonAction = windowPopupAction == "RightMouseClick" && !_aspxGetIsLeftButtonPressed(evt); 4474 if (leftMouseButtonAction || rightMouseButtonAction) { 4475 if (rightMouseButtonAction) 4476 ASPxClientPopupUtils.PreventContextMenu(evt);
4477 var windowCloseAction = popupControl.GetWindowCloseAction(index); 4478 var isPopuped = popupControl.GetIsPopuped(index); 4479 var isNewPopupElement = popupControl.GetLastShownPopupElementIndex(index) != element.DXPopupElementIndex; 4480 if(isPopuped && isNewPopupElement) { 4481 popupControl.DoHideWindow(index); 4482 aspxGetPopupControlCollection().ClearDisappearTimer(); 4483 isPopuped = false; 4484 } 4485 if(!(isPopuped && windowCloseAction == "OuterMouseClick")) { 4486 popupControl.DoShowWindow(index, element.DXPopupElementIndex, evt); 4487 } 4488 if(windowCloseAction == "MouseOut") 4489 aspxGetPopupControlCollection().InitOverObject(popupControl, element.DXPopupWindowIndex, evt); 4490 return false; 4491 } 4492 } 4493 } 4494} 4495function aspxPWDGMDown(evt, name, index) { 4496 return aspxPWMDown(evt, name, index, true); 4497} 4498function aspxPWGripMDown(evt, name, index) { 4499 aspxPWMDownCore(evt, name, index, false); 4500 return aspxPWHMDown(evt); 4501} 4502function aspxPointOnElementScrollBar(element, x, y, rtl) { 4503 var scrollWidth = _aspxGetVerticalScrollBarWidth(); 4504 var hasHorizontalScroll = element.scrollWidth > element.clientWidth; 4505 var hasVerticalScroll = element.scrollHeight > element.clientHeight; 4506 var ceilX = rtl ? _aspxGetAbsoluteX(element) + scrollWidth : 4507 _aspxGetAbsoluteX(element) + (element.offsetWidth - _aspxGetHorizontalBordersWidth(element)); 4508 var ceilY = _aspxGetAbsoluteY(element) + (element.offsetHeight - _aspxGetVerticalBordersWidth(element)); 4509 return (hasVerticalScroll && x >= ceilX - scrollWidth && x <= ceilX) || 4510 (hasHorizontalScroll && y >= ceilY - scrollWidth && y <= ceilY); 4511} 4512function aspxPWMDown(evt, name, index, isWindowContentDraggingAllowed) { 4513 var pointOnScrollBar = false; 4514 var pc = aspxGetPopupControlCollection().Get(name); 4515 if(pc && pc.enableContentScrolling) { 4516 var rtl = pc.rtl && (__aspxIE || __aspxFirefox || __aspxOpera); 4517 pointOnScrollBar = aspxPointOnElementScrollBar(pc.GetContentContainer(index), evt.clientX, evt.clientY, rtl); 4518 } 4519 aspxPWMDownCore(evt, name, index, isWindowContentDraggingAllowed, pointOnScrollBar); 4520 if (isWindowContentDraggingAllowed) { 4521 aspxGetPopupControlCollection().OnDocumentMouseDown(evt); 4522 if (typeof (aspxGetDropDownCollection) == "function") 4523 aspxGetDropDownCollection().OnDocumentMouseDown(evt); 4524 if(!pointOnScrollBar) { 4525 if(!__aspxWebKitTouchUI && _aspxGetEventSource(evt).tagName == "IMG") 4526 _aspxPreventEvent(evt); 4527 } 4528 } 4529} 4530function aspxPWMDownCore(evt, name, index, isDraggingAllowed, pointOnScrollBar) { 4531 var pc = aspxGetPopupControlCollection().Get(name); 4532 if (pc != null) { 4533 pc.OnActivateMouseDown(evt, index); 4534 pc.OnMouseDown(evt, index, isDraggingAllowed, pointOnScrollBar); 4535 } 4536} 4537function aspxPWMMove(evt, name, index) { 4538 aspxGetPopupControlCollection().OnPWMouseMove(evt, name, index); 4539} 4540function aspxPCAStop(name, index) { 4541 var pc = aspxGetPopupControlCollection().Get(name); 4542 if (pc != null) pc.OnAnimationStop(index); 4543} 4544function aspxPCIframeLoad(evt) { 4545 var srcElement = _aspxGetEventSource(evt); 4546 if (srcElement) { 4547 var pcName = srcElement.popupControlName; 4548 var pcWndIndex = srcElement.pcWndIndex; 4549 if (pcName) { 4550 var pc = aspxGetPopupControlCollection().Get(pcName); 4551 pc.OnIFrameLoad(pcWndIndex); 4552 } 4553 } 4554} 4555_aspxAttachEventToDocument(ASPxClientTouchUI.touchMouseDownEventName, aspxPopupControlDocumentMouseDown); 4556function aspxPopupControlDocumentMouseDown(evt) { 4557 aspxGetPopupControlCollection().OnDocumentMouseDown(evt); 4558} 4559_aspxAttachEventToDocument(ASPxClientTouchUI.touchMouseUpEventName, aspxPopupControlDocumentMouseUp); 4560function aspxPopupControlDocumentMouseUp(evt) { 4561 return aspxGetPopupControlCollection().OnMouseUp(evt); 4562} 4563_aspxAttachEventToDocument(ASPxClientTouchUI.touchMouseMoveEventName, aspxPopupControlDocumentMouseMove); 4564function aspxPopupControlDocumentMouseMove(evt) { 4565 if (typeof (aspxGetPopupControlCollection) != "undefined") 4566 aspxGetPopupControlCollection().OnMouseMove(evt); 4567} 4568_aspxAttachEventToDocument("mouseout", aspxPopupControlDocumentMouseOut); 4569function aspxPopupControlDocumentMouseOut(evt) { 4570 if (typeof (aspxGetPopupControlCollection) != "undefined") 4571 aspxGetPopupControlCollection().OnMouseOut(evt); 4572} 4573_aspxAttachEventToElement(window, "resize", aspxPopupControlWindowResize); 4574function aspxPopupControlWindowResize(evt) { 4575 aspxGetPopupControlCollection().OnResize(evt); 4576} 4577_aspxAttachEventToElement(window, "scroll", aspxPopupControlWindowScroll); 4578function aspxPopupControlWindowScroll(evt) { 4579 aspxGetPopupControlCollection().OnScroll(evt); 4580} 4581_aspxAttachEventToDocument("selectstart", aspxPopupControlDocumentSelectStart); 4582function aspxPopupControlDocumentSelectStart(evt) { 4583 var ret = aspxGetPopupControlCollection().OnSelectStart(evt); 4584 if (!ret) return false; 4585} 4586function aspxTestPopupWindowElement(element) { 4587 return !!element.DXPopupWindowElement; 4588} 4589function aspxTestPopupControlElement(element) { 4590 return element.DXPopupElementControl && _aspxIsExists(element.DXPopupWindowIndex); 4591} 4592function aspxTestPopupControlOverElement(element) { 4593 var collection = aspxGetPopupControlCollection(); 4594 var popupControl = collection.overControl; 4595 var index = collection.overWindowIndex; 4596 var windowId = popupControl.GetWindowElementId(index);
4597 if(element.id == windowId) 4598 return true; 4599 var popupElements = popupControl.GetPopupElementList(index); 4600 for(var i = 0; i < popupElements.length; i++) 4601 if(popupElements[i] == element) 4602 return true; 4603 return false; 4604}
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.