1"use strict"; 2 3/* ====================================== */ 4/* Reset and rearrange Stretched Column 5/* ====================================== */ 6var pbmit_rearrange_stretched_col = function(model_id) { 7 if (jQuery('body').hasClass('elementor-editor-active')) { 8 jQuery('*[data-id="' + model_id + '"]').each(function() { 9 jQuery('.pbmit-stretched-div', this).remove(); 10 jQuery('.elementor-widget-wrap', this).removeAttr('style'); 11 setTimeout(function() { pbmit_stretched_col(); }, 50); 12 }); 13 } 14} 15 16/* ====================================== */ 17/* Stretched Column 18/* ====================================== */ 19var pbmit_stretched_col = function() { 20 21 jQuery('.elementor-section.elementor-top-section').each(function() { 22 if (jQuery(this).hasClass('pbmit-col-stretched-left') || jQuery(this).hasClass('pbmit-col-stretched-right') || jQuery(this).hasClass('pbmit-col-stretched-both')) { 23 jQuery(this).addClass('pbmit-col-stretched-yes').removeClass('pbmit-col-stretched-no'); 24 } else { 25 jQuery(this).addClass('pbmit-col-stretched-no').removeClass('pbmit-col-stretched-yes'); 26 } 27 }); 28 29 // remove all stretched related changes in each column 30 jQuery('.elementor-section.elementor-top-section').each(function() { 31 var ThisSection = jQuery(this); 32 var ThisColumn = ''; 33 jQuery('.elementor-column.elementor-top-column', ThisSection).each(function() { 34 ThisColumn = jQuery(this); 35 jQuery('.pbmit-stretched-div', ThisColumn).remove(); 36 ThisColumn.removeClass('pbmit-col-stretched-yes pbmit-col-stretched-left pbmit-col-stretched-right pbmit-col-stretched-content-yes'); 37 }); 38 }); 39 40 // reset - Remove all inline css 41 jQuery('.elementor-section.elementor-top-section').each(function() { 42 jQuery('.elementor-column.elementor-top-column', jQuery(this)).each(function() { 43 if (jQuery(this).children('.elementor-column-wrap').length > 0) { 44 jQuery(this).children('.elementor-column-wrap').removeAttr('style'); 45 } else { 46 jQuery(this).children('.elementor-widget-wrap').removeAttr('style'); 47 } 48 }); 49 }); 50 51 jQuery('.elementor-section.elementor-top-section.pbmit-col-stretched-yes').each(function() { 52 53 var ThisSection = jQuery(this); 54 var ThisColumn = ''; 55 var ColWrapper = ''; 56 var StretchedEle = ''; 57 var StretchedInnerEle = ''; 58 59 if (ThisSection.hasClass('pbmit-col-stretched-left') || ThisSection.hasClass('pbmit-col-stretched-both')) { 60 ThisColumn = jQuery('.elementor-column.elementor-top-column', ThisSection).first(); 61 62 if (jQuery('.pbmit-stretched-div', ThisColumn).length == 0) { 63 64 if (ThisColumn.children('.elementor-column-wrap').length > 0) { 65 ColWrapper = ThisColumn.children('.elementor-column-wrap'); 66 } else { 67 ColWrapper = ThisColumn.children('.elementor-widget-wrap'); 68 } 69 70 ColWrapper.prepend('<div class="pbmit-stretched-div"></div>'); 71 72 // Stretched Element 73 StretchedEle = ColWrapper.children('.pbmit-stretched-div'); 74 75 // RTL 76 if (jQuery('body').hasClass('rtl')) { 77 StretchedEle.addClass('pbmit-stretched-right pbmit-stretched-for-rtl'); 78 ThisColumn.addClass('pbmit-col-stretched-yes pbmit-col-stretched-right pbmit-col-stretched-for-rtl'); 79 } else { 80 StretchedEle.addClass('pbmit-stretched-left'); 81 ThisColumn.addClass('pbmit-col-stretched-yes pbmit-col-stretched-left'); 82 } 83 84 // specially for Skew view only 85 if (ThisColumn.hasClass('pbmit-skew-yes')) { 86 StretchedEle.prepend('<div class="pbmit-stretched-inner-div"></div>'); 87 StretchedInnerEle = StretchedEle.children('.pbmit-stretched-inner-div'); 88 StretchedInnerEle.css('position', 'absolute'); 89 StretchedInnerEle.css('width', '100%'); 90 StretchedInnerEle.css('height', '100%'); 91 } 92 93 if (ThisSection.hasClass('pbmit-left-col-stretched-content-yes')) { 94 ThisColumn.addClass('pbmit-col-stretched-content-yes'); 95 } else { 96 ThisColumn.removeClass('pbmit-col-stretched-content-yes'); 97 } 98 99 // background move to stretched div 100 ColWrapper.removeAttr('style'); 101 var bgImage = ColWrapper.css('background-image'); 102 if (bgImage != 'none' && bgImage != '') { 103 // specially for Skew view only 104 if (ThisColumn.hasClass('pbmit-skew-yes')) { 105 StretchedInnerEle.css('background-image', bgImage); 106 } else { 107 StretchedEle.css('background-image', bgImage); 108 } 109 ColWrapper.css('background-image', 'none'); 110 } 111 112 // border radious 113 ColWrapper.css('border-top-left-radius', ''); 114 ColWrapper.css('border-top-right-radius', ''); 115 ColWrapper.css('border-bottom-left-radius', ''); 116 ColWrapper.css('border-bottom-right-radius', ''); 117 var radius_t_left = ColWrapper.css('border-top-left-radius'); 118 var radius_t_right = ColWrapper.css('border-top-right-radius'); 119 var radius_b_left = ColWrapper.css('border-bottom-left-radius'); 120 var radius_b_right = ColWrapper.css('border-bottom-right-radius'); 121 if (radius_t_left != '0' && radius_t_left != '') { 122 StretchedEle.css('border-top-left-radius', radius_t_left); 123 ColWrapper.css('border-top-left-radius', '0'); 124 } 125 if (radius_t_right != '0' && radius_t_right != '') { 126 StretchedEle.css('border-top-right-radius', radius_t_right); 127 ColWrapper.css('border-top-right-radius', '0'); 128 } 129 if (radius_b_left != '0' && radius_b_left != '') { 130 StretchedEle.css('border-bottom-left-radius', radius_b_left); 131 ColWrapper.css('border-bottom-left-radius', '0'); 132 } 133 if (radius_b_right != '0' && radius_b_right != '') { 134 StretchedEle.css('border-bottom-right-radius', radius_b_right); 135 ColWrapper.css('border-bottom-right-radius', '0'); 136 } 137
138 // Background Color 139 var bgColor = ColWrapper.css('background-color'); 140 141 if (bgColor && bgColor != '') { 142 143 if (bgColor.indexOf('rgba') != -1) { // check if RGB or RGBA 144 145 var bgColorArray = bgColor.split(','); 146 var colors = []; 147 jQuery(bgColorArray).each(function(x, y) { 148 y = y.replace('rgba', ''); 149 y = y.replace('(', ''); 150 y = y.replace(')', ''); 151 y = y.trim(); 152 colors.push(y); 153 }); 154 155 bgColor = 'rgb('; 156 var loopx = 1; 157 var opacity = 'n' 158 jQuery.each(colors, function(index, value) { 159 if (loopx == 1) { 160 bgColor += value; 161 } else if (loopx == 2 || loopx == 3) { 162 bgColor += ',' + value; 163 } else if (loopx == 4 && (value == '0' || value == 0)) { 164 opacity = 'y'; 165 } 166 loopx = loopx + 1; 167 }); 168 bgColor += ')'; 169 170 if (opacity == 'y') { 171 bgColor = 'transparent'; 172 } 173 174 } 175 176 // specially for Skew view only 177 if (ThisColumn.hasClass('pbmit-skew-yes')) { 178 StretchedInnerEle.css('background-color', bgColor); 179 } else { 180 StretchedEle.css('background-color', bgColor); 181 } 182 183 ColWrapper.css('background-color', 'transparent'); 184 } 185 186 // Background Position 187 var bgPosition = ColWrapper.css('background-position'); 188 if (bgPosition != '') { 189 if (ThisColumn.hasClass('pbmit-skew-yes')) { 190 StretchedInnerEle.css('background-position', bgPosition); 191 } else { 192 StretchedEle.css('background-position', bgPosition); 193 } 194 } 195 196 // Background Repeat 197 var bgRepeat = ColWrapper.css('background-repeat'); 198 if (bgRepeat != '') { 199 if (ThisColumn.hasClass('pbmit-skew-yes')) { 200 StretchedInnerEle.css('background-repeat', bgRepeat); 201 } else { 202 StretchedEle.css('background-repeat', bgRepeat); 203 } 204 } 205 206 // Background Size 207 var bgSize = ColWrapper.css('background-size'); 208 if (bgSize != '') { 209 if (ThisColumn.hasClass('pbmit-skew-yes')) { 210 StretchedInnerEle.css('background-size', bgSize); 211 } else { 212 StretchedEle.css('background-size', bgSize); 213 } 214 } 215 216 pbmit_stretched_col_calc(); 217 218 } 219 220 } 221 222 if (ThisSection.hasClass('pbmit-col-stretched-right') || ThisSection.hasClass('pbmit-col-stretched-both')) { 223 ThisColumn = jQuery('.elementor-column.elementor-top-column', ThisSection).last(); 224 225 if (jQuery('.pbmit-stretched-div', ThisColumn).length == 0) { 226 227 if (ThisColumn.children('.elementor-column-wrap').length > 0) { 228 ColWrapper = ThisColumn.children('.elementor-column-wrap'); 229 } else { 230 ColWrapper = ThisColumn.children('.elementor-widget-wrap'); 231 } 232 233 ColWrapper.prepend('<div class="pbmit-stretched-div"></div>'); 234 235 // Stretched Element 236 StretchedEle = ColWrapper.children('.pbmit-stretched-div'); 237 238 // RTL 239 if (jQuery('body').hasClass('rtl')) { 240 StretchedEle.addClass('pbmit-stretched-left pbmit-stretched-for-rtl'); 241 ThisColumn.addClass('pbmit-col-stretched-yes pbmit-col-stretched-left pbmit-col-stretched-for-rtl'); 242 } else { 243 StretchedEle.addClass('pbmit-stretched-right'); 244 ThisColumn.addClass('pbmit-col-stretched-yes pbmit-col-stretched-right'); 245 } 246 247 // specially for Skew view only 248 if (ThisColumn.hasClass('pbmit-skew-yes')) { 249 StretchedEle.prepend('<div class="pbmit-stretched-inner-div"></div>'); 250 StretchedInnerEle = StretchedEle.children('.pbmit-stretched-inner-div'); 251 StretchedInnerEle.css('position', 'absolute'); 252 StretchedInnerEle.css('width', '100%'); 253 StretchedInnerEle.css('height', '100%'); 254 } 255 256 if (ThisSection.hasClass('pbmit-right-col-stretched-content-yes')) { 257 ThisColumn.addClass('pbmit-col-stretched-content-yes'); 258 } else { 259 ThisColumn.removeClass('pbmit-col-stretched-content-yes'); 260 } 261 262 // background move to stretched div 263 ColWrapper.removeAttr('style'); 264 var bgImage = ColWrapper.css('background-image'); 265 if (bgImage != 'none' && bgImage != '') { 266 // specially for Skew view only 267 if (ThisColumn.hasClass('pbmit-skew-yes')) { 268 StretchedInnerEle.css('background-image', bgImage); 269 } else { 270 StretchedEle.css('background-image', bgImage); 271 } 272 ColWrapper.css('background-image', 'none'); 273 } 274 275 // border radious 276 ColWrapper.css('border-top-left-radius', ''); 277 ColWrapper.css('border-top-right-radius', ''); 278 ColWrapper.css('border-bottom-left-radius', ''); 279 ColWrapper.css('border-bottom-right-radius', ''); 280 var radius_t_left = ColWrapper.css('border-top-left-radius'); 281 var radius_t_right = ColWrapper.css('border-top-right-radius'); 282 var radius_b_left = ColWrapper.css('border-bottom-left-radius'); 283 var radius_b_right = ColWrapper.css('border-bottom-right-radius'); 284 if (radius_t_left != '0' && radius_t_left != '') { 285 StretchedEle.css('border-top-left-radius', radius_t_left); 286 ColWrapper.css('border-top-left-radius', '0'); 287 } 288 if (radius_t_right != '0' && radius_t_right != '') { 289 StretchedEle.css('border-top-right-radius', radius_t_right); 290 ColWrapper.css('border-top-right-radius', '0'); 291 } 292 if (radius_b_left != '0' && radius_b_left != '') { 293 StretchedEle.css('border-bottom-left-radius', radius_b_left); 294 ColWrapper.css('border-bottom-left-radius', '0'); 295 } 296 if (radius_b_right != '0' && radius_b_right != '') { 297 StretchedEle.css('border-bottom-right-radius', radius_b_right); 298 ColWrapper.css('border-bottom-right-radius', '0'); 299 } 300
301 // Background Color 302 var bgColor = ColWrapper.css('background-color'); 303 if (bgColor && bgColor != '') { 304 if (bgColor.indexOf('rgba') != -1) { // check if RGB or RGBA 305 var bgColorArray = bgColor.split(','); 306 307 var colors = []; 308 jQuery(bgColorArray).each(function(x, y) { 309 y = y.replace('rgba', ''); 310 y = y.replace('(', ''); 311 y = y.replace(')', ''); 312 y = y.trim(); 313 colors.push(y); 314 }); 315 316 bgColor = 'rgb('; 317 var loopx = 1; 318 var opacity = 'n' 319 jQuery.each(colors, function(index, value) { 320 if (loopx == 1) { 321 bgColor += value; 322 } else if (loopx == 2 || loopx == 3) { 323 bgColor += ',' + value; 324 } else if (loopx == 4 && (value == '0' || value == 0)) { 325 opacity = 'y'; 326 } 327 loopx = loopx + 1; 328 }); 329 bgColor += ')'; 330 331 if (opacity == 'y') { 332 bgColor = 'transparent'; 333 } 334 335 } 336 337 // specially for Skew view only 338 if (ThisColumn.hasClass('pbmit-skew-yes')) { 339 StretchedInnerEle.css('background-color', bgColor); 340 } else { 341 StretchedEle.css('background-color', bgColor); 342 } 343 ColWrapper.css('background-color', 'transparent'); 344 } 345 346 // Background Position 347 var bgPosition = ColWrapper.css('background-position'); 348 if (bgPosition != '') { 349 if (ThisColumn.hasClass('pbmit-skew-yes')) { 350 StretchedInnerEle.css('background-position', bgPosition); 351 } else { 352 StretchedEle.css('background-position', bgPosition); 353 } 354 } 355 356 // Background Repeat 357 var bgRepeat = ColWrapper.css('background-repeat'); 358 if (bgRepeat != '') { 359 if (ThisColumn.hasClass('pbmit-skew-yes')) { 360 StretchedInnerEle.css('background-repeat', bgRepeat); 361 } else { 362 StretchedEle.css('background-repeat', bgRepeat); 363 } 364 } 365 366 // Background Size 367 var bgSize = ColWrapper.css('background-size'); 368 if (bgSize != '') { 369 if (ThisColumn.hasClass('pbmit-skew-yes')) { 370 StretchedInnerEle.css('background-size', bgSize); 371 } else { 372 StretchedEle.css('background-size', bgSize); 373 } 374 } 375 376 pbmit_stretched_col_calc(); 377 378 } 379 } 380 381 }); 382 383}; 384 385var pbmit_stretched_col_calc = function() { 386 387 // padding left or right 388 if (jQuery('.elementor-section.elementor-top-section > .elementor-container .elementor-column.elementor-top-column.pbmit-col-stretched-yes').length > 0) { 389 390 // Returns width of browser viewport 391 var window_width = jQuery(window).width(); 392 393 // Returns width of HTML document 394 var document_width = jQuery(document).width(); 395 396 jQuery('.elementor-section.elementor-top-section > .elementor-container .elementor-column.elementor-top-column.pbmit-col-stretched-yes').each(function() { 397 398 if (jQuery(this).closest('.elementor-section.elementor-top-section').hasClass('pbmit-col-stretched-both') && (jQuery(this).hasClass('elementor-col-100') || jQuery(this).attr('data-col') == '100')) { 399 // Do nothing 400 } else { 401 402 var this_ele = jQuery(this); 403 var curr_width = jQuery(this).closest('.elementor-container').width(); 404 var extra_width = ((window_width - curr_width) / 2); 405 var parent_width = ''; 406 407 if (this_ele.hasClass('pbmit-skew-yes')) { 408 extra_width = extra_width + 100; 409 } 410 411 var position = 'left'; 412 if (jQuery(this).hasClass('pbmit-col-stretched-right')) { 413 position = 'right'; 414 } 415 416 // set width to 100% if parent is 100% 417 parent_width = jQuery(this).width(); 418 if (parent_width == '100%') { 419 jQuery(this).children('.elementor-widget-wrap').css('width', '100%'); 420 jQuery(this).children('.elementor-column-wrap').css('width', '100%'); 421 } else { 422 jQuery(this).children('.elementor-widget-wrap').css('width', ''); 423 jQuery(this).children('.elementor-column-wrap').css('width', ''); 424 } 425 426 jQuery('.pbmit-stretched-div', jQuery(this)).css('margin-' + position, '-' + extra_width + 'px'); 427 428 // stretched column content too 429 if (jQuery(this).hasClass('pbmit-col-stretched-content-yes')) { 430 jQuery('.pbmit-stretched-div', jQuery(this)).css('margin-' + position, ""); 431 var stretched_width = jQuery(this).width() + extra_width ; 432 if (jQuery(this).children('.elementor-column-wrap').length > 0) { 433 jQuery(this).children('.elementor-column-wrap').css('margin-' + position, '-' + extra_width + 'px'); 434 jQuery(this).children('.elementor-column-wrap').css('width', stretched_width + 'px'); 435 } else { 436 jQuery(this).children('.elementor-widget-wrap').css('margin-' + position, '-' + extra_width + 'px'); 437 jQuery(this).children('.elementor-widget-wrap').css('width', stretched_width + 'px'); 438 } 439 } else { 440 if (jQuery(this).children('.elementor-column-wrap').length > 0) { 441 jQuery(this).children('.elementor-column-wrap').css('margin-' + position, ''); 442 jQuery(this).children('.elementor-column-wrap').css('width', ''); 443 } else { 444 jQuery(this).children('.elementor-widget-wrap').css('margin-' + position, ''); 445 jQuery(this).children('.elementor-widget-wrap').css('width', ''); 446 } 447 } 448 } 449 450 }); 451 452 } 453 454} 455 456/* ============================================== */ 457/* BG Image yes class in each Section and Column 458/* ============================================== */ 459var pbmit_bgimage_class = function() { 460 jQuery('.elementor-section.elementor-top-section').each(function() { 461 462 if (jQuery(this).css('background-image') != '' && jQuery(this).css('background-image') != 'none') { 463 jQuery(this).addClass('pbmit-bgimage-yes').removeClass('pbmit-bgimage-no'); 464 } else { 465 jQuery(this).addClass('pbmit-bgimage-no').removeClass('pbmit-bgimage-yes'); 466 } 467 }); 468 jQuery('.elementor-column.elementor-top-column').each(function() { 469 470 if (jQuery(this).children('.elementor-column-wrap').length > 0) { 471 472 if (jQuery(this).children('.elementor-column-wrap').children('.pbmit-stretched-div').length > 0) { 473 474 if (jQuery(this).children('.elementor-column-wrap').children('.pbmit-stretched-div').css('background-image') == 'none' || jQuery(this).children('.elementor-column-wrap').children('.pbmit-stretched-div').css('background-image') == '') { 475 jQuery(this).addClass('pbmit-bgimage-no').removeClass('pbmit-bgimage-yes'); 476 } else { 477 jQuery(this).addClass('pbmit-bgimage-yes').removeClass('pbmit-bgimage-no'); 478 } 479 480 } else { 481 482 if (jQuery(this).children('.elementor-column-wrap').css('background-image') == 'none' || jQuery(this).children('.elementor-column-wrap').css('background-image') == '') { 483 jQuery(this).addClass('pbmit-bgimage-no').removeClass('pbmit-bgimage-yes'); 484 } else { 485 jQuery(this).addClass('pbmit-bgimage-yes').removeClass('pbmit-bgimage-no'); 486 } 487 488 } 489 490 } else { 491 492 if (jQuery(this).children('.elementor-widget-wrap').children('.pbmit-stretched-div').length > 0) { 493 494 if (jQuery(this).children('.elementor-widget-wrap').children('.pbmit-stretched-div').css('background-image') == 'none' || jQuery(this).children('.elementor-widget-wrap').children('.pbmit-stretched-div').css('background-image') == '') { 495 jQuery(this).addClass('pbmit-bgimage-no').removeClass('pbmit-bgimage-yes'); 496 } else { 497 jQuery(this).addClass('pbmit-bgimage-yes').removeClass('pbmit-bgimage-no'); 498 } 499 500 } else { 501 502 if (jQuery(this).children('.elementor-widget-wrap').css('background-image') == 'none' || jQuery(this).children('.elementor-widget-wrap').css('background-image') == '') { 503 jQuery(this).addClass('pbmit-bgimage-no').removeClass('pbmit-bgimage-yes'); 504 } else { 505 jQuery(this).addClass('pbmit-bgimage-yes').removeClass('pbmit-bgimage-no'); 506 } 507 508 } 509 510 } 511 }); 512}; 513 514/* ============================================== */ 515/* BG Color yes class in each Section and Column 516/* ============================================== */ 517var pbmit_bgcolor_class = function() { 518 jQuery('.elementor-section.elementor-top-section').each(function() { 519 if (jQuery(this).css('background-color') != '' && jQuery(this).css('background-color') != 'transparent') { 520 jQuery(this).addClass('pbmit-bgcolor-yes'); 521 } 522 }); 523 jQuery('.elementor-column.elementor-top-column').each(function() { 524 if (jQuery(this).children('.pbmit-stretched-div').length) { 525 if (jQuery(this).children('.pbmit-stretched-div').css('background-color') != '' && jQuery(this).children('.pbmit-stretched-div').css('background-color') != 'transparent') { 526 jQuery(this).addClass('pbmit-bgcolor-yes').removeClass('pbmit-bgcolor-no'); 527 } else { 528 jQuery(this).addClass('pbmit-bgcolor-no').removeClass('pbmit-bgcolor-yes'); 529 } 530 } else { 531 532 if (jQuery(this).children('.elementor-column-wrap').length > 0) { 533 534 if (jQuery(this).children('.elementor-column-wrap').css('background-color') == 'transparent' || jQuery(this).children('.elementor-column-wrap').css('background-color') == '') { 535 jQuery(this).addClass('pbmit-bgcolor-no').removeClass('pbmit-bgcolor-yes'); 536 } else { 537 jQuery(this).addClass('pbmit-bgcolor-yes').removeClass('pbmit-bgcolor-no'); 538 } 539 540 } else { 541 542 if (jQuery(this).children('.elementor-widget-wrap').css('background-color') == 'transparent' || jQuery(this).children('.elementor-widget-wrap').css('background-color') == '') { 543 jQuery(this).addClass('pbmit-bgcolor-no').removeClass('pbmit-bgcolor-yes'); 544 } else { 545 jQuery(this).addClass('pbmit-bgcolor-yes').removeClass('pbmit-bgcolor-no'); 546 } 547 548 } 549 550 } 551 }); 552}; 553 554var pbmit_accordion_active_class = function() { 555 var parentAccordion = ''; 556 jQuery('.elementor-tab-title.elementor-active', this).each(function() { 557 jQuery(this).parent().addClass('pbmit-active-accordion'); 558 }); 559 jQuery('.elementor-tab-title').on('click',function() { 560 parentAccordion = jQuery(this).closest('.elementor-accordion'); 561 jQuery('.elementor-accordion-item', parentAccordion).removeClass('pbmit-active-accordion'); 562 jQuery(this).parent().addClass('pbmit-active-accordion'); 563 }); 564 565} 566 567/*---- Events ----*/ 568 569// On resize 570jQuery(window).resize(function() { 571 setTimeout(function() { 572 pbmit_stretched_col_calc(); 573 }, 100); 574}); 575 576// on ready 577jQuery(document).ready(function() { 578 pbmit_stretched_col(); 579 pbmit_stretched_col_calc(); 580 pbmit_bgimage_class(); 581 pbmit_bgcolor_class(); 582 setTimeout(function() { 583 pbmit_stretched_col_calc(); 584 }, 100); 585}); 586 587// on load 588jQuery(window).load(function(){ 589 pbmit_accordion_active_class(); 590});
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.