vendor: 53,617 bytes, lines 1-1748
1/******/ (function(modules) { // webpackBootstrap 2/******/ // The module cache 3/******/ var installedModules = {}; 4/******/ 5/******/ // The require function 6/******/ function __webpack_require__(moduleId) { 7/******/ 8/******/ // Check if module is in cache 9/******/ if(installedModules[moduleId]) { 10/******/ return installedModules[moduleId].exports; 11/******/ } 12/******/ // Create a new module (and put it into the cache) 13/******/ var module = installedModules[moduleId] = { 14/******/ i: moduleId, 15/******/ l: false, 16/******/ exports: {} 17/******/ }; 18/******/ 19/******/ // Execute the module function 20/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); 21/******/ 22/******/ // Flag the module as loaded 23/******/ module.l = true; 24/******/ 25/******/ // Return the exports of the module 26/******/ return module.exports; 27/******/ } 28/******/ 29/******/ 30/******/ // expose the modules object (__webpack_modules__) 31/******/ __webpack_require__.m = modules; 32/******/ 33/******/ // expose the module cache 34/******/ __webpack_require__.c = installedModules; 35/******/ 36/******/ // identity function for calling harmony imports with the correct context 37/******/ __webpack_require__.i = function(value) { return value; }; 38/******/ 39/******/ // define getter function for harmony exports 40/******/ __webpack_require__.d = function(exports, name, getter) { 41/******/ if(!__webpack_require__.o(exports, name)) { 42/******/ Object.defineProperty(exports, name, { 43/******/ configurable: false, 44/******/ enumerable: true, 45/******/ get: getter 46/******/ }); 47/******/ } 48/******/ }; 49/******/ 50/******/ // getDefaultExport function for compatibility with non-harmony modules 51/******/ __webpack_require__.n = function(module) { 52/******/ var getter = module && module.__esModule ? 53/******/ function getDefault() { return module['default']; } : 54/******/ function getModuleExports() { return module; }; 55/******/ __webpack_require__.d(getter, 'a', getter); 56/******/ return getter; 57/******/ }; 58/******/ 59/******/ // Object.prototype.hasOwnProperty.call 60/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; 61/******/ 62/******/ // __webpack_public_path__ 63/******/ __webpack_require__.p = ""; 64/******/ 65/******/ // Load entry module and return exports 66/******/ return __webpack_require__(__webpack_require__.s = 5); 67/******/ }) 68/************************************************************************/ 69/******/ ([ 70/* 0 */ 71/***/ (function(module, exports, __webpack_require__) { 72 73"use strict"; 74 75 76// Test via a getter in the options object to see if the passive property is accessed 77// https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md#feature-detection 78var supportsPassive = false 79 80try { 81 var opts = Object.defineProperty({}, 'passive', { 82 get: function() { 83 supportsPassive = true 84 } 85 }) 86 87 window.addEventListener('test', null, opts) 88} catch (e) { 89 // pass 90} 91 92module.exports.event = function event(elem, _eventNames, handler, mode) { 93 var eventNames = _eventNames.split(' ') 94 var prefix = mode == 'on' ? 'add' : 'remove' 95 96 eventNames.forEach(function(eventName) { 97 var options = false 98 99 if (['scroll', 'touchstart', 'touchmove'].indexOf(eventName) != -1 && supportsPassive) { 100 options = { passive: true } 101 } 102 103 elem[prefix + 'EventListener'](eventName, handler, options) 104 }) 105} 106 107function each(obj, handler) { 108 for (var key in obj) { 109 if (obj.hasOwnProperty(key)) { 110 handler(key, obj[key]) 111 } 112 } 113} 114 115module.exports.css = function css(node, key, value) { 116 var styles 117 118 if (value === undefined) { 119 // Getter mode 120 if (typeof key == 'string') { 121 return node.style[key] 122 } 123 124 styles = key 125 } else { 126 styles = {} 127 styles[key] = value 128 } 129 130 each(styles, function(k, val) { 131 node.style[k] = val 132 }) 133} 134 135module.exports.add = function add(node, cls) { 136 if (!cls) { 137 return 138 } 139 140 node.classList.add(cls) 141} 142 143module.exports.rm = function add(node, cls) { 144 if (!cls) { 145 return 146 } 147 148 node.classList.remove(cls) 149} 150 151module.exports.has = function has(node, cls) { 152 if (!cls) { 153 return false 154 } 155 156 return node.classList.contains(cls) 157} 158 159module.exports.clone = function clone(_input) { 160 var output = {} 161 var input = _input || {} 162 163 each(input, function(key, value) { 164 output[key] = value 165 }) 166 167 return output 168} 169 170module.exports.qs = function qs(selector, _ctx) { 171 if (selector instanceof HTMLElement) { 172 return selector 173 } 174 175 var ctx = _ctx || document 176 177 return ctx.querySelector(selector) 178} 179 180module.exports.each = each 181 182 183/***/ }), 184/* 1 */ 185/***/ (function(module, exports) { 186 187// shim for using process in browser 188var process = module.exports = {}; 189 190// cached from whatever global is present so that test runners that stub it 191// don't break things. But we need to wrap it in a try catch in case it is 192// wrapped in strict mode code which doesn't define any globals. It's inside a 193// function because try/catches deoptimize in certain engines. 194 195var cachedSetTimeout; 196var cachedClearTimeout; 197 198function defaultSetTimout() { 199 throw new Error('setTimeout has not been defined'); 200} 201function defaultClearTimeout () { 202 throw new Error('clearTimeout has not been defined'); 203} 204(function () { 205 try { 206 if (typeof setTimeout === 'function') { 207 cachedSetTimeout = setTimeout; 208 } else { 209 cachedSetTimeout = defaultSetTimout; 210 } 211 } catch (e) { 212 cachedSetTimeout = defaultSetTimout; 213 } 214 try { 215 if (typeof clearTimeout === 'function') { 216 cachedClearTimeout = clearTimeout; 217 } else { 218 cachedClearTimeout = defaultClearTimeout; 219 } 220 } catch (e) { 221 cachedClearTimeout = defaultClearTimeout; 222 } 223} ()) 224function runTimeout(fun) { 225 if (cachedSetTimeout === setTimeout) { 226 //normal enviroments in sane situations 227 return setTimeout(fun, 0); 228 } 229 // if setTimeout wasn't available but was latter defined 230 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { 231 cachedSetTimeout = setTimeout; 232 return setTimeout(fun, 0); 233 } 234 try { 235 // when when somebody has screwed with setTimeout but no I.E. maddness 236 return cachedSetTimeout(fun, 0); 237 } catch(e){ 238 try { 239 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 240 return cachedSetTimeout.call(null, fun, 0); 241 } catch(e){ 242 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error 243 return cachedSetTimeout.call(this, fun, 0); 244 } 245 } 246 247 248} 249function runClearTimeout(marker) { 250 if (cachedClearTimeout === clearTimeout) { 251 //normal enviroments in sane situations 252 return clearTimeout(marker); 253 } 254 // if clearTimeout wasn't available but was latter defined 255 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { 256 cachedClearTimeout = clearTimeout; 257 return clearTimeout(marker); 258 } 259 try { 260 // when when somebody has screwed with setTimeout but no I.E. maddness 261 return cachedClearTimeout(marker); 262 } catch (e){ 263 try { 264 // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally 265 return cachedClearTimeout.call(null, marker); 266 } catch (e){ 267 // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. 268 // Some versions of I.E. have different rules for clearTimeout vs setTimeout 269 return cachedClearTimeout.call(this, marker); 270 } 271 } 272 273 274 275} 276var queue = []; 277var draining = false; 278var currentQueue; 279var queueIndex = -1; 280 281function cleanUpNextTick() { 282 if (!draining || !currentQueue) { 283 return; 284 } 285 draining = false; 286 if (currentQueue.length) { 287 queue = currentQueue.concat(queue); 288 } else { 289 queueIndex = -1; 290 } 291 if (queue.length) { 292 drainQueue(); 293 } 294} 295 296function drainQueue() { 297 if (draining) { 298 return; 299 } 300 var timeout = runTimeout(cleanUpNextTick); 301 draining = true; 302 303 var len = queue.length; 304 while(len) { 305 currentQueue = queue; 306 queue = []; 307 while (++queueIndex < len) { 308 if (currentQueue) { 309 currentQueue[queueIndex].run(); 310 } 311 } 312 queueIndex = -1; 313 len = queue.length; 314 } 315 currentQueue = null; 316 draining = false; 317 runClearTimeout(timeout); 318} 319 320process.nextTick = function (fun) { 321 var args = new Array(arguments.length - 1); 322 if (arguments.length > 1) { 323 for (var i = 1; i < arguments.length; i++) { 324 args[i - 1] = arguments[i]; 325 } 326 } 327 queue.push(new Item(fun, args)); 328 if (queue.length === 1 && !draining) { 329 runTimeout(drainQueue); 330 } 331}; 332 333// v8 likes predictible objects 334function Item(fun, array) { 335 this.fun = fun; 336 this.array = array; 337} 338Item.prototype.run = function () { 339 this.fun.apply(null, this.array); 340}; 341process.title = 'browser'; 342process.browser = true; 343process.env = {}; 344process.argv = []; 345process.version = ''; // empty string to avoid regexp issues 346process.versions = {}; 347 348function noop() {} 349 350process.on = noop; 351process.addListener = noop; 352process.once = noop; 353process.off = noop; 354process.removeListener = noop; 355process.removeAllListeners = noop; 356process.emit = noop; 357process.prependListener = noop; 358process.prependOnceListener = noop; 359 360process.listeners = function (name) { return [] } 361 362process.binding = function (name) { 363 throw new Error('process.binding is not supported'); 364}; 365 366process.cwd = function () { return '/' }; 367process.chdir = function (dir) { 368 throw new Error('process.chdir is not supported'); 369}; 370process.umask = function() { return 0; }; 371 372 373/***/ }), 374/* 2 */ 375/***/ (function(module, exports) { 376 377module.exports = function log(level, msg, more) { 378 var func = console[level] || console.log 379 var args = [ 380 'Baron: ' + msg, 381 more 382 ] 383 384 Function.prototype.apply.call(func, console, args) 385} 386 387 388/***/ }), 389/* 3 */ 390/***/ (function(module, exports, __webpack_require__) { 391 392"use strict"; 393/* WEBPACK VAR INJECTION */(function(process) { 394 395var g = (function() { 396 return this || (1, eval)('this') 397}()) 398var scopedWindow = g && g.window || g 399 400var event = __webpack_require__(0).event 401var css = __webpack_require__(0).css 402var add = __webpack_require__(0).add 403var has = __webpack_require__(0).has 404var rm = __webpack_require__(0).rm 405var clone = __webpack_require__(0).clone 406var qs = __webpack_require__(0).qs 407 408var _baron = baron // Stored baron value for noConflict usage 409// var Item = {} 410var pos = ['left', 'top', 'right', 'bottom', 'width', 'height'] 411// Global store for all baron instances (to be able to dispose them on html-nodes) 412var instances = [] 413var origin = { 414 v: { // Vertical 415 x: 'Y', pos: pos[1], oppos: pos[3], crossPos: pos[0], crossOpPos: pos[2], 416 size: pos[5], 417 crossSize: pos[4], crossMinSize: 'min-' + pos[4], crossMaxSize: 'max-' + pos[4], 418 client: 'clientHeight', crossClient: 'clientWidth', 419 scrollEdge: 'scrollLeft', 420 offset: 'offsetHeight', crossOffset: 'offsetWidth', offsetPos: 'offsetTop', 421 scroll: 'scrollTop', scrollSize: 'scrollHeight' 422 }, 423 h: { // Horizontal 424 x: 'X', pos: pos[0], oppos: pos[2], crossPos: pos[1], crossOpPos: pos[3], 425 size: pos[4], 426 crossSize: pos[5], crossMinSize: 'min-' + pos[5], crossMaxSize: 'max-' + pos[5], 427 client: 'clientWidth', crossClient: 'clientHeight', 428 scrollEdge: 'scrollTop', 429 offset: 'offsetWidth', crossOffset: 'offsetHeight', offsetPos: 'offsetLeft', 430 scroll: 'scrollLeft', scrollSize: 'scrollWidth' 431 } 432} 433 434// Some ugly vars 435var opera12maxScrollbarSize = 17 436// I hate you https://github.com/Diokuz/baron/issues/110 437var macmsxffScrollbarSize = 15 438var macosxffRe = /[\s\S]*Macintosh[\s\S]*\) Gecko[\s\S]*/ 439var isMacFF = macosxffRe.test(scopedWindow.navigator && scopedWindow.navigator.userAgent) 440 441var log, liveBarons, shownErrors 442 443if (process.env.NODE_ENV !== 'production') { 444 log = __webpack_require__(2) 445 liveBarons = 0 446 shownErrors = { 447 liveTooMany: false, 448 allTooMany: false 449 } 450} 451 452// window.baron and jQuery.fn.baron points to this function 453function baron(user) { 454 var withParams = !!user 455 var tryNode = (user && user[0]) || user 456 var isNode = typeof user == 'string' || tryNode instanceof HTMLElement 457 var params = isNode ? { root: user } : clone(user) 458 var jQueryMode 459 var rootNode 460 var defaultParams = { 461 direction: 'v', 462 barOnCls: '_scrollbar', 463 resizeDebounce: 0, 464 event: event, 465 cssGuru: false, 466 impact: 'scroller', 467 position: 'static' 468 } 469 470 params = params || {} 471 472 // Extending default params by user-defined params 473 for (var key in defaultParams) { 474 if (params[key] == null) { // eslint-disable-line 475 params[key] = defaultParams[key] 476 } 477 } 478 479 if (process.env.NODE_ENV !== 'production') { 480 if (params.position == 'absolute' && params.impact == 'clipper') { 481 log('error', [ 482 'Simultaneous use of `absolute` position and `clipper` impact values detected.', 483 'Those values cannot be used together.', 484 'See more https://github.com/Diokuz/baron/issues/138' 485 ].join(' '), params) 486 } 487 } 488 489 // `this` could be a jQuery instance 490 jQueryMode = this && this instanceof scopedWindow.jQuery 491 492 if (params._chain) { 493 rootNode = params.root 494 } else if (jQueryMode) { 495 params.root = rootNode = this[0] 496 } else { 497 rootNode = qs(params.root || params.scroller) 498 } 499 500 if (process.env.NODE_ENV !== 'production') { 501 if (!rootNode) { 502 log('error', [ 503 'Baron initialization failed: root node not found.' 504 ].join(', '), params) 505 506 return // or return baron-shell? 507 } 508 } 509 510 var attr = manageAttr(rootNode, params.direction) 511 var id = +attr // Could be NaN 512 513 params.index = id 514 515 // baron() can return existing instances, 516 // @TODO update params on-the-fly 517 // https://github.com/Diokuz/baron/issues/124 518 if (id == id && attr !== null && instances[id]) { 519 if (process.env.NODE_ENV !== 'production') { 520 if (withParams) { 521 log('error', [ 522 'repeated initialization for html-node detected', 523 'https://github.com/Diokuz/baron/blob/master/docs/logs/repeated.md' 524 ].join(', '), params.root) 525 } 526 } 527 528 return instances[id] 529 } 530 531 // root and scroller can be different nodes 532 if (params.root && params.scroller) { 533 params.scroller = qs(params.scroller, rootNode) 534 if (process.env.NODE_ENV !== 'production') { 535 if (!params.scroller) { 536 log('error', 'Scroller not found!', rootNode, params.scroller) 537 } 538 } 539 } else { 540 params.scroller = rootNode 541 } 542 543 params.root = rootNode 544 545 var instance = init(params) 546 547 if (instance.autoUpdate) { 548 instance.autoUpdate() 549 } 550 551 return instance 552} 553 554function arrayEach(_obj, iterator) { 555 var i = 0 556 var obj = _obj 557 558 if (obj.length === undefined || obj === scopedWindow) obj = [obj] 559 560 while (obj[i]) { 561 iterator.call(this, obj[i], i) 562 i++ 563 } 564} 565 566// shortcut for getTime 567function getTime() { 568 return new Date().getTime() 569} 570 571if (process.env.NODE_ENV !== 'production') { 572 baron._instances = instances 573} 574 575function manageEvents(item, eventManager, mode) { 576 // Creating new functions for one baron item only one time 577 item._eventHandlers = item._eventHandlers || [ 578 { 579 // onScroll: 580 element: item.scroller, 581 582 handler: function(e) { 583 item.scroll(e) 584 }, 585 586 type: 'scroll' 587 }, { 588 // css transitions & animations 589 element: item.root, 590 591 handler: function() { 592 item.update() 593 }, 594 595 type: 'transitionend animationend' 596 }, { 597 // onKeyup (textarea): 598 element: item.scroller, 599 600 handler: function() { 601 item.update() 602 }, 603 604 type: 'keyup' 605 }, { 606 // onMouseDown: 607 element: item.bar, 608 609 handler: function(e) { 610 e.preventDefault() // Text selection disabling in Opera 611 item.selection() // Disable text selection in ie8 612 item.drag.now = 1 // Save private byte 613 if (item.draggingCls) { 614 add(item.root, item.draggingCls) 615 } 616 }, 617 618 type: 'touchstart mousedown' 619 }, { 620 // onMouseUp: 621 element: document, 622 623 handler: function() { 624 item.selection(1) // Enable text selection 625 item.drag.now = 0 626 if (item.draggingCls) { 627 rm(item.root, item.draggingCls) 628 } 629 }, 630 631 type: 'mouseup blur touchend' 632 }, { 633 // onCoordinateReset: 634 element: document, 635 636 handler: function(e) { 637 if (e.button != 2) { // Not RM 638 item._pos0(e) 639 } 640 }, 641 642 type: 'touchstart mousedown' 643 }, { 644 // onMouseMove: 645 element: document, 646 647 handler: function(e) { 648 if (item.drag.now) { 649 item.drag(e) 650 } 651 }, 652 653 type: 'mousemove touchmove' 654 }, { 655 // @TODO make one global listener 656 // onResize: 657 element: scopedWindow, 658 659 handler: function() { 660 item.update() 661 }, 662 663 type: 'resize' 664 }, { 665 // @todo remove 666 // sizeChange: 667 element: item.root, 668 669 handler: function() { 670 item.update() 671 }, 672 673 type: 'sizeChange' 674 }, { 675 // Clipper onScroll bug https://github.com/Diokuz/baron/issues/116 676 element: item.clipper, 677 678 handler: function() { 679 item.clipperOnScroll() 680 }, 681 682 type: 'scroll' 683 } 684 ] 685 686 arrayEach(item._eventHandlers, function(evt) { 687 if (evt.element) { 688 // workaround for element-elements in `fix` plugin 689 // @todo dispose `fix` in proper way and remove workaround 690 if (evt.element.length && evt.element !== scopedWindow) { 691 for (var i = 0; i < evt.element.length; i++) { 692 eventManager(evt.element[i], evt.type, evt.handler, mode) 693 } 694 } else { 695 eventManager(evt.element, evt.type, evt.handler, mode) 696 } 697 } 698 }) 699 700 // if (item.scroller) { 701 // event(item.scroller, 'scroll', item._eventHandlers.onScroll, mode) 702 // } 703 // if (item.bar) { 704 // event(item.bar, 'touchstart mousedown', item._eventHandlers.onMouseDown, mode) 705 // } 706 // event(document, 'mouseup blur touchend', item._eventHandlers.onMouseUp, mode) 707 // event(document, 'touchstart mousedown', item._eventHandlers.onCoordinateReset, mode) 708 // event(document, 'mousemove touchmove', item._eventHandlers.onMouseMove, mode) 709 // event(window, 'resize', item._eventHandlers.onResize, mode) 710 // if (item.root) { 711 // event(item.root, 'sizeChange', item._eventHandlers.onResize, mode) 712 // // Custon event for alternate baron update mechanism 713 // } 714} 715 716// set, remove or read baron-specific id-attribute 717// @returns {String|null} - id node value, or null, if there is no attr 718function manageAttr(node, direction, mode, id) { 719 var attrName = 'data-baron-' + direction + '-id' 720 721 if (mode == 'on') { 722 node.setAttribute(attrName, id) 723 } else if (mode == 'off') { 724 node.removeAttribute(attrName) 725 } 726 727 return node.getAttribute(attrName) 728} 729 730function init(params) { 731 var out = new baron.prototype.constructor(params) 732 733 manageEvents(out, params.event, 'on') 734 735 manageAttr(out.root, params.direction, 'on', instances.length) 736 instances.push(out) 737 738 if (process.env.NODE_ENV !== 'production') { 739 liveBarons++ 740 if (liveBarons > 100 && !shownErrors.liveTooMany) { 741 log('warn', [ 742 'You have too many live baron instances on page (' + liveBarons + ')!', 743 'Are you forget to dispose some of them?', 744 'All baron instances can be found in baron._instances:' 745 ].join(' '), instances) 746 shownErrors.liveTooMany = true 747 } 748 if (instances.length > 1000 && !shownErrors.allTooMany) { 749 log('warn', [ 750 'You have too many inited baron instances on page (' + instances.length + ')!', 751 'Some of them are disposed, and thats good news.', 752 'but baron.init was call too many times, and thats is bad news.', 753 'All baron instances can be found in baron._instances:' 754 ].join(' '), instances) 755 shownErrors.allTooMany = true 756 } 757 } 758 759 out.update() 760 761 return out 762} 763 764function fire(eventName) { 765 if (this.events && this.events[eventName]) { 766 for (var i = 0; i < this.events[eventName].length; i++) { 767 var args = Array.prototype.slice.call( arguments, 1 ) 768 769 this.events[eventName][i].apply(this, args) 770 } 771 } 772} 773 774baron.prototype = { 775 // underscore.js realization 776 // used in autoUpdate plugin 777 _debounce: function(func, wait) { 778 var self = this, 779 timeout, 780 // args, // right now there is no need for arguments 781 // context, // and for context 782 timestamp 783 // result // and for result 784 785 var later = function() { 786 if (self._disposed) { 787 clearTimeout(timeout) 788 timeout = self = null 789 return 790 } 791 792 var last = getTime() - timestamp 793 794 if (last < wait && last >= 0) { 795 timeout = setTimeout(later, wait - last) 796 } else { 797 timeout = null 798 // result = func.apply(context, args) 799 func() 800 // context = args = null 801 } 802 } 803 804 return function() { 805 // context = this 806 // args = arguments 807 timestamp = getTime() 808 809 if (!timeout) { 810 timeout = setTimeout(later, wait) 811 } 812 813 // return result 814 } 815 }, 816 817 constructor: function(params) { 818 var barPos, 819 scrollerPos0, 820 track, 821 resizePauseTimer, 822 scrollingTimer, 823 resizeLastFire, 824 oldBarSize 825 826 resizeLastFire = getTime() 827 828 this.params = params 829 this.event = params.event 830 this.events = {} 831 832 // DOM elements 833 this.root = params.root // Always html node, not just selector 834 this.scroller = qs(params.scroller) 835 if (process.env.NODE_ENV !== 'production') { 836 if (this.scroller.tagName == 'body') { 837 log('error', [ 838 'Please, do not use BODY as a scroller.', 839 'https://github.com/Diokuz/baron/blob/master/docs/logs/do-not-use-body.md' 840 ].join(', '), params) 841 } 842 } 843 this.bar = qs(params.bar, this.root) 844 track = this.track = qs(params.track, this.root) 845 if (!this.track && this.bar) { 846 track = this.bar.parentNode 847 } 848 this.clipper = this.scroller.parentNode 849 850 // Parameters 851 this.direction = params.direction 852 this.rtl = params.rtl 853 this.origin = origin[this.direction] 854 this.barOnCls = params.barOnCls 855 this.scrollingCls = params.scrollingCls 856 this.draggingCls = params.draggingCls 857 this.impact = params.impact 858 this.position = params.position 859 this.rtl = params.rtl 860 this.barTopLimit = 0 861 this.resizeDebounce = params.resizeDebounce 862 863 // Updating height or width of bar 864 function setBarSize(_size) { 865 var barMinSize = this.barMinSize || 20 866 var size = _size 867 868 if (size > 0 && size < barMinSize) { 869 size = barMinSize 870 } 871 872 if (this.bar) { 873 css(this.bar, this.origin.size, parseInt(size, 10) + 'px') 874 } 875 } 876 877 // Updating top or left bar position 878 function posBar(_pos) { 879 if (this.bar) { 880 var was = css(this.bar, this.origin.pos), 881 will = +_pos + 'px' 882 883 if (will && will != was) { 884 css(this.bar, this.origin.pos, will) 885 } 886 } 887 } 888 889 // Free path for bar 890 function k() { 891 return track[this.origin.client] - this.barTopLimit - this.bar[this.origin.offset] 892 } 893 894 // Relative content top position to bar top position 895 function relToPos(r) { 896 return r * k.call(this) + this.barTopLimit 897 } 898 899 // Bar position to relative content position 900 function posToRel(t) { 901 return (t - this.barTopLimit) / k.call(this) 902 } 903 904 // Cursor position in main direction in px // Now with iOs support 905 this.cursor = function(e) { 906 return e['client' + this.origin.x] || 907 (((e.originalEvent || e).touches || {})[0] || {})['page' + this.origin.x] 908 } 909 910 // Text selection pos preventing 911 function dontPosSelect() { 912 return false 913 } 914 915 this.pos = function(x) { // Absolute scroller position in px 916 var ie = 'page' + this.origin.x + 'Offset', 917 key = (this.scroller[ie]) ? ie : this.origin.scroll 918 919 if (x !== undefined) this.scroller[key] = x 920 921 return this.scroller[key] 922 } 923 924 this.rpos = function(r) { // Relative scroller position (0..1) 925 var free = this.scroller[this.origin.scrollSize] - this.scroller[this.origin.client], 926 x 927 928 if (r) { 929 x = this.pos(r * free) 930 } else { 931 x = this.pos() 932 } 933 934 return x / (free || 1) 935 } 936 937 // Switch on the bar by adding user-defined CSS classname to scroller 938 this.barOn = function(dispose) { 939 if (this.barOnCls) { 940 var noScroll = this.scroller[this.origin.client] >= this.scroller[this.origin.scrollSize] 941 942 if (dispose || noScroll) { 943 if (has(this.root, this.barOnCls)) { 944 rm(this.root, this.barOnCls) 945 } 946 } else if (!has(this.root, this.barOnCls)) { 947 add(this.root, this.barOnCls) 948 } 949 } 950 } 951 952 this._pos0 = function(e) { 953 scrollerPos0 = this.cursor(e) - barPos 954 } 955 956 this.drag = function(e) { 957 var rel = posToRel.call(this, this.cursor(e) - scrollerPos0) 958 var sub = (this.scroller[this.origin.scrollSize] - this.scroller[this.origin.client]) 959 960 this.scroller[this.origin.scroll] = rel * sub 961 } 962 963 // Text selection preventing on drag 964 this.selection = function(enable) { 965 this.event(document, 'selectpos selectstart', dontPosSelect, enable ? 'off' : 'on') 966 } 967 968 // onResize & DOM modified handler 969 // also fires on init 970 // Note: max/min-size didnt sets if size did not really changed (for example, on init in Chrome) 971 this.resize = function() { 972 var self = this 973 var minPeriod = (self.resizeDebounce === undefined) ? 300 : self.resizeDebounce 974 var delay = 0 975 976 if (getTime() - resizeLastFire < minPeriod) { 977 clearTimeout(resizePauseTimer) 978 delay = minPeriod 979 } 980 981 function upd() { 982 var offset = self.scroller[self.origin.crossOffset] 983 var client = self.scroller[self.origin.crossClient] 984 var padding = 0 985 var was, will 986 987 // https://github.com/Diokuz/baron/issues/110 988 if (isMacFF) { 989 padding = macmsxffScrollbarSize 990 991 // Opera 12 bug https://github.com/Diokuz/baron/issues/105 992 } else if (client > 0 && offset === 0) { 993 // Only Opera 12 in some rare nested flexbox cases goes here 994 // Sorry guys for magic, 995 // but I dont want to create temporary html-nodes set 996 // just for measuring scrollbar size in Opera 12. 997 // 17px for Windows XP-8.1, 15px for Mac (really rare). 998 offset = client + opera12maxScrollbarSize 999 } 1000 1001 if (offset) { // if there is no size, css should not be set 1002 self.barOn() 1003 1004 if (self.impact == 'scroller') { // scroller 1005 var delta = offset - client + padding 1006 1007 // `static` position works only for `scroller` impact 1008 if (self.position == 'static') { // static 1009 was = css(self.scroller, self.origin.crossSize) 1010 will = self.clipper[self.origin.crossClient] + delta + 'px' 1011 1012 if (was != will) { 1013 self._setCrossSizes(self.scroller, will) 1014 } 1015 } else { // absolute 1016 var styles = {} 1017 var key = self.rtl ? 'Left' : 'Right' 1018 1019 if (self.direction == 'h') { 1020 key = 'Bottom' 1021 } 1022 1023 styles['padding' + key] = delta + 'px' 1024 css(self.scroller, styles) 1025 } 1026 } else { // clipper 1027 was = css(self.clipper, self.origin.crossSize) 1028 will = client + 'px' 1029 1030 if (was != will) { 1031 self._setCrossSizes(self.clipper, will) 1032 } 1033 } 1034 } else { 1035 // do nothing (display: none, or something) 1036 } 1037 1038 Array.prototype.unshift.call(arguments, 'resize') 1039 fire.apply(self, arguments) 1040 1041 resizeLastFire = getTime() 1042 } 1043 1044 if (delay) { 1045 resizePauseTimer = setTimeout(upd, delay) 1046 } else { 1047 upd() 1048 } 1049 } 1050 1051 this.updatePositions = function(force) { 1052 var newBarSize, 1053 self = this 1054 1055 if (self.bar) { 1056 newBarSize = (track[self.origin.client] - self.barTopLimit) * 1057 self.scroller[self.origin.client] / self.scroller[self.origin.scrollSize] 1058 1059 // Positioning bar 1060 if (force || parseInt(oldBarSize, 10) != parseInt(newBarSize, 10)) { 1061 setBarSize.call(self, newBarSize) 1062 oldBarSize = newBarSize 1063 } 1064 1065 barPos = relToPos.call(self, self.rpos()) 1066 1067 posBar.call(self, barPos) 1068 } 1069 1070 Array.prototype.unshift.call( arguments, 'scroll' ) 1071 fire.apply(self, arguments) 1072 } 1073 1074 // onScroll handler 1075 this.scroll = function() { 1076 var self = this 1077 1078 self.updatePositions() 1079 1080 if (self.scrollingCls) { 1081 if (!scrollingTimer) { 1082 add(self.root, self.scrollingCls) 1083 } 1084 clearTimeout(scrollingTimer) 1085 scrollingTimer = setTimeout(function() { 1086 rm(self.root, self.scrollingCls) 1087 scrollingTimer = undefined 1088 }, 300) 1089 } 1090 } 1091 1092 // https://github.com/Diokuz/baron/issues/116 1093 this.clipperOnScroll = function() { 1094 // WTF is this line? https://github.com/Diokuz/baron/issues/134 1095 // if (this.direction == 'h') return 1096 1097 // assign `initial scroll position` to `clipper.scrollLeft` (0 for ltr, ~20 for rtl) 1098 if (!this.rtl) { 1099 this.clipper[this.origin.scrollEdge] = 0 1100 } else { 1101 this.clipper[this.origin.scrollEdge] = this.clipper[this.origin.scrollSize] 1102 } 1103 } 1104 1105 // Flexbox `align-items: stretch` (default) requires to set min-width for vertical 1106 // and max-height for horizontal scroll. Just set them all. 1107 // http://www.w3.org/TR/css-flexbox-1/#valdef-align-items-stretch 1108 this._setCrossSizes = function(node, size) { 1109 var styles = {} 1110 1111 styles[this.origin.crossSize] = size 1112 styles[this.origin.crossMinSize] = size 1113 styles[this.origin.crossMaxSize] = size 1114 1115 css(node, styles) 1116 } 1117 1118 // Set common css rules 1119 this._dumbCss = function(on) { 1120 if (params.cssGuru) return 1121 1122 var overflow = on ? 'hidden' : null 1123 var msOverflowStyle = on ? 'none' : null 1124 1125 css(this.clipper, { 1126 overflow: overflow, 1127 msOverflowStyle: msOverflowStyle, 1128 position: this.position == 'static' ? '' : 'relative' 1129 }) 1130 1131 var scroll = on ? 'scroll' : null 1132 var axis = this.direction == 'v' ? 'y' : 'x' 1133 var scrollerCss = {} 1134 1135 scrollerCss['overflow-' + axis] = scroll 1136 scrollerCss['box-sizing'] = 'border-box' 1137 scrollerCss.margin = '0' 1138 scrollerCss.border = '0' 1139 1140 if (this.position == 'absolute') { 1141 scrollerCss.position = 'absolute' 1142 scrollerCss.top = '0' 1143 1144 if (this.direction == 'h') { 1145 scrollerCss.left = scrollerCss.right = '0' 1146 } else { 1147 scrollerCss.bottom = '0' 1148 scrollerCss.right = this.rtl ? '0' : '' 1149 scrollerCss.left = this.rtl ? '' : '0' 1150 } 1151 } 1152 1153 css(this.scroller, scrollerCss) 1154 } 1155 1156 // onInit actions 1157 this._dumbCss(true) 1158 1159 if (isMacFF) { 1160 var padding = 'paddingRight' 1161 var styles = {} 1162 // getComputedStyle is ie9+, but we here only in f ff 1163 var paddingWas = scopedWindow.getComputedStyle(this.scroller)[[padding]] 1164 1165 if (params.direction == 'h') { 1166 padding = 'paddingBottom' 1167 } else if (params.rtl) { 1168 padding = 'paddingLeft' 1169 } 1170 1171 var numWas = parseInt(paddingWas, 10) 1172 1173 if (numWas != numWas) numWas = 0 1174 styles[padding] = (macmsxffScrollbarSize + numWas) + 'px' 1175 css(this.scroller, styles) 1176 } 1177 1178 return this 1179 }, 1180 1181 // fires on any update and on init 1182 update: function(params) { 1183 if (process.env.NODE_ENV !== 'production') { 1184 if (this._disposed) { 1185 log('error', [ 1186 'Update on disposed baron instance detected.', 1187 'You should clear your stored baron value for this instance:', 1188 this 1189 ].join(' '), params) 1190 } 1191 } 1192 1193 fire.call(this, 'upd', params) // Update all plugins' params 1194 1195 this.resize(1) 1196 this.updatePositions(1) 1197 1198 return this 1199 }, 1200 1201 // One instance 1202 dispose: function() { 1203 if (process.env.NODE_ENV !== 'production') { 1204 if (this._disposed) { 1205 log('error', 'Already disposed:', this) 1206 } 1207 1208 liveBarons-- 1209 } 1210 1211 manageEvents(this, this.event, 'off') 1212 manageAttr(this.root, this.params.direction, 'off') 1213 if (this.params.direction == 'v') { 1214 this._setCrossSizes(this.scroller, '') 1215 } else { 1216 this._setCrossSizes(this.clipper, '') 1217 } 1218 this._dumbCss(false) 1219 this.barOn(true) 1220 fire.call(this, 'dispose') 1221 instances[this.params.index] = null 1222 this.params = null 1223 this._disposed = true 1224 }, 1225 1226 on: function(eventName, func, arg) { 1227 var names = eventName.split(' ') 1228 1229 for (var i = 0; i < names.length; i++) { 1230 if (names[i] == 'init') { 1231 func.call(this, arg) 1232 } else { 1233 this.events[names[i]] = this.events[names[i]] || [] 1234 1235 this.events[names[i]].push(function(userArg) { 1236 func.call(this, userArg || arg) 1237 }) 1238 } 1239 } 1240 }, 1241 1242 baron: function(params) { 1243 params.root = this.params.root 1244 params.scroller = this.params.scroller 1245 params.direction = (this.params.direction == 'v') ? 'h' : 'v' 1246 params._chain = true 1247 1248 return baron(params) 1249 } 1250} 1251 1252// baron.fn.constructor.prototype = baron.fn 1253baron.prototype.constructor.prototype = baron.prototype 1254 1255// Use when you need "baron" global var for another purposes 1256baron.noConflict = function() { 1257 scopedWindow.baron = _baron // Restoring original value of "baron" global var 1258 1259 return baron 1260} 1261 1262baron.version = '3.0.1' 1263 1264baron.prototype.autoUpdate = __webpack_require__(4)(scopedWindow) 1265baron.prototype.fix = __webpack_require__(7) 1266baron.prototype.controls = __webpack_require__(6) 1267 1268module.exports = baron 1269 1270/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) 1271 1272/***/ }), 1273/* 4 */ 1274/***/ (function(module, exports, __webpack_require__) { 1275 1276"use strict"; 1277 1278 1279/* Autoupdate plugin for baron 0.6+ */ 1280 1281function autoUpdateOne(MutationObserver) { 1282 var self = this 1283 var watcher 1284 1285 if (this._au) { 1286 return 1287 } 1288 1289 function actualizeWatcher() { 1290 if (!self.root[self.origin.offset]) { 1291 startWatch() 1292 } else { 1293 stopWatch() 1294 } 1295 } 1296 1297 // Set interval timeout for watching when root node will be visible 1298 function startWatch() { 1299 if (watcher) return 1300 1301 watcher = setInterval(function() { 1302 if (self.root[self.origin.offset]) { 1303 stopWatch() 1304 self.update() 1305 } 1306 }, 300) // is it good enought for you?) 1307 } 1308 1309 function stopWatch() { 1310 clearInterval(watcher) 1311 watcher = null 1312 } 1313 1314 var debouncedUpdater = self._debounce(function() { 1315 self.update() 1316 }, 300) 1317 1318 this._observer = new MutationObserver(function() { 1319 actualizeWatcher() 1320 self.update() 1321 debouncedUpdater() 1322 }) 1323 1324 this.on('init', function() { 1325 self._observer.observe(self.root, { 1326 childList: true, 1327 subtree: true, 1328 characterData: true 1329 // attributes: true 1330 // No reasons to set attributes to true 1331 // The case when root/child node with already properly inited baron toggled to hidden and then back to visible, 1332 // and the size of parent was changed during that hidden state, is very rare 1333 // Other cases are covered by watcher, and you still can do .update by yourself 1334 }) 1335 1336 actualizeWatcher() 1337 }) 1338 1339 this.on('dispose', function() { 1340 self._observer.disconnect() 1341 stopWatch() 1342 delete self._observer 1343 }) 1344 1345 this._au = true 1346} 1347 1348module.exports = function autoUpdateCreator(win) { 1349 var MutationObserver = win.MutationObserver || win.WebKitMutationObserver || win.MozMutationObserver || null 1350 1351 return function autoUpdate() { 1352 if (!MutationObserver) return this 1353 1354 autoUpdateOne.call(this, MutationObserver) 1355 1356 return this 1357 } 1358} 1359 1360 1361/***/ }), 1362/* 5 */ 1363/***/ (function(module, exports, __webpack_require__) { 1364 1365var _baron = __webpack_require__(3) 1366 1367window.baron = _baron 1368 1369if (window.jQuery && window.jQuery.fn) { 1370 window.jQuery.fn.baron = _baron 1371} 1372 1373 1374/***/ }), 1375/* 6 */ 1376/***/ (function(module, exports, __webpack_require__) { 1377 1378"use strict"; 1379 1380 1381/* Controls plugin for baron */ 1382 1383var qs = __webpack_require__(0).qs 1384 1385module.exports = function controls(params) { 1386 var forward, backward, track, screen, 1387 self = this, 1388 event 1389 1390 screen = params.screen || 0.9 1391 1392 if (params.forward) { 1393 forward = qs(params.forward, this.clipper) 1394 1395 event = { 1396 element: forward, 1397 1398 handler: function() { 1399 var y = self.pos() + (params.delta || 30) 1400 1401 self.pos(y) 1402 }, 1403 1404 type: 'click' 1405 } 1406 1407 this._eventHandlers.push(event) // For auto-dispose 1408 this.event(event.element, event.type, event.handler, 'on') 1409 } 1410 1411 if (params.backward) { 1412 backward = qs(params.backward, this.clipper) 1413 1414 event = { 1415 element: backward, 1416 1417 handler: function() { 1418 var y = self.pos() - (params.delta || 30) 1419 1420 self.pos(y) 1421 }, 1422 1423 type: 'click' 1424 } 1425 1426 this._eventHandlers.push(event) // For auto-dispose 1427 this.event(event.element, event.type, event.handler, 'on') 1428 } 1429 1430 if (params.track) { 1431 if (params.track === true) { 1432 track = this.track 1433 } else { 1434 track = qs(params.track, this.clipper) 1435 } 1436 1437 if (track) { 1438 event = { 1439 element: track, 1440 1441 handler: function(e) { 1442 // https://github.com/Diokuz/baron/issues/121 1443 if (e.target != track) return 1444 1445 var x = e['offset' + self.origin.x], 1446 xBar = self.bar[self.origin.offsetPos], 1447 sign = 0 1448 1449 if (x < xBar) { 1450 sign = -1 1451 } else if (x > xBar + self.bar[self.origin.offset]) { 1452 sign = 1 1453 } 1454 1455 var y = self.pos() + sign * screen * self.scroller[self.origin.client] 1456 1457 self.pos(y) 1458 }, 1459 1460 type: 'mousedown' 1461 } 1462 1463 this._eventHandlers.push(event) // For auto-dispose 1464 this.event(event.element, event.type, event.handler, 'on') 1465 } 1466 } 1467} 1468 1469 1470/***/ }), 1471/* 7 */ 1472/***/ (function(module, exports, __webpack_require__) { 1473 1474"use strict"; 1475/* WEBPACK VAR INJECTION */(function(process) { 1476 1477/* Fixable elements plugin for baron */ 1478 1479var log = __webpack_require__(2) 1480var css = __webpack_require__(0).css 1481var add = __webpack_require__(0).add 1482var rm = __webpack_require__(0).rm 1483 1484module.exports = function fix(userParams) { 1485 var elements, 1486 viewPortSize, 1487 params = { // Default params 1488 outside: '', 1489 inside: '', 1490 before: '', 1491 after: '', 1492 past: '', 1493 future: '', 1494 radius: 0, 1495 minView: 0 1496 }, 1497 topFixHeights = [], // inline style for element 1498 topRealHeights = [], // ? something related to negative margins for fixable elements 1499 headerTops = [], // offset positions when not fixed 1500 scroller = this.scroller, 1501 eventManager = this.event, 1502 self = this 1503 1504 if (process.env.NODE_ENV !== 'production') { 1505 if (this.position != 'static') { 1506 log('error', [ 1507 'Fix plugin cannot work properly in non-static baron position.', 1508 'See more https://github.com/Diokuz/baron/issues/135' 1509 ].join(' '), this.params) 1510 } 1511 } 1512 1513 // i - number of fixing element, pos - fix-position in px, flag - 1: top, 2: bottom 1514 // Invocation only in case when fix-state changed 1515 function fixElement(i, _pos, flag) { 1516 var pos = _pos 1517 var ori = flag == 1 ? 'pos' : 'oppos' 1518 1519 if (viewPortSize < (params.minView || 0)) { // No headers fixing when no enought space for viewport 1520 pos = undefined 1521 } 1522 1523 // Removing all fixing stuff - we can do this because fixElement triggers only when fixState really changed 1524 css(elements[i], this.origin.pos, '') 1525 css(elements[i], this.origin.oppos, '') 1526 rm(elements[i], params.outside) 1527 1528 // Fixing if needed 1529 if (pos !== undefined) { 1530 pos += 'px' 1531 css(elements[i], this.origin[ori], pos) 1532 add(elements[i], params.outside) 1533 } 1534 } 1535 1536 function bubbleWheel(e) { 1537 try { 1538 var i = document.createEvent('WheelEvent') // i - for extra byte 1539 1540 // evt.initWebKitWheelEvent(deltaX, deltaY, window, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey) 1541 i.initWebKitWheelEvent(e.originalEvent.wheelDeltaX, e.originalEvent.wheelDeltaY) 1542 scroller.dispatchEvent(i) 1543 e.preventDefault() 1544 } catch (ex) { 1545 // 1546 } 1547 } 1548 1549 function init(_params) { 1550 var pos 1551 1552 for (var key in _params) { 1553 params[key] = _params[key] 1554 } 1555 1556 if (params.elements instanceof HTMLElement) { 1557 elements = [params.elements] 1558 } else if (typeof params.elements == 'string') { 1559 elements = this.scroller.querySelectorAll(params.elements) 1560 } else if (params.elements && params.elements[0] instanceof HTMLElement) { 1561 elements = params.elements 1562 } 1563 1564 if (elements) { 1565 viewPortSize = this.scroller[this.origin.client] 1566 for (var i = 0; i < elements.length; i++) { 1567 // Variable header heights 1568 pos = {} 1569 pos[this.origin.size] = elements[i][this.origin.offset] + 'px' 1570 if (elements[i].parentNode !== this.scroller) { 1571 css(elements[i].parentNode, pos) 1572 } 1573 pos = {} 1574 pos[this.origin.crossSize] = elements[i].parentNode[this.origin.crossClient] + 'px' 1575 css(elements[i], pos) 1576 1577 // Between fixed headers 1578 viewPortSize -= elements[i][this.origin.offset] 1579 1580 headerTops[i] = elements[i].parentNode[this.origin.offsetPos] // No paddings for parentNode 1581 1582 // Summary elements height above current 1583 topFixHeights[i] = (topFixHeights[i - 1] || 0) // Not zero because of negative margins 1584 topRealHeights[i] = (topRealHeights[i - 1] || Math.min(headerTops[i], 0)) 1585 1586 if (elements[i - 1]) { 1587 topFixHeights[i] += elements[i - 1][this.origin.offset] 1588 topRealHeights[i] += elements[i - 1][this.origin.offset] 1589 } 1590 1591 if ( !(i == 0 && headerTops[i] == 0)/* && force */) { 1592 this.event(elements[i], 'mousewheel', bubbleWheel, 'off') 1593 this.event(elements[i], 'mousewheel', bubbleWheel) 1594 } 1595 } 1596 1597 if (params.limiter && elements[0]) { // Bottom edge of first header as top limit for track 1598 if (this.track && this.track != this.scroller) { 1599 pos = {} 1600 pos[this.origin.pos] = elements[0].parentNode[this.origin.offset] + 'px' 1601 css(this.track, pos) 1602 } else { 1603 this.barTopLimit = elements[0].parentNode[this.origin.offset] 1604 } 1605 // this.barTopLimit = elements[0].parentNode[this.origin.offset] 1606 this.scroll() 1607 } 1608 1609 if (params.limiter === false) { // undefined (in second fix instance) should have no influence on bar limit 1610 this.barTopLimit = 0 1611 } 1612 } 1613 1614 var event = { 1615 element: elements, 1616 1617 handler: function() { 1618 var parent = this.parentNode, 1619 top = parent.offsetTop, 1620 num 1621 1622 // finding num -> elements[num] === this 1623 for (var j = 0; j < elements.length; j++ ) { 1624 if (elements[j] === this) num = j 1625 } 1626 1627 var locPos = top - topFixHeights[num] 1628 1629 if (params.scroll) { // User defined callback 1630 params.scroll({ 1631 x1: self.scroller.scrollTop, 1632 x2: locPos 1633 }) 1634 } else { 1635 self.scroller.scrollTop = locPos 1636 } 1637 }, 1638 1639 type: 'click' 1640 } 1641 1642 if (params.clickable) { 1643 this._eventHandlers.push(event) // For auto-dispose 1644 // eventManager(event.element, event.type, event.handler, 'off') 1645 for (var j = 0; j < event.element.length; j++) { 1646 eventManager(event.element[j], event.type, event.handler, 'on') 1647 } 1648 } 1649 } 1650 1651 this.on('init', init, userParams) 1652 1653 var fixFlag = [], // 1 - past, 2 - future, 3 - current (not fixed) 1654 gradFlag = [] 1655 1656 this.on('init scroll', function() { 1657 var fixState, hTop, gradState 1658 var i 1659 1660 if (elements) { 1661 var change 1662 1663 // fixFlag update 1664 for (i = 0; i < elements.length; i++) { 1665 fixState = 0 1666 if (headerTops[i] - this.pos() < topRealHeights[i] + params.radius) { 1667 // Header trying to go up 1668 fixState = 1 1669 hTop = topFixHeights[i] 1670 } else if (headerTops[i] - this.pos() > topRealHeights[i] + viewPortSize - params.radius) { 1671 // Header trying to go down 1672 fixState = 2 1673 // console.log('topFixHeights[i] + viewPortSize + topRealHeights[i]', topFixHeights[i], this.scroller[this.origin.client], topRealHeights[i]) 1674 hTop = this.scroller[this.origin.client] - elements[i][this.origin.offset] - topFixHeights[i] - viewPortSize 1675 // console.log('hTop', hTop, viewPortSize, elements[this.origin.offset], topFixHeights[i]) 1676 // (topFixHeights[i] + viewPortSize + elements[this.origin.offset]) - this.scroller[this.origin.client] 1677 } else { 1678 // Header in viewport 1679 fixState = 3 1680 hTop = undefined 1681 } 1682 1683 gradState = false 1684 if (headerTops[i] - this.pos() < topRealHeights[i] || headerTops[i] - this.pos() > topRealHeights[i] + viewPortSize) { 1685 gradState = true 1686 } 1687 1688 if (fixState != fixFlag[i] || gradState != gradFlag[i]) { 1689 fixElement.call(this, i, hTop, fixState) 1690 fixFlag[i] = fixState 1691 gradFlag[i] = gradState 1692 change = true 1693 } 1694 } 1695 1696 // Adding positioning classes (on last top and first bottom header) 1697 if (change) { // At leats one change in elements flag structure occured 1698 for (i = 0; i < elements.length; i++) { 1699 if (fixFlag[i] == 1 && params.past) { 1700 add(elements[i], params.past) 1701 rm(elements[i], params.future) 1702 } 1703 1704 if (fixFlag[i] == 2 && params.future) { 1705 add(elements[i], params.future) 1706 rm(elements[i], params.past) 1707 } 1708 1709 if (fixFlag[i] == 3) { 1710 rm(elements[i], params.past) 1711 rm(elements[i], params.future) 1712 add(elements[i], params.inside) 1713 } 1714 1715 if (fixFlag[i] != fixFlag[i + 1] && fixFlag[i] == 1) { 1716 add(elements[i], params.before) 1717 rm(elements[i], params.after) // Last top fixed header 1718 } else if (fixFlag[i] != fixFlag[i - 1] && fixFlag[i] == 2) { 1719 add(elements[i], params.after) 1720 rm(elements[i], params.before) // First bottom fixed header 1721 } else { 1722 rm(elements[i], params.before) 1723 rm(elements[i], params.after) 1724 } 1725 1726 if (params.grad) { 1727 if (gradFlag[i]) { 1728 add(elements[i], params.grad) 1729 } else { 1730 rm(elements[i], params.grad) 1731 } 1732 } 1733 } 1734 } 1735 } 1736 }) 1737 1738 this.on('resize upd', function(updParams) { 1739 init.call(this, updParams && updParams.fix) 1740 }) 1741 1742 return this 1743} 1744 1745/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1))) 1746 1747/***/ }) 1748/******/ ]);
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.