| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356 |
- module.exports =
- /******/ (function(modules) { // webpackBootstrap
- /******/ // The module cache
- /******/ var installedModules = {};
- /******/ // The require function
- /******/ function __webpack_require__(moduleId) {
- /******/ // Check if module is in cache
- /******/ if(installedModules[moduleId])
- /******/ return installedModules[moduleId].exports;
- /******/ // Create a new module (and put it into the cache)
- /******/ var module = installedModules[moduleId] = {
- /******/ i: moduleId,
- /******/ l: false,
- /******/ exports: {}
- /******/ };
- /******/ // Execute the module function
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
- /******/ // Flag the module as loaded
- /******/ module.l = true;
- /******/ // Return the exports of the module
- /******/ return module.exports;
- /******/ }
- /******/ // expose the modules object (__webpack_modules__)
- /******/ __webpack_require__.m = modules;
- /******/ // expose the module cache
- /******/ __webpack_require__.c = installedModules;
- /******/ // identity function for calling harmony imports with the correct context
- /******/ __webpack_require__.i = function(value) { return value; };
- /******/ // define getter function for harmony exports
- /******/ __webpack_require__.d = function(exports, name, getter) {
- /******/ if(!__webpack_require__.o(exports, name)) {
- /******/ Object.defineProperty(exports, name, {
- /******/ configurable: false,
- /******/ enumerable: true,
- /******/ get: getter
- /******/ });
- /******/ }
- /******/ };
- /******/ // getDefaultExport function for compatibility with non-harmony modules
- /******/ __webpack_require__.n = function(module) {
- /******/ var getter = module && module.__esModule ?
- /******/ function getDefault() { return module['default']; } :
- /******/ function getModuleExports() { return module; };
- /******/ __webpack_require__.d(getter, 'a', getter);
- /******/ return getter;
- /******/ };
- /******/ // Object.prototype.hasOwnProperty.call
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
- /******/ // __webpack_public_path__
- /******/ __webpack_require__.p = "";
- /******/ // Load entry module and return exports
- /******/ return __webpack_require__(__webpack_require__.s = 222);
- /******/ })
- /************************************************************************/
- /******/ ({
- /***/ 1:
- /***/ function(module, exports) {
- module.exports = require("vue");
- /***/ },
- /***/ 222:
- /***/ function(module, exports, __webpack_require__) {
- module.exports = __webpack_require__(30);
- /***/ },
- /***/ 30:
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- Object.defineProperty(exports, "__esModule", { value: true });
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_mint_ui_src_style_empty_css__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_mint_ui_src_style_empty_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_mint_ui_src_style_empty_css__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__src_infinite_scroll_js__ = __webpack_require__(88);
- /* harmony reexport (binding) */ __webpack_require__.d(exports, "default", function() { return __WEBPACK_IMPORTED_MODULE_1__src_infinite_scroll_js__["a"]; });
- /***/ },
- /***/ 5:
- /***/ function(module, exports) {
- // removed by extract-text-webpack-plugin
- /***/ },
- /***/ 87:
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(1);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0_vue__);
- var ctx = '@@InfiniteScroll';
- var throttle = function(fn, delay) {
- var now, lastExec, timer, context, args; //eslint-disable-line
- var execute = function() {
- fn.apply(context, args);
- lastExec = now;
- };
- return function() {
- context = this;
- args = arguments;
- now = Date.now();
- if (timer) {
- clearTimeout(timer);
- timer = null;
- }
- if (lastExec) {
- var diff = delay - (now - lastExec);
- if (diff < 0) {
- execute();
- } else {
- timer = setTimeout(function () {
- execute();
- }, diff);
- }
- } else {
- execute();
- }
- };
- };
- var getScrollTop = function(element) {
- if (element === window) {
- return Math.max(window.pageYOffset || 0, document.documentElement.scrollTop);
- }
- return element.scrollTop;
- };
- var getComputedStyle = __WEBPACK_IMPORTED_MODULE_0_vue___default.a.prototype.$isServer ? {} : document.defaultView.getComputedStyle;
- var getScrollEventTarget = function(element) {
- var currentNode = element;
- // bugfix, see http://w3help.org/zh-cn/causes/SD9013 and http://stackoverflow.com/questions/17016740/onscroll-function-is-not-working-for-chrome
- while (currentNode && currentNode.tagName !== 'HTML' && currentNode.tagName !== 'BODY' && currentNode.nodeType === 1) {
- var overflowY = getComputedStyle(currentNode).overflowY;
- if (overflowY === 'scroll' || overflowY === 'auto') {
- return currentNode;
- }
- currentNode = currentNode.parentNode;
- }
- return window;
- };
- var getVisibleHeight = function(element) {
- if (element === window) {
- return document.documentElement.clientHeight;
- }
- return element.clientHeight;
- };
- var getElementTop = function(element) {
- if (element === window) {
- return getScrollTop(window);
- }
- return element.getBoundingClientRect().top + getScrollTop(window);
- };
- var isAttached = function(element) {
- var currentNode = element.parentNode;
- while (currentNode) {
- if (currentNode.tagName === 'HTML') {
- return true;
- }
- if (currentNode.nodeType === 11) {
- return false;
- }
- currentNode = currentNode.parentNode;
- }
- return false;
- };
- var doBind = function() {
- if (this.binded) return; // eslint-disable-line
- this.binded = true;
- var directive = this;
- var element = directive.el;
- directive.scrollEventTarget = getScrollEventTarget(element);
- directive.scrollListener = throttle(doCheck.bind(directive), 200);
- directive.scrollEventTarget.addEventListener('scroll', directive.scrollListener);
- var disabledExpr = element.getAttribute('infinite-scroll-disabled');
- var disabled = false;
- if (disabledExpr) {
- this.vm.$watch(disabledExpr, function(value) {
- directive.disabled = value;
- if (!value && directive.immediateCheck) {
- doCheck.call(directive);
- }
- });
- disabled = Boolean(directive.vm[disabledExpr]);
- }
- directive.disabled = disabled;
- var distanceExpr = element.getAttribute('infinite-scroll-distance');
- var distance = 0;
- if (distanceExpr) {
- distance = Number(directive.vm[distanceExpr] || distanceExpr);
- if (isNaN(distance)) {
- distance = 0;
- }
- }
- directive.distance = distance;
- var immediateCheckExpr = element.getAttribute('infinite-scroll-immediate-check');
- var immediateCheck = true;
- if (immediateCheckExpr) {
- immediateCheck = Boolean(directive.vm[immediateCheckExpr]);
- }
- directive.immediateCheck = immediateCheck;
- if (immediateCheck) {
- doCheck.call(directive);
- }
- var eventName = element.getAttribute('infinite-scroll-listen-for-event');
- if (eventName) {
- directive.vm.$on(eventName, function() {
- doCheck.call(directive);
- });
- }
- };
- var doCheck = function(force) {
- var scrollEventTarget = this.scrollEventTarget;
- var element = this.el;
- var distance = this.distance;
- if (force !== true && this.disabled) return; //eslint-disable-line
- var viewportScrollTop = getScrollTop(scrollEventTarget);
- var viewportBottom = viewportScrollTop + getVisibleHeight(scrollEventTarget);
- var shouldTrigger = false;
- if (scrollEventTarget === element) {
- shouldTrigger = scrollEventTarget.scrollHeight - viewportBottom <= distance;
- } else {
- var elementBottom = getElementTop(element) - getElementTop(scrollEventTarget) + element.offsetHeight + viewportScrollTop;
- shouldTrigger = viewportBottom + distance >= elementBottom;
- }
- if (shouldTrigger && this.expression) {
- this.expression();
- }
- };
- /* harmony default export */ exports["a"] = {
- bind: function bind(el, binding, vnode) {
- el[ctx] = {
- el: el,
- vm: vnode.context,
- expression: binding.value
- };
- var args = arguments;
- var cb = function() {
- el[ctx].vm.$nextTick(function() {
- if (isAttached(el)) {
- doBind.call(el[ctx], args);
- }
- el[ctx].bindTryCount = 0;
- var tryBind = function() {
- if (el[ctx].bindTryCount > 10) return; //eslint-disable-line
- el[ctx].bindTryCount++;
- if (isAttached(el)) {
- doBind.call(el[ctx], args);
- } else {
- setTimeout(tryBind, 50);
- }
- };
- tryBind();
- });
- };
- if (el[ctx].vm._isMounted) {
- cb();
- return;
- }
- el[ctx].vm.$on('hook:mounted', cb);
- },
- unbind: function unbind(el) {
- if (el[ctx] && el[ctx].scrollEventTarget) {
- el[ctx].scrollEventTarget.removeEventListener('scroll', el[ctx].scrollListener);
- }
- }
- };
- /***/ },
- /***/ 88:
- /***/ function(module, exports, __webpack_require__) {
- "use strict";
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__directive__ = __webpack_require__(87);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_mint_ui_src_style_empty_css__ = __webpack_require__(5);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_1_mint_ui_src_style_empty_css___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1_mint_ui_src_style_empty_css__);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue__ = __webpack_require__(1);
- /* harmony import */ var __WEBPACK_IMPORTED_MODULE_2_vue___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2_vue__);
- var install = function(Vue) {
- Vue.directive('InfiniteScroll', __WEBPACK_IMPORTED_MODULE_0__directive__["a" /* default */]);
- };
- if (!__WEBPACK_IMPORTED_MODULE_2_vue___default.a.prototype.$isServer && window.Vue) {
- window.infiniteScroll = __WEBPACK_IMPORTED_MODULE_0__directive__["a" /* default */];
- __WEBPACK_IMPORTED_MODULE_2_vue___default.a.use(install); // eslint-disable-line
- }
- __WEBPACK_IMPORTED_MODULE_0__directive__["a" /* default */].install = install;
- /* harmony default export */ exports["a"] = __WEBPACK_IMPORTED_MODULE_0__directive__["a" /* default */];
- /***/ }
- /******/ });
|