1(function() { 2var ASPxClientButton = ASPx.CreateClass(ASPxClientControl, { 3 constructor: function(name) { 4 this.constructor.prototype.constructor.call(this, name); 5 this.isASPxClientButton = true; 6 this.allowFocus = true; 7 this.autoPostBackFunction = null; 8 this.causesValidation = true; 9 this.checked = false; 10 this.clickLocked = false; 11 this.groupName = ""; 12 this.focusElementSelected = false; 13 this.pressed = false; 14 this.useSubmitBehavior = true; 15 this.validationGroup = ""; 16 this.validationContainerID = null; 17 this.validateInvisibleEditors = false; 18 this.originalWidth = null; 19 this.originalHeight = null; 20 this.needUpdateBounds = true; 21 this.isTextEmpty = false; 22 this.isImage = false; 23 this.CheckedChanged = new ASPxClientEvent(); 24 this.GotFocus = new ASPxClientEvent(); 25 this.LostFocus = new ASPxClientEvent(); 26 this.Click = new ASPxClientEvent(); 27 }, 28 InlineInitialize: function() { 29 var mainElement = this.GetMainElement(); 30 this.originalWidth = mainElement.style.width; 31 this.originalHeight = mainElement.style.height; 32 ASPxClientControl.prototype.InlineInitialize.call(this); 33 this.InitializeElementIDs(); 34 this.InitializeEvents(); 35 this.InitializeEnabled(); 36 this.InitializeChecked(); 37 if(this.IsLink()) 38 this.InitializeLink(); 39 this.PreventButtonImageDragging(); 40 this.EnsureBoundsAdjusted(); 41 }, 42 InitializeElementIDs: function(){ 43 var mainElement = this.GetMainElement(); 44 var contentElement = ASPx.GetNodeByTagName(mainElement, "DIV", 0); 45 if(contentElement) contentElement.id = this.name + "_CD"; 46 var imageElement = ASPx.GetNodeByTagName(mainElement, "IMG", 0); 47 if(imageElement) imageElement.id = this.name + "Img"; 48 }, 49 InitializeEnabled: function(){ 50 this.SetEnabledInternal(this.clientEnabled, true); 51 }, 52 InitializeChecked: function(){ 53 this.SetCheckedInternal(this.checked, true); 54 }, 55 InitializeLink: function(){ 56 var mainElement = this.GetMainElement(); 57 if(this.enabled) 58 mainElement.href = "javascript:;"; 59 if(!this.allowFocus) 60 mainElement.style.outline = 0; 61 if(!this.isImage && !this.GetTextContainer()) 62 mainElement.style.fontSize = "0pt"; 63 }, 64 InitializeEvents: function(){ 65 if(!this.isNative && !this.IsLink()) { 66 var element = this.GetInternalButton(); 67 if(element) 68 element.onfocus = null; 69 var textControl = this.GetTextControl(); 70 if(textControl) 71 ASPx.Evt.PreventElementDragAndSelect(textControl, false); 72 } 73 this.onClick = function(evt) { 74 var processOnServer = ASPx.BClick(this.name, evt); 75 if(!processOnServer) 76 ASPx.Evt.PreventEvent(evt); 77 return processOnServer; 78 }.aspxBind(this); 79 this.onImageMoseDown = function() { var el = ASPx.GetFocusedElement(); if(el) el.blur(); }; 80 this.onGotFocus = function() { this.OnFocus(); }.aspxBind(this); 81 this.onLostFocus = function() { this.OnLostFocus(); }.aspxBind(this); 82 this.onKeyUp = function(evt) { this.OnKeyUp(evt); }.aspxBind(this); 83 this.onKeyDown = function(evt) { this.OnKeyDown(evt); }.aspxBind(this); 84 if(!this.isNative && !this.IsLink()) 85 this.InitializeNativeHandlers(); 86 }, 87 InitializeNativeHandlers: function() { 88 this.AttachNativeHandlerToMainElement("focus", "SetFocus"); 89 this.AttachNativeHandlerToMainElement("click", "DoClick"); 90 }, 91 EnsureBoundsAdjusted: function() { 92 var mainElement = this.GetMainElement(); 93 this.needUpdateBounds = ASPx.GetCurrentStyle(mainElement).display === "block"; 94 if(this.needUpdateBounds) 95 mainElement.className = mainElement.className.replace("dxbTSys", ""); 96 }, 97 AdjustControlCore: function () { 98 if(this.isNative || this.IsLink()) return; 99 var buttonImage = this.GetButtonImage(); 100 if(buttonImage && buttonImage.offsetHeight === 0 && buttonImage.offsetWidth === 0) 101 buttonImage.onload = function() { this.UpdateSize(); }.aspxBind(this); 102 else 103 this.UpdateSize(); 104 this.UpdateVerticalAlign(); 105 }, 106 UpdateSize: function() { 107 if(this.needUpdateBounds) { 108 this.UpdateWidth(); 109 this.UpdateHeight(); 110 } else 111 this.CorrectWrappedText(this.GetContentDiv, "Text", true); 112 }, 113 UpdateVerticalAlign: function() { 114 var contentElement = this.GetContentDiv(); 115 var verticalAlign = this.GetMainElement().style.verticalAlign; 116 if(ASPx.IsExistsElement(contentElement) && verticalAlign) 117 contentElement.style.verticalAlign = verticalAlign; 118 }, 119 UpdateHeight: function(){ 120 if(this.isNative || this.IsLink() || this.originalHeight === null || ASPx.IsPercentageSize(this.originalHeight)) return; 121 var height; 122 var mainElement = this.GetMainElement(); 123 var contentDiv = this.GetContentDiv(); 124 var borderAndPadding = ASPx.GetTopBottomBordersAndPaddingsSummaryValue(mainElement); 125 var contentHasExcessiveHeight = contentDiv.offsetHeight > mainElement.offsetHeight - borderAndPadding;
126 var needSetAutoHeight = !this.originalHeight || (ASPx.Browser.Safari && contentHasExcessiveHeight); 127 if(needSetAutoHeight) { 128 mainElement.style.height = ""; 129 height = mainElement.offsetHeight - borderAndPadding; 130 } 131 else 132 height = (ASPx.PxToInt(this.originalHeight) - borderAndPadding); 133 if(height){ 134 mainElement.style.height = height + "px"; 135 if(contentDiv && contentDiv.offsetHeight > 0){ 136 var contentDivCurrentStyle = ASPx.GetCurrentStyle(contentDiv); 137 var paddingTop = parseInt(contentDivCurrentStyle.paddingTop) || 0; 138 var paddingBottom = parseInt(contentDivCurrentStyle.paddingBottom) || 0; 139 var clientHeightDiff = height - contentDiv.offsetHeight; 140 var verticalAlign = ASPx.GetCurrentStyle(mainElement).verticalAlign; 141 if(verticalAlign == "top") 142 paddingBottom = paddingBottom + clientHeightDiff; 143 else if(verticalAlign == "bottom") 144 paddingTop = paddingTop + clientHeightDiff; 145 else { 146 var halfClientHeightDiff = Math.floor(clientHeightDiff / 2); 147 paddingTop = paddingTop + halfClientHeightDiff; 148 paddingBottom = paddingBottom + (clientHeightDiff - halfClientHeightDiff); 149 } 150 contentDiv.style.paddingTop = (paddingTop > 0 ? paddingTop : 0) + "px"; 151 contentDiv.style.paddingBottom = (paddingBottom > 0 ? paddingBottom : 0) + "px"; 152 } 153 } 154 }, 155 UpdateWidth: function(){ 156 if(this.isNative || this.IsLink() || this.originalWidth === null) return; 157 if(!ASPx.IsPercentageSize(this.originalWidth)) { 158 var mainElement = this.GetMainElement(); 159 var borderAndPadding = ASPx.GetLeftRightBordersAndPaddingsSummaryValue(mainElement); 160 if(this.originalWidth && ASPx.IsTextWrapped(this.GetTextContainer())) 161 mainElement.style.width = (ASPx.PxToInt(this.originalWidth) - borderAndPadding) + "px"; 162 else 163 mainElement.style.width = "auto"; 164 var width = mainElement.offsetWidth - borderAndPadding; 165 if(this.originalWidth && width < ASPx.PxToInt(this.originalWidth) - borderAndPadding) 166 width = ASPx.PxToInt(this.originalWidth) - borderAndPadding; 167 if(width) 168 mainElement.style.width = (width > 0 ? width : 0) + "px"; 169 } 170 this.CorrectWrappedText(this.GetContentDiv, "Text", true); 171 }, 172 GetAdjustedSizes: function() { 173 var sizes = ASPxClientControl.prototype.GetAdjustedSizes.call(this); 174 var image = this.GetButtonImage(); 175 if(image) { 176 sizes.imageWidth = image.offsetWidth; 177 sizes.imageHeight = image.offsetHeight; 178 } 179 return sizes; 180 }, 181 PreventButtonImageDragging: function() { 182 ASPx.Evt.PreventImageDragging(this.GetButtonImage()); 183 }, 184 AttachNativeHandlerToMainElement: function(handlerName, correspondingMethodName) { 185 var mainElement = this.GetMainElement(); 186 if(!ASPx.IsExistsElement(mainElement)) 187 return; 188 mainElement[handlerName] = function() { _aspxBCallButtonMethod(this.name, correspondingMethodName); }.aspxBind(this); 189 }, 190 GetContentDiv: function(){ 191 return this.GetChildElement("CD"); 192 }, 193 GetButtonImage: function(){ 194 return ASPx.CacheHelper.GetCachedElement(this, "buttonImage", 195 function() { 196 return ASPx.GetNodeByTagName(this.GetMainElement(), "IMG", 0); 197 }); 198 }, 199 GetInternalButton: function() { 200 return ASPx.CacheHelper.GetCachedElement(this, "internalButton", 201 function() { 202 return this.isNative || this.IsLink() ? this.GetMainElement() : ASPx.GetNodeByTagName(this.GetMainElement(), "INPUT", 0); 203 }); 204 }, 205 GetTextContainer: function() { 206 return ASPx.CacheHelper.GetCachedElement(this, "textContainer", 207 function() { 208 if(this.isNative) 209 return this.GetMainElement(); 210 else{ 211 var textElement = this.IsLink() ? this.GetMainElement() : this.GetContentDiv(); 212 return this.accessibilityCompliant ? ASPx.GetElementById(this.name + "_BTC") : ASPx.GetNodeByTagName(textElement, "SPAN", 0); 213 } 214 }); 215 }, 216 GetTextControl: function(){ 217 return ASPx.CacheHelper.GetCachedElement(this, "textControl", 218 function() { 219 var element = ASPx.GetParentByTagName(this.GetContentDiv(), "DIV");
220 if(!ASPx.IsExistsElement(element) || (element.id == this.name)) 221 element = this.GetContentDiv(); 222 return element; 223 }); 224 }, 225 IsLink: function(){ 226 if (this.GetMainElement()) 227 return this.GetMainElement().tagName === "A"; 228 return false; 229 }, 230 IsHovered: function(){ 231 var hoverElement = this.GetMainElement(); 232 return ASPx.GetStateController().currentHoverItemName == hoverElement.id; 233 }, 234 SetEnabledInternal: function(enabled, initialization) { 235 if(!this.enabled) 236 return; 237 if(!initialization || !enabled) 238 this.ChangeEnabledStateItems(enabled); 239 this.ChangeEnabledAttributes(enabled); 240 }, 241 ChangeEnabledAttributes: function(enabled) { 242 var element = this.GetInternalButton(); 243 if(element) { 244 if(this.IsLink()){ 245 var method = ASPx.Attr.ChangeAttributesMethod(enabled); 246 var link = this.GetMainElement(); 247 method(link, "href"); 248 if(this.accessibilityCompliant) 249 ASPx.Attr.SetOrRemoveAttribute(link, ASPx.Attr.GetTabIndexAttributeName(), enabled ? null : "0"); 250 } else { 251 if(this.accessibilityCompliant) 252 ASPx.Attr.Aria.SetOrRemoveDisabled(element, !enabled); 253 else 254 element.disabled = !enabled; 255 } 256 } 257 this.ChangeEnabledEventsAttributes(ASPx.Attr.ChangeEventsMethod(enabled)); 258 var isFocusable = enabled || this.accessibilityCompliant; 259 this.ChangeEnabledFocusEvents(ASPx.Attr.ChangeEventsMethod(isFocusable)); 260 }, 261 ChangeEnabledEventsAttributes: function(method) { 262 var element = this.GetMainElement(); 263 method(element, "click", this.onClick); 264 if(this.allowFocus){ 265 if(!this.isNative && !this.IsLink()) { 266 element = this.GetInternalButton(); 267 if(element) { 268 method(element, "keyup", this.onKeyUp); 269 method(element, "blur", this.onKeyUp); 270 method(element, "keydown", this.onKeyDown); 271 } 272 } 273 if(ASPx.Browser.Firefox){ 274 var image = this.GetButtonImage(); 275 if(image) 276 method(image, "mousedown", this.onImageMoseDown); 277 } 278 } 279 }, 280 ChangeEnabledFocusEvents: function(method) { 281 if(!this.allowFocus) 282 return; 283 var element = !this.isNative && !this.IsLink() ? this.GetInternalButton() : this.GetMainElement(); 284 if(element) { 285 method(element, "focus", this.onGotFocus); 286 method(element, "blur", this.onLostFocus); 287 } 288 }, 289 ChangeEnabledStateItems: function(enabled){ 290 if(this.isNative) return; 291 ASPx.GetStateController().SetElementEnabled(this.GetMainElement(), enabled); 292 this.UpdateFocusedStyle(); 293 }, 294 RequiredPreventDoublePostback: function(){ 295 return ASPx.Browser.Firefox && !this.isNative; 296 }, 297 OnFocus: function() { 298 if(!this.allowFocus) 299 return false; 300 this.focused = true; 301 if(this.isInitialized) 302 this.RaiseFocus(); 303 this.UpdateFocusedStyle(); 304 }, 305 OnLostFocus: function() { 306 if(!this.allowFocus) 307 return false; 308 this.focused = false; 309 if(this.isInitialized) 310 this.RaiseLostFocus(); 311 this.UpdateFocusedStyle(); 312 }, 313 CauseValidation: function() { 314 if(this.causesValidation && ASPx.Ident.scripts.ASPxClientEdit) 315 return this.validationContainerID != null ? 316 ASPxClientEdit.ValidateEditorsInContainerById(this.validationContainerID, this.validationGroup, this.validateInvisibleEditors) : 317 ASPxClientEdit.ValidateGroup(this.validationGroup, this.validateInvisibleEditors); 318 else 319 return true; 320 }, 321 OnClick: function(evt) { 322 if(this.clickLocked) return true; 323 if(this.checked && this.groupName != "" && this.GetCheckedGroupList().length > 1) return; 324 this.SetFocus(); 325 var isValid = this.CauseValidation(); 326 var processOnServer = this.autoPostBack; 327 if(this.groupName != "") { 328 if(this.GetCheckedGroupList().length == 1) 329 this.SetCheckedInternal(!this.checked, false); 330 else { 331 this.SetCheckedInternal(true, false); 332 this.ClearButtonGroupChecked(true); 333 } 334 processOnServer = this.RaiseCheckedChanged(); 335 if(processOnServer && isValid) 336 this.SendPostBack("CheckedChanged"); 337 } 338 var params = this.RaiseClick(); 339 if(evt && params.cancelEventAndBubble) 340 ASPx.Evt.PreventEventAndBubble(evt); 341 if(params.processOnServer && isValid) 342 return this.ProcessClick(); 343 return false; 344 }, 345 ProcessClick: function() { 346 var requiredPreventDoublePostback = this.RequiredPreventDoublePostback(); 347 var postponePostback = ASPx.Browser.AndroidMobilePlatform; 348 if(requiredPreventDoublePostback || postponePostback) 349 window.setTimeout(function() { _aspxBCallButtonMethod(this.name, "SendPostBack", "Click"); }.aspxBind(this), 0); 350 else 351 this.SendPostBack("Click"); 352 return !requiredPreventDoublePostback; 353 }, 354 OnKeyUp: function(evt) { 355 if(!this.pressed) 356 return; 357 this.pressed = false; 358 ASPx.GetStateController().OnKeyUpOnElement(evt); 359 }, 360 OnKeyDown: function(evt) { 361 if(evt.keyCode == ASPx.Key.Enter || evt.keyCode == ASPx.Key.Space) 362 this.SetPressed(); 363 }, 364 GetCheckedGroupList: function(){ 365 var result = [ ]; 366 ASPx.GetControlCollection().ForEachControl(function(control) { 367 if(ASPx.Ident.IsASPxClientButton(control) && (control.groupName == this.groupName) && !control.IsDOMDisposed()) 368 result.push(control); 369 }, this); 370 return result; 371 }, 372 ClearButtonGroupChecked: function(raiseCheckedChanged){ 373 var list = this.GetCheckedGroupList(); 374 for(var i = 0; i < list.length; i ++){ 375 if(list[i] != this && list[i].checked) { 376 list[i].SetCheckedInternal(false, false); 377 if(raiseCheckedChanged) 378 list[i].RaiseCheckedChanged(); 379 } 380 } 381 }, 382 ApplyCheckedStyle: function(){ 383 var stateController = ASPx.GetStateController(); 384 if(this.IsHovered()) 385 stateController.SetCurrentHoverElement(null); 386 stateController.SelectElementBySrcElement(this.GetMainElement()); 387 }, 388 ApplyUncheckedStyle: function(){ 389 var stateController = ASPx.GetStateController(); 390 if(this.IsHovered()) 391 stateController.SetCurrentHoverElement(null); 392 stateController.DeselectElementBySrcElement(this.GetMainElement()); 393 }, 394 SetCheckedInternal: function(checked, initialization){ 395 if(initialization && checked || (this.checked != checked)){ 396 this.checked = checked; 397 if(checked)
398 this.ApplyCheckedStyle(); 399 else 400 this.ApplyUncheckedStyle(); 401 } 402 }, 403 UpdateStateObject: function(){ 404 if(this.groupName != "") 405 this.UpdateStateObjectWithObject({ checked: this.checked }); 406 }, 407 GetStateHiddenFieldName: function() { 408 return this.uniqueID + "$State"; 409 }, 410 ApplyPressedStyle: function(){ 411 ASPx.GetStateController().OnMouseDownOnElement(this.GetMainElement()); 412 }, 413 ApplyUnpressedStyle: function(){ 414 ASPx.GetStateController().OnMouseUpOnElement(this.GetMainElement()); 415 }, 416 SetPressed: function(){ 417 this.pressed = true; 418 this.ApplyPressedStyle(); 419 }, 420 SetUnpressed: function(){ 421 this.pressed = false; 422 this.ApplyUnpressedStyle(); 423 }, 424 SetFocus: function(){ 425 if(!this.allowFocus || this.focused) 426 return; 427 var element = this.GetInternalButton(); 428 if(element) { 429 var hiddenInternalButtonRequiresVisibilityToGetFocused = ASPx.Browser.WebKitFamily && !this.isNative && !this.IsLink(); 430 if(hiddenInternalButtonRequiresVisibilityToGetFocused) 431 ASPxClientButton.MakeHiddenElementFocusable(element); 432 if(ASPx.IsFocusable(element) && ASPx.GetActiveElement() != element) 433 element.focus(); 434 if(hiddenInternalButtonRequiresVisibilityToGetFocused) 435 ASPxClientButton.RestoreHiddenElementAppearance(element); 436 } 437 }, 438 ApplyFocusedStyle: function(){ 439 if(this.focusElementSelected) return; 440 if(typeof(ASPx.GetStateController) != "undefined") 441 ASPx.GetStateController().SelectElementBySrcElement(this.GetContentDiv()); 442 this.focusElementSelected = true; 443 }, 444 ApplyUnfocusedStyle: function(){ 445 if(!this.focusElementSelected) return; 446 if(typeof(ASPx.GetStateController) != "undefined") 447 ASPx.GetStateController().DeselectElementBySrcElement(this.GetContentDiv()); 448 this.focusElementSelected = false; 449 }, 450 UpdateFocusedStyle: function(){ 451 if(this.isNative || this.IsLink()) return; 452 var isFocusable = this.enabled && this.allowFocus && this.focused && (this.clientEnabled || this.accessibilityCompliant); 453 if(isFocusable) 454 this.ApplyFocusedStyle(); 455 else 456 this.ApplyUnfocusedStyle(); 457 }, 458 SendPostBack: function(postBackArg){ 459 if(!this.enabled || !this.clientEnabled) 460 return; 461 var arg = postBackArg || ""; 462 if(this.autoPostBackFunction) 463 this.autoPostBackFunction(arg); 464 else if(!this.useSubmitBehavior || this.IsLink()) 465 ASPxClientControl.prototype.SendPostBack.call(this, arg); 466 if(this.useSubmitBehavior && !this.isNative) 467 this.ClickInternalButton(); 468 }, 469 ClickInternalButton: function(){ 470 var element = this.GetInternalButton(); 471 if(element) { 472 this.clickLocked = true; 473 if(ASPx.Browser.NetscapeFamily) 474 this.CreateUniqueIDCarrier(); 475 var postHandler = ASPx.GetPostHandler(); 476 postHandler.SetLastSubmitElementName(element.name); 477 ASPx.Evt.DoElementClick(element); 478 postHandler.SetLastSubmitElementName(null); 479 if(ASPx.Browser.NetscapeFamily) 480 this.RemoveUniqueIDCarrier(); 481 this.clickLocked = false; 482 } 483 }, 484 CreateUniqueIDCarrier: function() { 485 var name = this.uniqueID; 486 var id = this.GetUniqueIDCarrierID(); 487 var field = ASPx.CreateHiddenField(name, id);
488 var form = this.GetParentForm(); 489 if(form) form.appendChild(field); 490 }, 491 RemoveUniqueIDCarrier: function() { 492 var field = document.getElementById(this.GetUniqueIDCarrierID()); 493 if(field) 494 field.parentNode.removeChild(field); 495 }, 496 GetUniqueIDCarrierID: function() { 497 return this.uniqueID + "_UIDC"; 498 }, 499 DoClick: function(){ 500 if(!this.enabled || !this.clientEnabled) 501 return; 502 var button = (this.isNative || this.IsLink()) ? this.GetMainElement() : this.GetInternalButton(); 503 if(button) 504 ASPx.Evt.DoElementClick(button); 505 else 506 this.OnClick(); 507 }, 508 GetChecked: function(){ 509 return this.checked; 510 }, 511 SetChecked: function(checked){ 512 this.SetCheckedInternal(checked, false); 513 this.ClearButtonGroupChecked(false); 514 }, 515 GetText: function(){ 516 if(!this.isTextEmpty) 517 return this.isNative ? this.GetTextContainer().value : this.GetTextContainer().innerHTML; 518 return ""; 519 }, 520 SetText: function(text){ 521 this.isTextEmpty = (text == null || text == ""); 522 var textContainer = this.GetTextContainer(); 523 if(textContainer){ 524 if(this.isNative) 525 textContainer.value = (text != null) ? text : ""; 526 else { 527 var value = this.isTextEmpty ? " " : text; 528 textContainer.innerHTML = value; 529 var element = this.GetInternalButton(); 530 if(element) 531 element.value = value; 532 } 533 this.UpdateSize(); 534 } 535 }, 536 GetImageUrl: function(){ 537 var img = this.GetButtonImage(); 538 return img ? img.src : ""; 539 }, 540 SetImageUrl: function(url){ 541 var img = this.GetButtonImage(); 542 if(img) { 543 img.src = url; 544 this.UpdateSize(); 545 } 546 }, 547 SetEnabled: function(enabled){ 548 if(this.clientEnabled != enabled) { 549 if(!enabled && this.focused) 550 this.OnLostFocus(); 551 this.clientEnabled = enabled; 552 this.SetEnabledInternal(enabled, false); 553 } 554 }, 555 GetEnabled: function(){ 556 return this.enabled && this.clientEnabled; 557 }, 558 Focus: function(){ 559 this.SetFocus(); 560 }, 561 RaiseCheckedChanged: function(){ 562 var processOnServer = this.autoPostBack || this.IsServerEventAssigned("CheckedChanged"); 563 if(!this.CheckedChanged.IsEmpty()){ 564 var args = new ASPxClientProcessingModeEventArgs(processOnServer); 565 this.CheckedChanged.FireEvent(this, args); 566 processOnServer = args.processOnServer; 567 } 568 return processOnServer; 569 }, 570 RaiseFocus: function(){ 571 if(!this.GotFocus.IsEmpty()){ 572 var args = new ASPxClientEventArgs(); 573 this.GotFocus.FireEvent(this, args); 574 } 575 }, 576 RaiseLostFocus: function(){ 577 if(!this.LostFocus.IsEmpty()){ 578 var args = new ASPxClientEventArgs(); 579 this.LostFocus.FireEvent(this, args); 580 } 581 }, 582 RaiseClick: function() { 583 var processOnServer = this.autoPostBack || this.IsServerEventAssigned("Click"); 584 var cancelEventAndBubble = false; 585 if(!this.Click.IsEmpty()) { 586 var args = new ASPxClientButtonClickEventArgs(processOnServer, cancelEventAndBubble); 587 this.Click.FireEvent(this, args); 588 cancelEventAndBubble = args.cancelEventAndBubble; 589 processOnServer = args.processOnServer; 590 } 591 return { 592 processOnServer: processOnServer, 593 cancelEventAndBubble: cancelEventAndBubble 594 }; 595 } 596}); 597ASPxClientButton.Cast = ASPxClientControl.Cast; 598var ASPxClientButtonClickEventArgs = ASPx.CreateClass(ASPxClientProcessingModeEventArgs, { 599 constructor: function(processOnServer, cancelEventAndBubble) { 600 this.constructor.prototype.constructor.call(this, processOnServer); 601 this.cancelEventAndBubble = cancelEventAndBubble; 602 } 603}); 604ASPxClientButton.MakeHiddenElementFocusable = function(element) { 605 element.__dxHiddenElementState = { 606 parentDisplay: element.parentNode.style.display, 607 height: element.style.height, 608 width: element.style.width 609 }; 610 element.parentNode.style.display = "block"; 611 element.style.height = "1px"; 612 element.style.width = "1px"; 613}; 614ASPxClientButton.RestoreHiddenElementAppearance = function(element) { 615 var state = element.__dxHiddenElementState; 616 element.parentNode.style.display = state.parentDisplay; 617 element.style.height = state.height; 618 element.style.width = state.width; 619 delete element.__dxHiddenElementState; 620}; 621ASPx.Ident.IsASPxClientButton = function(obj) { 622 return !!obj.isASPxClientButton; 623};
624function _aspxBCallButtonMethod(name, methodName, arg) { 625 var button = ASPx.GetControlCollection().Get(name); 626 if(button != null) 627 button[methodName](arg); 628} 629ASPx.BClick = function(name, evt) { 630 var button = ASPx.GetControlCollection().Get(name); 631 if(button != null) 632 return button.OnClick(evt); 633}; 634window.ASPxClientButton = ASPxClientButton; 635})(); 636
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.