1(function (global, factory) { 2 typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : 3 typeof define === 'function' && define.amd ? define(['exports'], factory) : 4 (factory((global.StickySidebar = {}))); 5}(this, (function (exports) { 'use strict'; 6 7var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; 8 9 10 11function unwrapExports (x) { 12 return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; 13} 14 15function createCommonjsModule(fn, module) { 16 return module = { exports: {} }, fn(module, module.exports), module.exports; 17} 18 19var stickySidebar = createCommonjsModule(function (module, exports) { 20(function (global, factory) { 21 if (typeof undefined === "function" && undefined.amd) { 22 undefined(['exports'], factory); 23 } else { 24 factory(exports); 25 } 26})(commonjsGlobal, function (exports) { 27 Object.defineProperty(exports, "__esModule", { 28 value: true 29 }); 30 31 function _classCallCheck(instance, Constructor) { 32 if (!(instance instanceof Constructor)) { 33 throw new TypeError("Cannot call a class as a function"); 34 } 35 } 36 37 var _createClass = function () { 38 function defineProperties(target, props) { 39 for (var i = 0; i < props.length; i++) { 40 var descriptor = props[i]; 41 descriptor.enumerable = descriptor.enumerable || false; 42 descriptor.configurable = true; 43 if ("value" in descriptor) descriptor.writable = true; 44 Object.defineProperty(target, descriptor.key, descriptor); 45 } 46 } 47 48 return function (Constructor, protoProps, staticProps) { 49 if (protoProps) defineProperties(Constructor.prototype, protoProps); 50 if (staticProps) defineProperties(Constructor, staticProps); 51 return Constructor; 52 }; 53 }(); 54 55 /** 56 * Sticky Sidebar JavaScript Plugin. 57 * @version 3.3.4 58 * @author Ahmed Bouhuolia <[email protected]> 59 * @license The MIT License (MIT) 60 */ 61 var StickySidebar = function () { 62 63 // --------------------------------- 64 // # Define Constants 65 // --------------------------------- 66 // 67 var EVENT_KEY = '.stickySidebar'; 68 var DEFAULTS = { 69 /** 70 * Additional top spacing of the element when it becomes sticky. 71 * @type {Numeric|Function} 72 */ 73 topSpacing: 0, 74 75 /** 76 * Additional bottom spacing of the element when it becomes sticky. 77 * @type {Numeric|Function} 78 */ 79 bottomSpacing: 0, 80 81 /** 82 * Container sidebar selector to know what the beginning and end of sticky element. 83 * @type {String|False} 84 */ 85 containerSelector: false, 86 87 /** 88 * Inner wrapper selector. 89 * @type {String} 90 */ 91 innerWrapperSelector: '.inner-wrapper-sticky', 92 93 /** 94 * The name of CSS class to apply to elements when they have become stuck. 95 * @type {String|False} 96 */ 97 stickyClass: 'is-affixed', 98 99 /** 100 * Detect when sidebar and its container change height so re-calculate their dimensions. 101 * @type {Boolean} 102 */ 103 resizeSensor: true, 104 105 /** 106 * The sidebar returns to its normal position if its width below this value. 107 * @type {Numeric} 108 */ 109 minWidth: false 110 }; 111 112 // --------------------------------- 113 // # Class Definition 114 // --------------------------------- 115 // 116 /** 117 * Sticky Sidebar Class. 118 * @public 119 */ 120 121 var StickySidebar = function () { 122 123 /** 124 * Sticky Sidebar Constructor. 125 * @constructor 126 * @param {HTMLElement|String} sidebar - The sidebar element or sidebar selector. 127 * @param {Object} options - The options of sticky sidebar. 128 */ 129 function StickySidebar(sidebar) { 130 var _this = this; 131 132 var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; 133 134 _classCallCheck(this, StickySidebar); 135 136 this.options = StickySidebar.extend(DEFAULTS, options); 137 138 // Sidebar element query if there's no one, throw error. 139 this.sidebar = 'string' === typeof sidebar ? document.querySelector(sidebar) : sidebar; 140 if ('undefined' === typeof this.sidebar) throw new Error("There is no specific sidebar element."); 141 142 this.sidebarInner = false;
143 this.container = this.sidebar.parentElement; 144 145 // Current Affix Type of sidebar element. 146 this.affixedType = 'STATIC'; 147 this.direction = 'down'; 148 this.support = { 149 transform: false, 150 transform3d: false 151 }; 152 153 this._initialized = false; 154 this._reStyle = false; 155 this._breakpoint = false; 156 157 // Dimensions of sidebar, container and screen viewport. 158 this.dimensions = { 159 translateY: 0, 160 maxTranslateY: 0, 161 topSpacing: 0, 162 lastTopSpacing: 0, 163 bottomSpacing: 0, 164 lastBottomSpacing: 0, 165 sidebarHeight: 0, 166 sidebarWidth: 0, 167 containerTop: 0, 168 containerHeight: 0, 169 viewportHeight: 0, 170 viewportTop: 0, 171 lastViewportTop: 0 172 }; 173 174 // Bind event handlers for referencability. 175 ['handleEvent'].forEach(function (method) { 176 _this[method] = _this[method].bind(_this); 177 }); 178 179 // Initialize sticky sidebar for first time. 180 this.initialize(); 181 } 182 183 /**
184 * Initializes the sticky sidebar by adding inner wrapper, define its container, 185 * min-width breakpoint, calculating dimensions, adding helper classes and inline style. 186 * @private 187 */ 188 189 190 _createClass(StickySidebar, [{ 191 key: 'initialize', 192 value: function initialize() { 193 var _this2 = this; 194 195 this._setSupportFeatures(); 196 197 // Get sticky sidebar inner wrapper, if not found, will create one. 198 if (this.options.innerWrapperSelector) { 199 this.sidebarInner = this.sidebar.querySelector(this.options.innerWrapperSelector); 200 201 if (null === this.sidebarInner) this.sidebarInner = false; 202 } 203 204 if (!this.sidebarInner) { 205 var wrapper = document.createElement('div'); 206 wrapper.setAttribute('class', 'inner-wrapper-sticky'); 207 this.sidebar.appendChild(wrapper); 208 209 while (this.sidebar.firstChild != wrapper) { 210 wrapper.appendChild(this.sidebar.firstChild); 211 }this.sidebarInner = this.sidebar.querySelector('.inner-wrapper-sticky'); 212 } 213 214 // Container wrapper of the sidebar. 215 if (this.options.containerSelector) { 216 var containers = document.querySelectorAll(this.options.containerSelector);
217 containers = Array.prototype.slice.call(containers); 218 219 containers.forEach(function (container, item) { 220 if (!container.contains(_this2.sidebar)) return; 221 _this2.container = container; 222 }); 223 224 if (!containers.length) throw new Error("The container does not contains on the sidebar."); 225 } 226 227 // If top/bottom spacing is not function parse value to integer. 228 if ('function' !== typeof this.options.topSpacing) this.options.topSpacing = parseInt(this.options.topSpacing) || 0; 229 230 if ('function' !== typeof this.options.bottomSpacing) this.options.bottomSpacing = parseInt(this.options.bottomSpacing) || 0; 231 232 // Breakdown sticky sidebar if screen width below `options.minWidth`. 233 this._widthBreakpoint(); 234 235 // Calculate dimensions of sidebar, container and viewport. 236 this.calcDimensions(); 237 238 // Affix sidebar in proper position. 239 this.stickyPosition(); 240 241 // Bind all events. 242 this.bindEvents(); 243
vendor: 4,110 bytes, lines 244-341
244 // Inform other properties the sticky sidebar is initialized. 245 this._initialized = true; 246 } 247 }, { 248 key: 'bindEvents', 249 value: function bindEvents() { 250 window.addEventListener('resize', this, { passive: true, capture: false }); 251 window.addEventListener('scroll', this, { passive: true, capture: false }); 252 253 this.sidebar.addEventListener('update' + EVENT_KEY, this); 254 255 if (this.options.resizeSensor && 'undefined' !== typeof ResizeSensor) { 256 new ResizeSensor(this.sidebarInner, this.handleEvent); 257 new ResizeSensor(this.container, this.handleEvent); 258 } 259 } 260 }, { 261 key: 'handleEvent', 262 value: function handleEvent(event) { 263 this.updateSticky(event); 264 } 265 }, { 266 key: 'calcDimensions', 267 value: function calcDimensions() { 268 if (this._breakpoint) return; 269 var dims = this.dimensions; 270 271 // Container of sticky sidebar dimensions. 272 dims.containerTop = StickySidebar.offsetRelative(this.container).top; 273 dims.containerHeight = this.container.clientHeight; 274 dims.containerBottom = dims.containerTop + dims.containerHeight; 275 276 // Sidebar dimensions. 277 dims.sidebarHeight = this.sidebarInner.offsetHeight; 278 dims.sidebarWidth = this.sidebarInner.offsetWidth; 279 280 // Screen viewport dimensions. 281 dims.viewportHeight = window.innerHeight; 282 283 // Maximum sidebar translate Y. 284 dims.maxTranslateY = dims.containerHeight - dims.sidebarHeight; 285 286 this._calcDimensionsWithScroll(); 287 } 288 }, { 289 key: '_calcDimensionsWithScroll', 290 value: function _calcDimensionsWithScroll() { 291 var dims = this.dimensions; 292 293 dims.sidebarLeft = StickySidebar.offsetRelative(this.sidebar).left; 294 295 dims.viewportTop = document.documentElement.scrollTop || document.body.scrollTop; 296 dims.viewportBottom = dims.viewportTop + dims.viewportHeight; 297 dims.viewportLeft = document.documentElement.scrollLeft || document.body.scrollLeft; 298 299 dims.topSpacing = this.options.topSpacing; 300 dims.bottomSpacing = this.options.bottomSpacing; 301 302 if ('function' === typeof dims.topSpacing) dims.topSpacing = parseInt(dims.topSpacing(this.sidebar)) || 0; 303 304 if ('function' === typeof dims.bottomSpacing) dims.bottomSpacing = parseInt(dims.bottomSpacing(this.sidebar)) || 0; 305 306 if ('VIEWPORT-TOP' === this.affixedType) { 307 // Adjust translate Y in the case decrease top spacing value. 308 if (dims.topSpacing < dims.lastTopSpacing) { 309 dims.translateY += dims.lastTopSpacing - dims.topSpacing; 310 this._reStyle = true; 311 } 312 } else if ('VIEWPORT-BOTTOM' === this.affixedType) { 313 // Adjust translate Y in the case decrease bottom spacing value. 314 if (dims.bottomSpacing < dims.lastBottomSpacing) { 315 dims.translateY += dims.lastBottomSpacing - dims.bottomSpacing; 316 this._reStyle = true; 317 } 318 } 319 320 dims.lastTopSpacing = dims.topSpacing; 321 dims.lastBottomSpacing = dims.bottomSpacing; 322 } 323 }, { 324 key: 'isSidebarFitsViewport', 325 value: function isSidebarFitsViewport() { 326 var dims = this.dimensions; 327 var offset = this.scrollDirection === 'down' ? dims.lastBottomSpacing : dims.lastTopSpacing; 328 return this.dimensions.sidebarHeight + offset < this.dimensions.viewportHeight; 329 } 330 }, { 331 key: 'observeScrollDir', 332 value: function observeScrollDir() { 333 var dims = this.dimensions; 334 if (dims.lastViewportTop === dims.viewportTop) return; 335 336 var furthest = 'down' === this.direction ? Math.min : Math.max; 337 338 // If the browser is scrolling not in the same direction. 339 if (dims.viewportTop === furthest(dims.viewportTop, dims.lastViewportTop)) this.direction = 'down' === this.direction ? 'up' : 'down'; 340 } 341 }, {
vendor: 5,814 bytes, lines 342-485
342 key: 'getAffixType', 343 value: function getAffixType() { 344 this._calcDimensionsWithScroll(); 345 var dims = this.dimensions; 346 var colliderTop = dims.viewportTop + dims.topSpacing; 347 var affixType = this.affixedType; 348 349 350 if (colliderTop <= dims.containerTop || dims.containerHeight < dims.sidebarHeight) { 351 dims.translateY = 0; 352 affixType = 'STATIC'; 353 } else { 354 affixType = 'up' === this.direction ? this._getAffixTypeScrollingUp() : this._getAffixTypeScrollingDown(); 355 } 356 357 // Make sure the translate Y is not bigger than container height. 358 dims.translateY = Math.max(0, dims.translateY); 359 dims.translateY = Math.min(dims.containerHeight, dims.translateY); 360 dims.translateY = Math.round(dims.translateY); 361 362 dims.lastViewportTop = dims.viewportTop; 363 return affixType; 364 } 365 }, { 366 key: '_getAffixTypeScrollingDown', 367 value: function _getAffixTypeScrollingDown() { 368 369 //recalculate when height was changed 370 if(this.dimensions.containerHeight != this.container.clientHeight){ 371 this.calcDimensions(); 372 //console.log('upd'); 373 } 374 375 var dims = this.dimensions; 376 var sidebarBottom = dims.sidebarHeight + dims.containerTop; 377 var colliderTop = dims.viewportTop + dims.topSpacing; 378 var colliderBottom = dims.viewportBottom - dims.bottomSpacing; 379 var affixType = this.affixedType; 380 381 382 383 if (this.isSidebarFitsViewport()) { 384 if (dims.sidebarHeight + colliderTop >= dims.containerBottom) { 385 dims.translateY = dims.containerBottom - sidebarBottom; 386 affixType = 'CONTAINER-BOTTOM'; 387 } else if (colliderTop >= dims.containerTop) { 388 dims.translateY = colliderTop - dims.containerTop; 389 affixType = 'VIEWPORT-TOP'; 390 } 391 } else { 392 if (dims.containerBottom <= colliderBottom) { 393 dims.translateY = dims.containerBottom - sidebarBottom; 394 affixType = 'CONTAINER-BOTTOM'; 395 } else if (sidebarBottom + dims.translateY <= colliderBottom) { 396 dims.translateY = colliderBottom - sidebarBottom; 397 affixType = 'VIEWPORT-BOTTOM'; 398 } else if (dims.containerTop + dims.translateY <= colliderTop && 0 !== dims.translateY && dims.maxTranslateY !== dims.translateY) { 399 affixType = 'VIEWPORT-UNBOTTOM'; 400 } 401 } 402 403 return affixType; 404 } 405 }, { 406 key: '_getAffixTypeScrollingUp', 407 value: function _getAffixTypeScrollingUp() { 408 var dims = this.dimensions; 409 var sidebarBottom = dims.sidebarHeight + dims.containerTop; 410 var colliderTop = dims.viewportTop + dims.topSpacing; 411 var colliderBottom = dims.viewportBottom - dims.bottomSpacing; 412 var affixType = this.affixedType; 413 414 if (colliderTop <= dims.translateY + dims.containerTop) { 415 dims.translateY = colliderTop - dims.containerTop; 416 affixType = 'VIEWPORT-TOP'; 417 } else if (dims.containerBottom <= colliderBottom) { 418 dims.translateY = dims.containerBottom - sidebarBottom; 419 affixType = 'CONTAINER-BOTTOM'; 420 } else if (!this.isSidebarFitsViewport()) { 421 422 if (dims.containerTop <= colliderTop && 0 !== dims.translateY && dims.maxTranslateY !== dims.translateY) { 423 affixType = 'VIEWPORT-UNBOTTOM'; 424 } 425 } 426 427 return affixType; 428 } 429 }, { 430 key: '_getStyle', 431 value: function _getStyle(affixType) { 432 if ('undefined' === typeof affixType) return; 433 434 var style = { inner: {}, outer: {} }; 435 var dims = this.dimensions; 436 437 switch (affixType) { 438 case 'VIEWPORT-TOP': 439 style.inner = { position: 'fixed', top: dims.topSpacing, 440 left: dims.sidebarLeft - dims.viewportLeft, width: dims.sidebarWidth }; 441 break; 442 case 'VIEWPORT-BOTTOM': 443 style.inner = { position: 'fixed', top: 'auto', left: dims.sidebarLeft, 444 bottom: dims.bottomSpacing, width: dims.sidebarWidth }; 445 break; 446 case 'CONTAINER-BOTTOM': 447 case 'VIEWPORT-UNBOTTOM': 448 var translate = this._getTranslate(0, dims.translateY + 'px'); 449 450 if (translate) style.inner = { transform: translate };else style.inner = { position: 'absolute', top: dims.translateY, width: dims.sidebarWidth }; 451 break; 452 } 453 454 switch (affixType) { 455 case 'VIEWPORT-TOP': 456 case 'VIEWPORT-BOTTOM': 457 case 'VIEWPORT-UNBOTTOM': 458 case 'CONTAINER-BOTTOM': 459 style.outer = { height: dims.sidebarHeight, position: 'relative' }; 460 break; 461 } 462 463 style.outer = StickySidebar.extend({ height: '', position: '' }, style.outer); 464 style.inner = StickySidebar.extend({ position: 'relative', top: '', left: '', 465 bottom: '', width: '', transform: '' }, style.inner); 466 467 return style; 468 } 469 }, { 470 key: 'stickyPosition', 471 value: function stickyPosition(force) { 472 if (this._breakpoint) return; 473 474 force = this._reStyle || force || false; 475 476 var offsetTop = this.options.topSpacing; 477 var offsetBottom = this.options.bottomSpacing; 478 479 480 //for actual sidebar height, cause height can change after document load 481 if(this.sidebarInner.offsetHeight > this.dimensions.sidebarHeight){ 482 this.dimensions.sidebarHeight = this.sidebarInner.offsetHeight; 483 } 484 485
vendor: 8,245 bytes, lines 486-707
486 var affixType = this.getAffixType(); 487 var style = this._getStyle(affixType); 488 489 if ((this.affixedType != affixType || force) && affixType) { 490 var affixEvent = 'affix.' + affixType.toLowerCase().replace('viewport-', '') + EVENT_KEY; 491 StickySidebar.eventTrigger(this.sidebar, affixEvent); 492 493 if ('STATIC' === affixType) StickySidebar.removeClass(this.sidebar, this.options.stickyClass);else StickySidebar.addClass(this.sidebar, this.options.stickyClass); 494 495 for (var key in style.outer) { 496 var unit = 'number' === typeof style.outer[key] ? 'px' : ''; 497 this.sidebar.style[key] = style.outer[key] + unit; 498 } 499 500 for (var _key in style.inner) { 501 var _unit = 'number' === typeof style.inner[_key] ? 'px' : ''; 502 this.sidebarInner.style[_key] = style.inner[_key] + _unit; 503 } 504 505 var affixedEvent = 'affixed.' + affixType.toLowerCase().replace('viewport-', '') + EVENT_KEY; 506 StickySidebar.eventTrigger(this.sidebar, affixedEvent); 507 } else { 508 if (this._initialized) this.sidebarInner.style.left = style.inner.left; 509 } 510 511 this.affixedType = affixType; 512 } 513 }, { 514 key: '_widthBreakpoint', 515 value: function _widthBreakpoint() { 516 517 if (window.innerWidth <= this.options.minWidth) { 518 this._breakpoint = true; 519 this.affixedType = 'STATIC'; 520 521 this.sidebar.removeAttribute('style'); 522 StickySidebar.removeClass(this.sidebar, this.options.stickyClass); 523 this.sidebarInner.removeAttribute('style'); 524 } else { 525 this._breakpoint = false; 526 } 527 } 528 }, { 529 key: 'updateSticky', 530 value: function updateSticky() { 531 var _this3 = this; 532 533 var event = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 534 535 if (this._running) return; 536 this._running = true; 537 538 (function (eventType) { 539 requestAnimationFrame(function () { 540 switch (eventType) { 541 // When browser is scrolling and re-calculate just dimensions 542 // within scroll. 543 case 'scroll': 544 _this3._calcDimensionsWithScroll(); 545 _this3.observeScrollDir(); 546 _this3.stickyPosition(); 547 break; 548 549 // When browser is resizing or there's no event, observe width 550 // breakpoint and re-calculate dimensions. 551 case 'resize': 552 default: 553 _this3._widthBreakpoint(); 554 _this3.calcDimensions(); 555 _this3.stickyPosition(true); 556 break; 557 } 558 _this3._running = false; 559 }); 560 })(event.type); 561 } 562 }, { 563 key: '_setSupportFeatures', 564 value: function _setSupportFeatures() { 565 var support = this.support; 566 567 support.transform = StickySidebar.supportTransform(); 568 support.transform3d = StickySidebar.supportTransform(true); 569 } 570 }, { 571 key: '_getTranslate', 572 value: function _getTranslate() { 573 var y = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0; 574 var x = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; 575 var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0; 576 577 if (this.support.transform3d) return 'translate3d(' + y + ', ' + x + ', ' + z + ')';else if (this.support.translate) return 'translate(' + y + ', ' + x + ')';else return false; 578 } 579 }, { 580 key: 'destroy', 581 value: function destroy() { 582 window.removeEventListener('resize', this, { capture: false }); 583 window.removeEventListener('scroll', this, { capture: false }); 584 585 this.sidebar.classList.remove(this.options.stickyClass); 586 this.sidebar.style.minHeight = ''; 587 588 this.sidebar.removeEventListener('update' + EVENT_KEY, this); 589 590 var styleReset = { inner: {}, outer: {} }; 591 592 styleReset.inner = { position: '', top: '', left: '', bottom: '', width: '', transform: '' }; 593 styleReset.outer = { height: '', position: '' }; 594 595 for (var key in styleReset.outer) { 596 this.sidebar.style[key] = styleReset.outer[key]; 597 }for (var _key2 in styleReset.inner) { 598 this.sidebarInner.style[_key2] = styleReset.inner[_key2]; 599 }if (this.options.resizeSensor && 'undefined' !== typeof ResizeSensor) { 600 ResizeSensor.detach(this.sidebarInner, this.handleEvent); 601 ResizeSensor.detach(this.container, this.handleEvent); 602 } 603 } 604 }], [{ 605 key: 'supportTransform', 606 value: function supportTransform(transform3d) { 607 var result = false, 608 property = transform3d ? 'perspective' : 'transform', 609 upper = property.charAt(0).toUpperCase() + property.slice(1), 610 prefixes = ['Webkit', 'Moz', 'O', 'ms'], 611 support = document.createElement('support'), 612 style = support.style; 613 614 (property + ' ' + prefixes.join(upper + ' ') + upper).split(' ').forEach(function (property, i) { 615 if (style[property] !== undefined) { 616 result = property; 617 return false; 618 } 619 }); 620 return result; 621 } 622 }, { 623 key: 'eventTrigger', 624 value: function eventTrigger(element, eventName, data) { 625 try { 626 var event = new CustomEvent(eventName, { detail: data }); 627 } catch (e) { 628 var event = document.createEvent('CustomEvent'); 629 event.initCustomEvent(eventName, true, true, data); 630 } 631 element.dispatchEvent(event); 632 } 633 }, { 634 key: 'extend', 635 value: function extend(defaults, options) { 636 var results = {}; 637 for (var key in defaults) { 638 if ('undefined' !== typeof options[key]) results[key] = options[key];else results[key] = defaults[key]; 639 } 640 return results; 641 } 642 }, { 643 key: 'offsetRelative', 644 value: function offsetRelative(element) { 645 var result = { left: 0, top: 0 }; 646 647 do { 648 var offsetTop = element.offsetTop; 649 var offsetLeft = element.offsetLeft; 650 651 if (!isNaN(offsetTop)) result.top += offsetTop; 652 653 if (!isNaN(offsetLeft)) result.left += offsetLeft; 654 655 element = 'BODY' === element.tagName ? element.parentElement : element.offsetParent; 656 } while (element); 657 return result; 658 } 659 }, { 660 key: 'addClass', 661 value: function addClass(element, className) { 662 if (!StickySidebar.hasClass(element, className)) { 663 if (element.classList) element.classList.add(className);else element.className += ' ' + className; 664 } 665 } 666 }, { 667 key: 'removeClass', 668 value: function removeClass(element, className) { 669 if (StickySidebar.hasClass(element, className)) { 670 if (element.classList) element.classList.remove(className);else element.className = element.className.replace(new RegExp('(^|\\b)' + className.split(' ').join('|') + '(\\b|$)', 'gi'), ' '); 671 } 672 } 673 }, { 674 key: 'hasClass', 675 value: function hasClass(element, className) { 676 if (element.classList) return element.classList.contains(className);else return new RegExp('(^| )' + className + '( |$)', 'gi').test(element.className); 677 } 678 }, { 679 key: 'defaults', 680 get: function () { 681 return DEFAULTS; 682 } 683 }]); 684 685 return StickySidebar; 686 }(); 687 688 return StickySidebar; 689 }(); 690 691 exports.default = StickySidebar; 692 693 694 // Global 695 // ------------------------- 696 window.StickySidebar = StickySidebar; 697}); 698}); 699 700var stickySidebar$1 = unwrapExports(stickySidebar); 701 702exports['default'] = stickySidebar$1; 703exports.__moduleExports = stickySidebar; 704 705Object.defineProperty(exports, '__esModule', { value: true }); 706 707})));
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.