1var wwp_currentDDO = null; 2function DVelop_WorkWithPlusUtilities() { 3 this.Width; 4 this.Height; 5 this.EnableAutoUpdateFromDocumentTitle; 6 this.EnableFixObjectFitCover; 7 this.EnableFloatingLabels; 8 this.EnableConvertComboToBootstrapSelect; 9 this.EnableUpdateRowSelectionStatus; 10 this.AutoUpdateFromDocumentTitle_Enabled; 11 this.CurrentTab_ReturnUrl; 12 13 this.show = function () { 14 if (!this.initialized) { 15 this.initialized = true; 16 17 wwp.settings.columnsSelector.AllowColumnResizing = this.AllowColumnResizing; 18 wwp.settings.columnsSelector.AllowColumnReordering = this.AllowColumnReordering; 19 wwp.settings.columnsSelector.AllowColumnDragging = this.AllowColumnDragging; 20 wwp.settings.columnsSelector.AllowColumnsRestore = this.AllowColumnsRestore; 21 wwp.settings.columnsSelector.InfiniteScrolling = (this.ComboLoadType == 'InfiniteScrolling'); 22 wwp.settings.columnsSelector.InfiniteScrollingPage = this.InfiniteScrollingPage; 23 wwp.settings.columnsSelector.RestoreColumnsIconClass = this.RestoreColumnsIconClass; 24 25 wwp.settings.pagBar.IncludeGoTo = this.PagBarIncludeGoTo; 26 27 wwp.labels.UpdateButtonText = this.UpdateButtonText; 28 wwp.labels.AddNewOption = this.AddNewOption; 29 wwp.labels.OnlySelectedValues = this.OnlySelectedValues; 30 wwp.labels.MultipleValuesSeparator = this.MultipleValuesSeparator; 31 wwp.labels.SelectAll = this.SelectAll; 32 wwp.labels.SortASC = this.SortASC; 33 wwp.labels.SortDSC = this.SortDSC; 34 wwp.labels.AllowGroupText = this.AllowGroupText; 35 wwp.labels.FixLeftText = this.FixLeftText; 36 wwp.labels.FixRightText = this.FixRightText; 37 wwp.labels.LoadingData = this.LoadingData; 38 wwp.labels.CleanFilter = this.CleanFilter; 39 wwp.labels.RangeFilterFrom = this.RangeFilterFrom; 40 wwp.labels.RangeFilterTo = this.RangeFilterTo; 41 wwp.labels.RangePickerInviteMessage = this.RangePickerInviteMessage; 42 wwp.labels.NoResultsFound = this.NoResultsFound; 43 wwp.labels.SearchButtonText = this.SearchButtonText; 44 wwp.labels.SearchMultipleValuesButtonText = this.SearchMultipleValuesButtonText; 45 46 wwp.labels.ColumnSelectorFixedLeftCategory = this.ColumnSelectorFixedLeftCategory; 47 wwp.labels.ColumnSelectorFixedRightCategory = this.ColumnSelectorFixedRightCategory; 48 wwp.labels.ColumnSelectorNotFixedCategory = this.ColumnSelectorNotFixedCategory; 49 wwp.labels.ColumnSelectorNoCategoryText = this.ColumnSelectorNoCategoryText; 50 wwp.labels.ColumnSelectorFixedEmpty = this.ColumnSelectorFixedEmpty; 51 wwp.labels.ColumnSelectorRestoreTooltip = this.ColumnSelectorRestoreTooltip; 52 53 wwp.labels.PagBarGoToCaption = this.PagBarGoToCaption; 54 wwp.labels.PagBarGoToIconClass = this.PagBarGoToIconClass; 55 wwp.labels.PagBarGoToTooltip = this.PagBarGoToTooltip; 56 57 gx.fx.obs.addObserver("gx.onafterevent", window, function (thisC) { 58 return function (e) { 59 SetMinWidthTotalizers(); 60 if (thisC.EnableUpdateRowSelectionStatus) { 61 thisC.UpdateRowSelectedStatus(true); 62 } 63 if (thisC.EnableFloatingLabels) { 64 thisC.FloatingLabels(); 65 } 66 if (thisC.EmpowerTabs) { 67 thisC.ExecEmpowerTabs(); 68 } 69 if (thisC.EnableFixObjectFitCover && WWP_IsIE()) { 70 thisC.FixObjectFitCover(); 71 } 72 if (thisC.EnableConvertComboToBootstrapSelect) { 73 if (wwp_currentDDO != null) { 74 ApplyBootstrapSelect_resetSelection(wwp_currentDDO.ddoControl, wwp_currentDDO.target); 75 wwp_currentDDO = null; 76 } 77 ApplyBootstrapSelect(); 78 } 79 if (thisC.IncludeLineSeparator) { 80 HideInvisibleRowsWithLineSeparator(); 81 } 82 thisC.PorcessDetailWCs(); 83 FixCheckboxDoubleClick(); 84 } 85 }(this)); 86 87 var thisC = this; 88 $.each(['grid.onafterrender', 'gx.endprocessing', 'grid.onafterrefresh'], function (i, gxEventName) { 89 gx.fx.obs.addObserver(gxEventName, window, function (thisC) { 90 return function (e) { 91 if (thisC.EnableConvertComboToBootstrapSelect) { 92 ApplyBootstrapSelect(); 93 } 94 thisC.PorcessDetailWCs(); 95 FixCheckboxDoubleClick(); 96 } 97 }(thisC)); 98 }); 99 100 gx.fx.obs.addObserver("gx.onload", window, function (thisC) { 101 return function (e) { 102 SetMinWidthTotalizers(); 103 if (thisC.EnableFloatingLabels) { 104 thisC.FloatingLabels(); 105 } 106 if (thisC.EmpowerTabs) { 107 thisC.ExecEmpowerTabs();
108 } 109 if (thisC.EnableFixObjectFitCover && WWP_IsIE()) { 110 thisC.FixObjectFitCover(); 111 } 112 if (thisC.EnableConvertComboToBootstrapSelect) { 113 ApplyBootstrapSelect(); 114 } 115 if (thisC.IncludeLineSeparator) { 116 HideInvisibleRowsWithLineSeparator(); 117 } 118 thisC.PorcessDetailWCs(); 119 } 120 }(this)); 121 122 gx.fx.obs.addObserver("gx.onunload", window, function (thisC) { 123 return function (e) { 124 thisC.initialized = false; 125 } 126 }(this)); 127 128 if (this.EnableUpdateRowSelectionStatus) { 129 gx.fx.obs.addObserver("gx.onclick", window, function (thisC) { 130 return function (e) { 131 thisC.UpdateRowSelectedStatus(true); 132 } 133 }(this)); 134 } 135 136 if (this.EnableAutoUpdateFromDocumentTitle && !this.AutoUpdateFromDocumentTitle_Enabled) { 137 //Automatically update textblocks with the form caption 138 this.AutoUpdateFromDocumentTitle_Enabled = true; 139 var target = document.querySelector('head > title'); 140 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; 141 var observer = new MutationObserver(function (mutations) { 142 mutations.forEach(function (mutation) { 143 $('.AutoUpdateFromDocumentTitle').text(mutation.target.textContent) 144 }); 145 }); 146 observer.observe(target, { subtree: true, characterData: true, childList: true }); 147 } 148 } 149 150 SetMinWidthTotalizers(); 151 if (this.EnableFloatingLabels) { 152 this.FloatingLabels(); 153 } 154 if (this.EmpowerTabs) { 155 this.ExecEmpowerTabs(); 156 } 157 if (this.EnableConvertComboToBootstrapSelect) { 158 ApplyBootstrapSelect(); 159 } 160 this.PorcessDetailWCs(); 161 162 if (window.frameElement != null && window.frameElement.urlHist != null) { 163 window.frameElement.WWPUtils = this; 164 if (window.frameElement.CurrentTab_ReturnUrl != null) { 165 this.CurrentTab_ReturnUrl = window.frameElement.CurrentTab_ReturnUrl; 166 } 167 } 168 if (this.IncludeLineSeparator) { 169 HideInvisibleRowsWithLineSeparator(); 170 } 171 } 172 173 this.updateCurrentTab_ReturnUrl = function () { 174 if (window.frameElement != null && window.frameElement.urlHist != null) { 175 if (window.frameElement.urlHist.length > 0) { 176 this.CurrentTab_ReturnUrl = window.frameElement.urlHist[window.frameElement.urlHist.length - 1]; 177 var currentLocation = window.frameElement.contentWindow.location + ''; 178 if (currentLocation.indexOf('#') >= 0) { 179 var currentTab_ReturnUrlVal = this.CurrentTab_ReturnUrl; 180 if (currentTab_ReturnUrlVal.indexOf('#') >= 0) { 181 currentTab_ReturnUrlVal = currentTab_ReturnUrlVal.substring(0, currentTab_ReturnUrlVal.indexOf('#')); 182 } 183 if (WWP_startsWith(currentLocation, currentTab_ReturnUrlVal)) { 184 this.CurrentTab_ReturnUrl = currentLocation; 185 window.frameElement.urlHist[window.frameElement.urlHist.length - 1] = this.CurrentTab_ReturnUrl; 186 } 187 } 188 window.frameElement.CurrentTab_ReturnUrl = this.CurrentTab_ReturnUrl; 189 } else { 190 window.frameElement.CurrentTab_ReturnUrl = null; 191 } 192 } 193 } 194 195 this.CurrentTab_Return = function () { 196 if (window.frameElement != null && window.frameElement.urlHist != null && window.frameElement.urlHist.length > 1) { 197 window.frameElement.urlHist.splice(window.frameElement.urlHist.length - 2, 2); 198 } 199 } 200 201 this.DetailWebComponent_Close = function (tableName, doRefresh) { 202 WWPActions.GridDetailWebComponent_Close(tableName, doRefresh); 203 } 204 205 this.FixObjectFitCover = function () { 206 if (WWP_IsIE()) { 207 $("img.ObjectFitCover").each(function (i) { 208 if (this.getAttribute('src') != '') { 209 $(this).css('background-image', "url('" + this.getAttribute('src') + "')"); 210 $(this).addClass('ObjectFitCoverFix'); 211 this.setAttribute('src', ''); 212 } 213 }); 214 } 215 } 216 217 this.UpdateRowSelectedStatus = function (retry) { 218 $(".TableWithSelectableGrid").each(function (i) { 219 $(this).toggleClass('WWPRowSelected', $(this).find('tr.gx-row-selected').length > 0); 220 $(this).toggleClass('WWPMultiRowWOPagingSelected', $(this).find("tr input[value='true']:not([disabled])").length > 0); 221 }); 222 223 if (retry) { 224 var thisC = this; 225 window.setTimeout(function () { thisC.UpdateRowSelectedStatus(false); }, 100); 226 } 227 } 228 229 this.PorcessDetailWCs = function () { 230 var thisC = this; 231 $("td.WCD_ActionColumn,td.WCD_ActionGroupColumn").each(function (i) { 232 if (!$(this).hasClass("WCD_processed")) { 233 $(this).addClass("WCD_processed"); 234 var $wcOriginalCell = $('.WCD_' + $(this).closest('table')[0].id.replace('ContainerTbl', '').toUpperCase()); 235 var wcId = WWP_getWCId(null, this, $wcOriginalCell); 236 if (wcId != null && wcId != '') { 237 $(this).on($(this).hasClass("WCD_ActionGroupColumn") ? "changed.bs.select" : "click", function (e) { 238 if (e.target.tagName != 'P' && e.target.tagName != 'TD' 239 && ($(this).hasClass("WCD_ActionColumn") || e.target.options[e.target.selectedIndex].innerText.indexOf(' WCD') >= 0)) { 240 if (!$(this).hasClass("WCD_Expanded") || $(this).hasClass("WCD_ActionGroupColumn") && !$(e.target.options[e.target.selectedIndex]).hasClass("WCD_Expanded")) { 241 if (!$(this).parent().next().hasClass('WCD_tr')) { 242 var $currentDWCExpandedCell = $(this).parent().find('>td:not(:eq(' + $(this).index() + ')).WCD_Expanded,* .WCD_Expanded');//cuando hay mas de una DWC 243 $(this).addClass("WCD_Expanded"); 244 if ($(this).hasClass("WCD_ActionGroupColumn")) { 245 $(e.target.options[e.target.selectedIndex]).addClass("WCD_Expanded"); 246 } 247 if (WWP_startsWith(wcId, 'gxHTMLWrp')) { 248 var wcIdAuxSelector = $('#' + wcId.substring(9)) 249 if (wcIdAuxSelector.length == 1 && wcIdAuxSelector.parent()[0].tagName == 'BODY') { 250 wcIdAuxSelector.remove(); 251 } 252 } 253 254 var empowerer = $(this).closest('.gx-grid').data('WWP.Empowerer'); 255 if (empowerer != null && empowerer.ColumnsOrHeaderFixer != null) { 256 empowerer.ColumnsOrHeaderFixer.WCD_PrepareToExpand(this.parentNode); 257 } 258 259 var newRow = document.createElement('tr'); 260 $(newRow).addClass("WCD_tr"); 261 this.parentNode.parentNode.insertBefore(newRow, this.parentNode.nextSibling); 262 var $grid = $(this).closest('table'); 263 var processedRecords = $grid.data('IS_ProcessedRecords'); 264 if (processedRecords != null && processedRecords == $grid.find('>tbody').children().length - 1) { 265 $grid.data('IS_ProcessedRecords', (processedRecords + 1)); 266 } 267 268 var showLoading = true; 269 270 var newDiv1 = document.createElement('div'); 271 272 var divSectionWCDContainer = document.createElement('div'); 273 $(divSectionWCDContainer).addClass("SectionWCDContainer"); 274 275 var newCol = document.createElement('td'); 276 newCol.colSpan = $(this).parent().find('>td:visible').length; 277 newRow.appendChild(newCol); 278 $(divSectionWCDContainer).css('display', 'none'); 279 280 if (!showLoading) { 281 newCol.appendChild(divSectionWCDContainer); 282 } 283 284 if ($("#" + wcId).length > 0) { 285 var wcElem = $("#" + wcId); 286 var $wcParent = $(wcElem).parent(); 287 288 if ($wcParent.hasClass('SectionWCDContainer')) { 289 if (showLoading) { 290 //showLoading = false; 291 //newCol.appendChild(divSectionWCDContainer); 292 } 293 $wcParent.slideUp(function () { 294 $currentDWCExpandedCell.removeClass("WCD_Expanded"); 295 $(this).closest('.WCD_tr').prev().find('.WCD_ActionColumn,.WCD_ActionGroupColumn,.WCD_ActionGroupColumn .WCD_Expanded').removeClass("WCD_Expanded"); 296 $(this).closest('.WCD_tr').remove(); 297 });
298 } 299 300 var dateContainer = wcElem.detach(); 301 dateContainer.find('.gxwebcomponent-body').addClass('Invisible'); 302 dateContainer.appendTo(divSectionWCDContainer); 303 dateContainer.html(''); 304 } else { 305 var divWC = document.createElement('div'); 306 divWC.id = wcId; 307 divSectionWCDContainer.appendChild(divWC); 308 } 309 if (showLoading) { 310 newDiv1.innerHTML = '<div class="WCD_Loading"><i class="fas fa-spinner fa-spin"></i></div>'; 311 newCol.appendChild(newDiv1); 312 newDiv1.appendChild(divSectionWCDContainer); 313 $(newDiv1).css('display', 'none'); 314 $(newDiv1).slideDown(function () { 315 $(divSectionWCDContainer).css('min-height', $(this).height()); 316 }); 317 } 318 if (thisC.DWC_Timer != null) { 319 clearInterval(thisC.DWC_Timer); 320 } 321 thisC.DWC_Timer = setInterval(function () { 322 thisC.DetailWC_WCLoaded(showLoading, wcId); 323 }, showLoading ? 3000 : 500); 324 325 if (showLoading) { 326 thisC.DetailWC_wcRenderHandler = function (e) { 327 if (e.containerControl == $("#" + wcId)[0]) { 328 thisC.DetailWC_WCLoaded(showLoading, wcId); 329 } 330 }; 331 gx.fx.obs.addObserver("webcom.render", window, thisC.DetailWC_wcRenderHandler); 332 } 333 } 334 } 335 else { 336 e.preventDefault(); 337 e.stopPropagation(); 338 $(this).removeClass("WCD_Expanded").find('.WCD_Expanded').removeClass("WCD_Expanded"); 339 if ($("#" + wcId).length > 0) { 340 var $wcElem = $("#" + wcId); 341 var wcParent = $wcElem.parent(); 342 if (wcParent.hasClass('SectionWCDContainer')) { 343 var thisRow = this; 344 wcParent.slideUp(function () { 345 346 $wcElem = $wcElem.detach(); 347 if ($wcElem.length == 1) { 348 $wcElem.appendTo($wcOriginalCell[0]); 349 } else { 350 WWP_Debug_Log(false, 'detach div'); 351 $wcOriginalCell.html('<div id="' + wcId + '"></div>'); 352 $wcElem = $wcOriginalCell.find('>div'); 353 } 354 $wcElem.html(''); 355 356 $(this).closest('.WCD_tr').prev().find('.WCD_ActionColumn,.WCD_ActionGroupColumn').removeClass("WCD_Expanded"); 357 $(this).closest('.WCD_tr').remove(); 358 if (typeof window['SetMinWidthPaginationBars'] === "function") { 359 SetMinWidthPaginationBars(); 360 } 361 362 var empowerer = $(thisRow).closest('.gx-grid').data('WWP.Empowerer'); 363 if (empowerer != null && empowerer.ColumnsOrHeaderFixer != null) { 364 empowerer.ColumnsOrHeaderFixer.WCD_Collapsed(); 365 if (empowerer.ColumnsOrHeaderFixer.settings.right > 0) { 366 empowerer.ColumnsOrHeaderFixer.Refresh(); 367 } 368 } 369 }); 370 } 371 } 372 } 373 } 374 }); 375 } 376 } 377 if ($(this).hasClass("WCD_Opened")) { 378 $(this).removeClass("WCD_Opened"); 379 var $btnToClick = $(this).find('a, img').first(); 380 window.setTimeout(function () { 381 $btnToClick.click(); 382 }, 0); 383 } 384 }); 385 } 386 387 this.DetailWC_WCLoaded = function (showLoading, wcId) { 388 if (this.DWC_Timer != null) { 389 clearInterval(this.DWC_Timer); 390 this.DWC_Timer = null; 391 } 392 if (this.DetailWC_wcRenderHandler != null || !showLoading) { 393 var detailWC_wcRenderHandlerAux = this.DetailWC_wcRenderHandler; 394 if (this.DetailWC_wcRenderHandler != null) { 395 delete this.DetailWC_wcRenderHandler; 396 } 397 var thisC = this; 398 window.setTimeout(function () { 399 var $divSectionWCDContainer = $("#" + wcId).closest('.SectionWCDContainer'); 400 if (showLoading) { 401 $divSectionWCDContainer.parent().find('.WCD_Loading').remove(); 402 } 403 $divSectionWCDContainer.slideDown(function () { 404 $(this).css('min-height', ''); 405 if (typeof window['SetMinWidthPaginationBars'] === "function") { 406 SetMinWidthPaginationBars(); 407 } 408 var empowerer = $(this).closest('.gx-grid').data('WWP.Empowerer'); 409 if (empowerer != null && empowerer.ColumnsOrHeaderFixer != null && empowerer.ColumnsOrHeaderFixer.settings.right > 0) { 410 empowerer.ColumnsOrHeaderFixer.Refresh();
411 } 412 }); 413 if (detailWC_wcRenderHandlerAux != null) { 414 gx.fx.obs.deleteObserver("webcom.render", window, detailWC_wcRenderHandlerAux); 415 } 416 thisC.UpdateAllTabSliders(); 417 }, 150); 418 } 419 } 420 421 this.FloatingLabels = function () { 422 var thisC = this; 423 $(".AttributeFL>input:checkbox").on("click", function (i) { 424 $(".AttributeFL").each(function (i) { 425 thisC.FloatingLabels_AnimateLabel(this, null); 426 }); 427 window.setTimeout(function () { 428 thisC.FloatingLabels_WatchReadonlyAttributes(); 429 }, 100); 430 }); 431 $(".ReadonlyAttributeFL>input:checkbox").each(function (i) { 432 thisC.FloatingLabels_AnimateLabel_ToggleClases(this, true, false); 433 }); 434 $("img.ReadonlyAttributeFL").each(function (i) { 435 thisC.FloatingLabels_AnimateLabel_ToggleClases(this, true, false); 436 }); 437 $(".AttributeFL").each(function (i) { 438 if (!thisC.FloatingLabels_IsEventBound(this)) { 439 $(this).on("focus blur", function (i) { 440 thisC.FloatingLabels_AttributeFocused(this, i); 441 442 //por caso de entrar a trn con att editable vacÃo que se pone readonly al cambiar otro att (tested en gx18 U5) 443 var thisC2 = this; 444 setTimeout(function () { thisC.FloatingLabels_AttributeFocused(thisC2, i); }, 200); 445 }); 446 } 447 if (WWP_IsIE() && (($(this).get(0).onblur + '' + $(this).get(0).onchange).indexOf('gx.date.') >= 0 || $(this).parent().find('.gx-image-link').length > 0)) { 448 $(this).parent().parent().off("DOMSubtreeModified").on("DOMSubtreeModified", function () { 449 var elem = $(this).find(".AttributeFL").get(0); 450 if (elem != null && !thisC.FloatingLabels_IsEventBound(elem)) { 451 $(elem).on("focus blur", function (i) { 452 thisC.FloatingLabels_AttributeFocused(this, i); 453 }); 454 } 455 }); 456 } 457 thisC.FloatingLabels_AnimateLabel(this, null); 458 thisC.FloatingLabels_WatchReadonlyAttribute(this); 459 }); 460 $("input[type=date]").each(function (i) { 461 //genexus agrega un input date en XS para que sea manejado por el browser 462 if (!thisC.FloatingLabels_IsEventBound(this, 'change', 'FloatingLabels_AnimateLabel')) { 463 $(this).on("change", function (i) { 464 var id = $(this).attr('id'); 465 if (WWP_endsWith(id, '-picker')) { 466 var $realInput = $('#' + id.substring(0, id.length - 7)); 467 if ($realInput.length == 1) { 468 thisC.FloatingLabels_AnimateLabel($realInput[0], null); 469 } 470 } 471 }); 472 } 473 }); 474 } 475 this.ExecEmpowerTabs = function () { 476 var tabsPanel = this; 477 $(".gx_usercontrol.ViewTab:not(.TabEmpowered)").each(function () { 478 var $tabs = $(this); 479 480 $tabs.addClass('TabEmpowered'); 481 482 var tabsSlider = document.createElement('div'); 483 tabsSlider.innerHTML = '<div class="moveLeft"><div class="moveLeftArrow"></div></div><div class="moveRight"><div class="moveRightArrow"></div></div>'; 484 tabsSlider.className = 'tabsSlider'; 485 486 $tabs[0].insertBefore(tabsSlider, $tabs[0].children[0]); 487 488 var ul = $tabs.find('>ul').detach(); 489 ul.appendTo(tabsSlider); 490 491 492 493 var isRTL = ($('body').css('direction') == 'rtl'); 494 if (isRTL) { 495 $(tabsSlider).addClass('Tabs_RTL'); 496 } 497 var leftProp = isRTL ? 'right' : 'left'; 498 499 500 var tabContainer = ul; 501 $(tabsSlider).find(">.moveRight").click(function (event) { 502 var firstLiVisible = null; 503 var lastLiVisible = $(tabContainer).find('>li:last-child()'); 504 var lastLiVisibleRight = WWP_TabsLIPositionRight(isRTL, lastLiVisible); 505 var newFirstLiVisible = $(tabContainer).find('>li:first-child()'); 506 var sliderWidth = $(tabsSlider).width(); 507 var hasRightActions = WWP_IsTabsWithRightActions($(tabsSlider).parent()); 508 if (hasRightActions) { 509 sliderWidth -= $(this).outerWidth(); 510 } 511 var currentLeft = parseInt($(tabContainer).css(leftProp), 10); 512 var totalLis = $(tabContainer).find('>li').length; 513 $(tabContainer).find('>li').each(function () { 514 if (firstLiVisible == null && WWP_TabsLIPositionLeft(isRTL, $(this)) >= currentLeft * -1) { 515 //primer LI que esta visible 516 firstLiVisible = $(this); 517 } 518 if (tabsPanel.ForceShowSelectedLI && $(this).hasClass('active')) { 519 //se fuerza que se muestre el seleccionado como primero 520 newFirstLiVisible = $(this); 521 return false; 522 } 523 else if (!tabsPanel.ForceShowSelectedLI && (sliderWidth - currentLeft - (!hasRightActions && $(this).index() < totalLis - 1 ? $(tabsSlider).find(">.moveRight").outerWidth() : 0) < WWP_TabsLIPositionRight(isRTL, $(this)))) { 524 //first menu option that was not visible entirely 525 newFirstLiVisible = $(this); 526 return false; 527 } 528 else if (sliderWidth - $(tabsSlider).find(">.moveLeft").outerWidth() >= lastLiVisibleRight - WWP_TabsLIPositionLeft(isRTL, $(this))) { 529 //if this option is positioned to the left, all remaining options are shown 530 newFirstLiVisible = $(this); 531 return false; 532 } 533 }); 534 if (newFirstLiVisible[0] == firstLiVisible[0] && newFirstLiVisible.next().length == 1) { 535 //no se va a mover (por ejemplo el caso en que un solo tab ocupa todo el ancho disponible) -> forzar que se muestre el siguiente 536 newFirstLiVisible = newFirstLiVisible.next(); 537 } 538 tabsPanel.SliderMoveTo(tabContainer, tabsSlider, newFirstLiVisible, isRTL); 539 }); 540 $(tabsSlider).find(">.moveLeft").click(function (event) { 541 if (tabsPanel.ForceShowSelectedLI) { 542 var newFirstLiVisible = $(tabContainer).find('>li.active'); 543 var lastLiVisible = $(tabContainer).find('>li:last-child()'); 544 if (newFirstLiVisible[0] == lastLiVisible[0]) { 545 //caso donde se esta viendo solo uno y se elimina -> se mueve a la izquierda 546 //para que se vea el ultimo (que es el seleccionado) pero tambien todos los que se puedan 547 var lastLiVisibleRight = WWP_TabsLIPositionRight(isRTL, lastLiVisible); 548 var sliderWidth = $(tabsSlider).width(); 549 $(tabContainer).find('>li').each(function () { 550 if (sliderWidth - $(tabsSlider).find(">.moveLeft").outerWidth() >= lastLiVisibleRight - WWP_TabsLIPositionLeft(isRTL, $(this))) { 551 //if this option is positioned to the left, all remaining options are shown 552 newFirstLiVisible = $(this); 553 return false; 554 } 555 });
556 } 557 tabsPanel.SliderMoveTo(tabContainer, tabsSlider, newFirstLiVisible, isRTL); 558 } else { 559 var firstLiVisible = $(tabContainer).find('>li:first-child()'); 560 var sliderWidth = $(tabsSlider).width(); 561 var hasRightActions = WWP_IsTabsWithRightActions($(tabsSlider).parent()); 562 if (hasRightActions) { 563 sliderWidth -= $(tabsSlider).find(">.moveRight").outerWidth(); 564 } 565 var currentLeft = parseInt($(tabContainer).css(leftProp), 10); 566 $(tabContainer).find('>li').each(function () { 567 if (WWP_TabsLIPositionLeft(isRTL, $(this)) >= currentLeft * -1) { 568 //primer LI que esta visible 569 firstLiVisible = $(this); 570 return false; 571 } 572 }); 573 if (firstLiVisible != null) { 574 var newFirstLiVisible = $(tabContainer).find('>li:first-child()'); 575 var totalLis = $(tabContainer).find('>li').length; 576 $(tabContainer).find('>li').each(function () { 577 if (WWP_TabsLIPositionLeft(isRTL, $(this)) + sliderWidth - ($(this).index() > 0 ? $(tabsSlider).find(">.moveLeft").outerWidth() : 0) - (!hasRightActions && $(this).index() < totalLis - 1 ? $(tabsSlider).find(">.moveRight").outerWidth() : 0) > WWP_TabsLIPositionLeft(isRTL, firstLiVisible)) { 578 //primer LI que de ponerlo visible hace que el firstLiVisible se comience a ver y quede cortado 579 newFirstLiVisible = $(this); 580 return false; 581 } 582 }); 583 if (newFirstLiVisible[0] == firstLiVisible[0] && newFirstLiVisible.prev().length == 1) { 584 //no se va a mover (por ejemplo el caso en que un solo tab ocupa todo el ancho disponible) -> forzar que se muestre el anterior 585 newFirstLiVisible = newFirstLiVisible.prev(); 586 } 587 tabsPanel.SliderMoveTo(tabContainer, tabsSlider, newFirstLiVisible, isRTL); 588 } 589 } 590 }); 591 $(tabContainer).on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd", function () { 592 tabsPanel.UpdateSlider(tabContainer); 593 }); 594 tabsPanel.UpdateSlider(tabContainer); 595 }); 596 597 if (!this.TabsEmpowererEvents) { 598 this.TabsEmpowererEvents = true; 599 var thisC = this; 600 $(window).resize(function () { 601 thisC.UpdateAllTabSliders(); 602 }); 603 gx.fx.obs.addObserver("gx.onload", window, function (thisC) { 604 return function (e) { 605 thisC.UpdateAllTabSliders(); 606 } 607 }(this)); 608 $(window).on('load', function () { 609 thisC.UpdateAllTabSliders(); 610 }); 611 gx.fx.obs.addObserver("gx.onafterevent", window, function (thisC) { 612 return function (e) { 613 thisC.UpdateAllTabSliders(); 614 } 615 }(this)); 616 } 617 } 618 function WWP_TabsLIPositionLeft(isRTL, $elem) { 619 if (isRTL) { 620 if ($elem.index() == 0) { 621 return 0; 622 } else { 623 return $elem.parent().width() - ($elem.position().left + $elem.width()); 624 } 625 } else { 626 return $elem.position().left; 627 } 628 } 629 function WWP_TabsLIPositionRight(isRTL, $elem) { 630 if (isRTL) { 631 return $elem.parent().width() - $elem.position().left; 632 } else { 633 return $elem.position().left + $elem.width(); 634 } 635 } 636 637 function WWP_IsTabsWithRightActions($tabsContainer) { 638 return $tabsContainer.hasClass('TabsWithRightActions') || $tabsContainer.parent().parent().parent().parent().hasClass('TabsWithRightActions'); 639 } 640 641 this.SliderMoveTo = function (tabContainer, tabsSlider, newFirstLiVisible, isRTL) { 642 this.ForceShowSelectedLI = false; 643 var newLeft = WWP_TabsLIPositionLeft(isRTL, newFirstLiVisible) * -1; 644 if (newLeft < 0) { 645 newLeft += $(tabsSlider).find(">.moveLeft").width(); 646 } 647 var $horizontalMenuSilder = $(tabContainer).parent(); 648 var horizontalMenuSilderWidth = $horizontalMenuSilder.width(); 649 var hasRightActions = WWP_IsTabsWithRightActions($horizontalMenuSilder.parent()); 650 if (hasRightActions) { 651 horizontalMenuSilderWidth -= $horizontalMenuSilder.find('>.moveRight').outerWidth(); 652 } 653 $(tabsSlider).toggleClass('NeedSliderLeft', newLeft < 0); 654 if (!hasRightActions || !$(tabsSlider).hasClass('NeedSliderRight')) { 655 $(tabsSlider).toggleClass('NeedSliderRight', horizontalMenuSilderWidth - newLeft < WWP_TabsLIPositionRight(isRTL, $(tabContainer).find('>li:last-child()'))); 656 } 657 $(tabContainer).css(isRTL ? 'right' : 'left', newLeft + 'px'); 658 } 659 660 this.UpdateAllTabSliders = function () { 661 var thisC = this; 662 $(".gx_usercontrol.ViewTab.TabEmpowered").each(function () { 663 thisC.UpdateSlider($(this).find('>.tabsSlider>ul')[0]); 664 }); 665 } 666 667 this.UpdateSlider = function (tabContainer, retrying) { 668 var isRTL = ($('body').css('direction') == 'rtl'); 669 var menuLeft = parseInt($(tabContainer).css(isRTL ? 'right' : 'left'), 10); 670 var $horizontalMenuSilder = $(tabContainer).parent(); 671 var hasTabs = $(tabContainer).find('>li').length > 0;
672 if (hasTabs) { 673 var horizontalMenuSilderWidth = $horizontalMenuSilder.width(); 674 if (WWP_IsTabsWithRightActions($horizontalMenuSilder.parent())) { 675 horizontalMenuSilderWidth -= $horizontalMenuSilder.find('>.moveRight').outerWidth(); 676 } 677 if ($horizontalMenuSilder.length > 0) { 678 $horizontalMenuSilder 679 .toggleClass('NeedSliderRight', hasTabs && (horizontalMenuSilderWidth - menuLeft < WWP_TabsLIPositionRight(isRTL, $(tabContainer).find('>li:last-child()')))) 680 .toggleClass('NeedSliderLeft', hasTabs && menuLeft < 0); 681 } 682 683 if (this.ForceShowSelectedLI) { 684 var $selectedLi = $(tabContainer).find('>li.active'); 685 if (horizontalMenuSilderWidth - menuLeft < WWP_TabsLIPositionRight(isRTL, $selectedLi)) { 686 //hidden (on the right side) 687 $(tabContainer).parent().find(">.moveRight").click(); 688 } else if (menuLeft < WWP_TabsLIPositionLeft(isRTL, $selectedLi) * -1) { 689 //hidden (on the left side) 690 $(tabContainer).parent().find(">.moveLeft").click(); 691 } else { 692 this.ForceShowSelectedLI = false; 693 } 694 } 695 if (retrying == null && $(tabContainer).css('position') == 'absolute' && $(tabContainer).closest('.entering').length == 1) { 696 var thisC = this; 697 //soluciona caso de split screen al recargar registro 698 setTimeout(function () { thisC.UpdateSlider(tabContainer, true); }, 1); 699 } 700 } else { 701 $horizontalMenuSilder.toggleClass('NeedSliderRight', false); 702 $horizontalMenuSilder.toggleClass('NeedSliderLeft', false); 703 } 704 } 705 706 this.FloatingLabels_IsEventBound = function (elem, type, functionToSearch) { 707 if (type == null) { 708 type = 'focus'; 709 } 710 if (functionToSearch == null) { 711 functionToSearch = 'FloatingLabels_AttributeFocused'; 712 } 713 var datas = jQuery._data(elem, 'events'); 714 if (datas != null) { 715 var data = jQuery._data(elem, 'events')[type]; 716 717 if (data === undefined || data.length === 0) { 718 return false; 719 } 720 for (var i = 0; i < data.length; i++) { 721 if ((data[i].handler + ' ').indexOf(functionToSearch) >= 0) { 722 return true; 723 } 724 } 725 } 726 727 return false; 728 } 729 730 this.FloatingLabels_AttributeFocused = function (elem, i) { 731 var thisC = this; 732 733 if ("focus" === i.type) { 734 $(".AttributeFL").each(function (i) { 735 thisC.FloatingLabels_AnimateLabel(this, null); 736 }); 737 } 738 else { 739 this.FloatingLabels_WatchReadonlyAttributes(); 740 } 741 this.FloatingLabels_AnimateLabel(elem, i); 742 } 743 744 this.FloatingLabels_WatchReadonlyAttributes = function () { 745 var thisC = this; 746 $(".ReadonlyAttributeFL,span.AttributeFL, .Readonlyform-control.AttributeFL").each(function (i) { 747 var elem = $(this).closest(".form-group").find(".AttributeFL:not(.Readonlyform-control)").get(0); 748 if (elem != null) { 749 thisC.FloatingLabels_WatchReadonlyAttribute(elem); 750 } 751 }); 752 } 753 754 this.FloatingLabels_WatchReadonlyAttribute = function (inputElem) { 755 var $elemToObserve = $(inputElem).closest(".form-group").find(".ReadonlyAttributeFL, span.AttributeFL, .Readonlyform-control.AttributeFL").parent(); 756 if ($elemToObserve.length == 1 && $elemToObserve.data('wwp-mut-obs') == null) { 757 var thisC = this; 758 var MutationObserver = window.MutationObserver || window.WebKitMutationObserver; 759 var myObserver = new MutationObserver(function (mutationList, obs) { 760 var elem = $elemToObserve.closest(".form-group").find(".AttributeFL:not(.Readonlyform-control)").get(0); 761 if (elem != null) { 762 if ($(elem.parentNode).find('span').length == 0) { 763 setTimeout(function () { thisC.FloatingLabels_AnimateLabel(elem, null); }, 200); 764 } else { 765 thisC.FloatingLabels_AnimateLabel(elem, null); 766 } 767 } 768 if ($elemToObserve[0].tagName != 'P') { 769 var myObserver2 = $elemToObserve.data('wwp-mut-obs'); 770 if (myObserver2 != null) { 771 myObserver2.disconnect(); 772 $elemToObserve.data('wwp-mut-obs', null); 773 } 774 var $elemToObserve2 = $elemToObserve.find(".ReadonlyAttributeFL, span.AttributeFL, .Readonlyform-control.AttributeFL").parent(); 775 if ($elemToObserve2.length == 1 && $elemToObserve2.data('wwp-mut-obs') == null) { 776 myObserver2 = new MutationObserver(function (mutationList, obs) { 777 var elem = $elemToObserve2.closest(".form-group").find(".AttributeFL:not(.Readonlyform-control)").get(0); 778 if (elem != null) { 779 thisC.FloatingLabels_AnimateLabel(elem, null); 780 } 781 });
782 $elemToObserve2.data('wwp-mut-obs', myObserver2); 783 myObserver2.observe($elemToObserve2[0], { subtree: true, attributes: true }); 784 } 785 } 786 }); 787 $elemToObserve.data('wwp-mut-obs', myObserver); 788 myObserver.observe($elemToObserve[0], { subtree: true, attributes: true }); 789 } 790 } 791 792 this.FloatingLabels_AnimateLabel = function (elem, i) { 793 if (elem.tagName == 'SPAN' && elem.className.indexOf('Readonly') != 0) { 794 elem = $(elem).closest('.gx-attribute').find('.form-control')[0]; 795 if (elem == null) { 796 return; 797 } 798 } 799 var controlValue; 800 var isDate = ($(elem).get(0).onblur + '' + $(elem).get(0).onchange).indexOf('gx.date.') >= 0; 801 if (isDate) { 802 controlValue = $(elem).val().replace('/', '').replace('/', '').trim(); 803 } 804 else { 805 if (elem.tagName == 'SELECT') { 806 controlValue = $(elem).find('option:selected').text(); 807 } 808 else { 809 controlValue = elem.value; 810 if (controlValue == '0' && ($(elem).get(0).onblur + '' + $(elem).get(0).onchange).indexOf('gx.num.') >= 0) { 811 controlValue = ''; 812 } 813 } 814 } 815 var addReadOnly = false; 816 if (!$(elem.parentNode).is(":visible")) { 817 addReadOnly = ($(elem).css('display') == 'none') && $($(elem).closest(".gx-attribute").find('span')).css('display') != 'none'; 818 } 819 else { 820 if ($(elem).hasClass('ReadonlyExtendedCombo')) { 821 addReadOnly = true; 822 } else if ((!$(elem).is(":visible"))) { 823 if ($(elem).closest(".gx-attribute").find('span').is(":visible")) { 824 addReadOnly = true; 825 } else { 826 var isMergeDataCell = $(elem).closest(".gx-attribute").length == 1 827 && $($(elem).closest(".gx-attribute").get(0).parentNode).hasClass('MergeDataCell') 828 && $($(elem).closest(".gx-attribute").get(0).parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling).hasClass('MergeLabelCell'); 829 if (isMergeDataCell && $($(elem).closest(".gx-attribute").get(0).parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling).find('span').is(":visible")) { 830 addReadOnly = true; 831 } 832 } 833 } 834 } 835 addReadOnly = addReadOnly && (elem.id == null || !elem.id.match(/_GXI$/)); 836 var addEmptyVal = !addReadOnly 837 && elem.type != 'checkbox' 838 && (elem.tagName != 'SPAN' || $(elem).find('>input[type=checkbox]').length == 0) 839 && elem.type != 'file' 840 && elem.type != 'textarea' 841 && elem.tagName != 'IMG' 842 && !$(elem).hasClass('gx-radio-button') 843 && elem.tagName != 'LABEL' 844 && (elem.id == null || !elem.id.match(/_GXI$/)) 845 && !(i != null && "focus" === i.type || controlValue != null && controlValue.length > 0 || $(elem).is(':focus')); 846 this.FloatingLabels_AnimateLabel_ToggleClases(elem, addReadOnly, addEmptyVal); 847 } 848 849 this.FloatingLabels_AnimateLabel_ToggleClases = function (elem, addReadOnly, addEmptyVal) { 850 if ($(elem).hasClass('ReadonlyExtendedCombo')) { 851 var isMergeDataCell = $(elem.parentNode.parentNode).hasClass('MergeDataCell') 852 && $(elem.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling).hasClass('MergeLabelCell'); 853 if (isMergeDataCell) { 854 $(elem.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling).addClass("FloatingLabelReadonly").find('span.Label').addClass('AttributeFLLabel').addClass('control-label'); 855 $(elem.parentNode.parentNode.parentNode.parentNode.parentNode).addClass("TableMergedReadonlyExtendedCombo"); 856 } else { 857 if ($(elem.parentNode.parentNode.previousSibling).hasClass('MergeLabelCell')) { 858 $(elem.parentNode.parentNode.previousSibling).addClass("FloatingLabelReadonly").find('span.Label').addClass('AttributeFLLabel').addClass('control-label'); 859 } 860 } 861 862 } else if ($(elem).hasClass('ExtendedCombo')) { 863 var isMergeDataCell = $(elem.parentNode).hasClass('MergeDataCell') 864 && $(elem.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling).hasClass('MergeLabelCell'); 865 if (isMergeDataCell) { 866 $(elem.parentNode.parentNode.parentNode.parentNode).addClass("TableMergedExtendedCombo"); 867 } 868 869 } else { 870 var isMergeDataCell = $(elem).closest(".gx-attribute").length == 1 871 && $($(elem).closest(".gx-attribute").get(0).parentNode).hasClass('MergeDataCell') 872 && $($(elem).closest(".gx-attribute").get(0).parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling).hasClass('MergeLabelCell'); 873 if (isMergeDataCell) { 874 var gxAttElem = $(elem).closest(".gx-attribute").get(0); 875 $(gxAttElem.parentNode).toggleClass("FloatingLabelEmpty", addEmptyVal); 876 $(gxAttElem.parentNode).toggleClass("FloatingLabelReadonly", addReadOnly); 877 $(gxAttElem.parentNode.parentNode.parentNode.parentNode.parentNode.previousSibling).toggleClass("FloatingLabelEmpty", addEmptyVal).toggleClass("FloatingLabelReadonly", addReadOnly).find('span.Label').addClass('AttributeFLLabel').addClass('control-label'); 878 } 879 else { 880 $(elem).closest(".form-group").toggleClass("FloatingLabelEmpty", addEmptyVal).toggleClass("FloatingLabelReadonly", addReadOnly); 881 } 882 883 //ocultar/mostrar placeholder 884 if (addEmptyVal) { 885 var placeholderVal = $(elem).attr('placeholder'); 886 if (placeholderVal != null && placeholderVal != '') { 887 $(elem).attr('origPH', placeholderVal); 888 $(elem).attr('placeholder', ''); 889 } 890 } else { 891 var origPH = $(elem).attr('origPH'); 892 if (origPH != null && origPH != '') { 893 $(elem).attr('placeholder', origPH); 894 } 895 } 896 } 897 } 898} 899 900//ApplyBootstrapSelect - Start 901function ApplyBootstrapSelect() { 902 $('select.ConvertToDDO:not(.selectpicker_DV)').each(function (g, h) { 903 var c = $(h); 904 c.val(0); 905 906 c.addClass("selectpicker_DV").selectpicker_DV({ 907 noneSelectedText: "", 908 showContent: false, 909 dropupAuto: false, 910 size: false 911 }); 912 913 c.on('show.bs.select', function (e, clickedIndex, isSelected, previousValue) { 914 $(this).focus(); 915 }); 916 917 ApplyBootstrapSelect_updateDDO(h); 918 919 c = c.parent(); 920 c.on("changed.bs.select", function (j, i, l, k) { 921 if ($(this).find('>select').hasClass('selectpicker_DV')) { 922 $(this).css('display', 'none'); 923 wwp_currentDDO = { 924 'ddoControl': this, 925 'target': j.target 926 }; 927 } 928 }); 929 c.on('hidden.bs.dropdown', function (e) { 930 var tdItem = $(this).closest('td'); 931 if (tdItem.length == 1 && tdItem.css('z-index') == parseInt(tdItem.css('z-index'))) { 932 tdItem.css('z-index', parseInt(tdItem.css('z-index')) - 100); 933 } 934 ApplyBootstrapSelect_setSectionGridMinHeight(e.target, false); 935 }); 936 c.on('shown.bs.dropdown', function (e) { 937 if ($(this).parent().find('li').length == 0) { 938 //fix bug al hacer delete, cancel y rapido intentar abrir un action group del grid nuevamente (testeado en gx18 U5) 939 $(this).removeClass('open'); 940 return; 941 } 942 ApplyBootstrapSelect_updateDDOOptions(h); 943 var tdItem = $(this).closest('td'); 944 if (tdItem.length == 1 && tdItem.css('z-index') == parseInt(tdItem.css('z-index'))) { 945 tdItem.css('z-index', parseInt(tdItem.css('z-index')) + 100); 946 } 947 WWP_dropdownAutoPosition(e.target, $(e.target).find('.dropdown-menu')[0], $(e.target).find("button")[0]) 948 ApplyBootstrapSelect_setSectionGridMinHeight(e.target, true); 949 var gxCmpContext = gx != null && gx.O != null ? gx.O.CmpContext : null; 950 if (gxCmpContext != null) { 951 //fix por bug: abrir AI assistant y sin cerrar click en AG de grid -> Update. esto muestra error de JS y no funciona (tested en Gx gx18 u10) 952 window.setTimeout(function () { 953 var gxCmpContext2 = gx != null && gx.O != null ? gx.O.CmpContext : null; 954 if (gxCmpContext2 != null && gxCmpContext != gxCmpContext2) { 955 $(document.activeElement).prev().focus(); 956 } 957 }, 0); 958 } 959 }); 960 }) 961} 962function ApplyBootstrapSelect_resetSelection(ddoControl, target) { 963 $(target).val(0); 964 $(target).selectpicker_DV("refresh"); 965 ApplyBootstrapSelect_updateDDO(target); 966 $(ddoControl).css('display', ''); 967} 968function ApplyBootstrapSelect_updateDDO(h) { 969 var c = $(h).parent(); 970 var btn = c.find("button").get(0); 971 var btnCaptionSpan = c.find("button > div > div > div").get(0); 972 if (btnCaptionSpan != null && btnCaptionSpan.innerText.indexOf(';') >= 0) { 973 if (btnCaptionSpan.parentNode.childNodes[0].tagName != 'I') { 974 $("<i></i>").addClass(btnCaptionSpan.innerText.substring(btnCaptionSpan.innerText.indexOf(';') + 1)).insertBefore(btnCaptionSpan); 975 } 976 btnCaptionSpan.innerText = btnCaptionSpan.innerText.substring(0, btnCaptionSpan.innerText.indexOf(';')); 977 } 978 btn.title = ''; 979} 980function ApplyBootstrapSelect_updateDDOOptions(h) { 981 var c = $(h).parent(); 982 c.find("li").each(function (g2, h2) { 983 if ($(h2).index() == 0) { 984 $(h2).css({ display: 'none' }); 985 } else { 986 var data1 = h2.childNodes[0]; 987 if (data1.childNodes[0].tagName != 'I' && data1.childNodes[0].innerText.indexOf(';') >= 0) { 988 var iClassName = data1.childNodes[0].innerText.substring(data1.childNodes[0].innerText.indexOf(';') + 1); 989 data1.childNodes[0].innerText = data1.childNodes[0].innerText.substring(0, data1.childNodes[0].innerText.indexOf(';')); 990 if (iClassName != ' WCD') { 991 var data1_i = document.createElement('i'); 992 data1_i.className = iClassName; 993 data1.insertBefore(data1_i, data1.childNodes[0]); 994 } 995 } 996 } 997 }); 998} 999function ApplyBootstrapSelect_setSectionGridMinHeight(ddo, setMinHeight) { 1000 if (!$(ddo).hasClass('dropup')) { 1001 var ul = $(ddo).find('.dropdown-menu > div > ul').get(0); 1002 var overflowEl = ul.parentElement; 1003 for (var i = 0; i < 18; i++) { 1004 if (overflowEl == null || !$(overflowEl).is('table.table-responsive') && ($(overflowEl).css('overflow') == 'auto' || $(overflowEl).css('overflow-x') == 'auto')) { 1005 break; 1006 } 1007 else { 1008 overflowEl = overflowEl.parentElement; 1009 } 1010 } 1011 if (($(overflowEl).css('overflow') == 'auto' || $(overflowEl).css('overflow-x') == 'auto')) { 1012 if (setMinHeight) { 1013 var minH = $(ul).offset().top + $(ul).outerHeight() + 12 - $(overflowEl).offset().top;//12 = shadow 1014 $(overflowEl).css({ 'min-height': minH + "px" }); 1015 if (hasScroll($(overflowEl), false)) { 1016 //has horizontal scroll visible 1017 minH += getScrollBarWidth(); 1018 $(overflowEl).css({ 'min-height': minH + "px" }); 1019 } 1020 } 1021 else { 1022 $(overflowEl).css({ 'min-height': "" }); 1023 } 1024 } 1025 } 1026 var td = $(ddo).closest('td'); 1027 if (td.css('position') == 'relative') { 1028 if (setMinHeight) { 1029 if (td.data('zIndexIncresed') == null && parseInt(td.css('z-index')) > 0) { 1030 td.css('z-index', (parseInt(td.css('z-index')) + 10)); 1031 td.data('zIndexIncresed', 'T'); 1032 } 1033 } 1034 else { 1035 if (td.data('zIndexIncresed') == 'T') { 1036 td.css('z-index', (parseInt(td.css('z-index')) - 10)); 1037 td.data('zIndexIncresed', null); 1038 } 1039 } 1040 } 1041} 1042//ApplyBootstrapSelect - End 1043 1044function SetMinWidthTotalizers() { 1045 $("table.GridWithTotalizer").each(function () { 1046 var idGrid = $(this).attr('id'); 1047 var tableTotalizerId = idGrid.substring(0, idGrid.indexOf("ContainerTbl")).toUpperCase() + "TABLETOTALIZER"; 1048 if ($("#" + tableTotalizerId).length > 0 && $(this).data('wwpTotRowAdded') == null) { 1049 $(this).data('wwpTotRowAdded', 'T'); 1050 var totalizerTable = $("#" + tableTotalizerId); 1051 totalizerTable.css({ display: 'none' }); 1052 if ($(this).css('display') != 'none' && $(this).find('>tbody>tr').length > 0) { 1053 1054 var newRow = document.createElement('tr'); 1055 newRow.className = $(this).find('>tbody>tr:not(.DVGroupByRow):eq(0)')[0].className; 1056 $(newRow).addClass('TotalizerRow'); 1057 newRow.style = $(this).find('>tbody>tr:not(.DVGroupByRow):eq(0)')[0].style;
1058 var copyBackgroundColor = (!totalizerTable.parent().parent().hasClass('Invisible'));//backwards compatibility 1059 var hasTotData = false; 1060 var rowConditionalFormattingClass = null; 1061 $(this).find('>tbody>tr:not(.DVGroupByRow):eq(0)>td').each(function () { 1062 var newCol = document.createElement('td'); 1063 newCol.className = this.className; 1064 if (rowConditionalFormattingClass == null && newCol.className.indexOf('FirstColumn') > 0) { 1065 rowConditionalFormattingClass = newCol.className.substring(newCol.className.lastIndexOf(' ') + 1); 1066 rowConditionalFormattingClass = WWP_replaceAll(rowConditionalFormattingClass, 'FirstColumn', ''); 1067 } 1068 if (rowConditionalFormattingClass != null) { 1069 $(newCol).removeClass(rowConditionalFormattingClass + 'FirstColumn'); 1070 $(newCol).removeClass(rowConditionalFormattingClass); 1071 } else if (newCol.className.indexOf('SingleCell') > 0) { 1072 //cell with conditional formatting 1073 newCol.className = newCol.className.substring(0, newCol.className.lastIndexOf(' ')); 1074 newCol.className = newCol.className.substring(0, newCol.className.lastIndexOf(' ')); 1075 } 1076 newCol.style.display = this.style.display; 1077 if (copyBackgroundColor) { 1078 $(newCol).css('background-color', totalizerTable.css('background-color')); 1079 } 1080 if ($('body').css('direction') == 'rtl') { 1081 $(newCol).css('text-align', ($(this).css('text-align') == 'left' ? "right" : "left")); 1082 } else { 1083 $(newCol).css('text-align', $(this).css('text-align')); 1084 } 1085 $(newCol).append(totalizerTable.find("td:eq(" + $(this).index() + ")>*").clone()); 1086 $(newCol).find('[id]').removeAttr('id').removeAttr('name'); 1087 newRow.appendChild(newCol); 1088 hasTotData = hasTotData || $(newCol).css('display') != 'none' && newCol.innerHTML != ''; 1089 }); 1090 1091 if (hasTotData) { 1092 $(this).find('>tfoot').prepend(newRow); 1093 } 1094 $(this).parent().toggleClass('TotalizerFooterVisible', hasTotData); 1095 } 1096 } 1097 }); 1098 $("table.TableTotalizerAl").each(function () { 1099 var prevRow = $(this).closest('.row').prev(); 1100 if (prevRow.length == 1 && prevRow.find('>div>div').length == 1 && prevRow.find('>div>div').children().length == 0) { 1101 //Grid not loaded yet 1102 window.setTimeout(function () { 1103 SetMinWidthTotalizers(); 1104 }, 100); 1105 } 1106 }); 1107} 1108 1109function FixCheckboxDoubleClick() { 1110 if (!(/chrom(e|ium)/.test(navigator.userAgent.toLowerCase())) || (/edge/.test(navigator.userAgent.toLowerCase()))) { 1111 $('html').toggleClass('notChrome', true); 1112 } 1113 1114 $('.gx-grid>table>tbody>tr>td>label>input:checkbox:not(.dblClickFix)').each(function () { 1115 $(this).addClass('dblClickFix'); 1116 if (this.onclick == null) { 1117 this.disabledAux = 0; 1118 //TODO: por pruebas hechas con ejemplo de JP esto parecerÃa dejar nu memory leak (no tengo claro si es por problema de GX o nuestro) 1119 $(this).on('click', function (event) { 1120 if (this.value + '' == this.checked + '' && WWP_IsIE()) { 1121 return false; 1122 } 1123 this.disabledAux++; 1124 var ret = (this.disabledAux == 1); 1125 var thisC = this; 1126 window.setTimeout(function () { thisC.disabledAux--; }, 200); 1127 return ret; 1128 }); 1129 } 1130 }); 1131 1132 $('.FixingTopInvisible>*').attr('tabindex', '-1'); 1133} 1134 1135HideInvisibleRowsWithLineSeparator = function () { 1136 $(".TableWithLineSeparator > div.row").each(function () { 1137 $(this).removeClass("FixLineSeparatorRow"); 1138 if ($(this).is(':visible') && $(this).outerHeight(false) <= 1) { 1139 $(this).addClass("FixLineSeparatorRow"); 1140 } 1141 }); 1142 $(".DF_LineSeparator").each(function () { 1143 $(this).removeClass("FixLineSeparatorRow"); 1144 if ($(this).is(':visible') && $(this).outerHeight(false) <= 1) { 1145 $(this).addClass("FixLineSeparatorRow"); 1146 } 1147 }); 1148} 1149 1150$(window).on('load', function () { 1151 SetMinWidthTotalizers(); 1152 FixCheckboxDoubleClick(); 1153}); 1154;$(window).one('load',function(){WWP_VV([['WorkWithPlusUtilities','15.3.2'],['WWP.WorkWithPlusUtilities_FAL','15.3.2'],['WorkWithPlusUtilities_F5','15.3.2']]);});
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.