diff --git a/dist/idle-timeout.js b/dist/idle-timeout.js index 284645c..391038a 100644 --- a/dist/idle-timeout.js +++ b/dist/idle-timeout.js @@ -2,7 +2,7 @@ /*! * IdleTimeout * - * @version 0.0.2 + * @version 0.0.3 * @overview A basic idle state detector written in ES6. * @author Jacob Müller [jacob.mueller.elz@gmail.com] * @see {@link https://github.com/jackmu95/idle-timeout|GitHub} @@ -28,8 +28,6 @@ var IdleTimeout = function () { _classCallCheck(this, IdleTimeout); - this.CLASS_NAME = 'IdleTimeout'; - this._timeoutFunction = null; this._idle = false; @@ -38,6 +36,8 @@ var IdleTimeout = function () { }; this._eventNames = ['DOMMouseScroll', 'mousedown', 'mousemove', 'mousewheel', 'MSPointerDown', 'MSPointerMove', 'keydown', 'touchmove', 'touchstart', 'wheel']; + this._startTime = null; + this._remainingTime = null; this._lastPageX = -1; this._lastPageY = -1; @@ -77,11 +77,17 @@ var IdleTimeout = function () { this._timeoutFunction = setTimeout(function () { _this3._handleTimeout(); - }, this._options.timeout); + }, this._remainingTime || this._options.timeout); + + this._startTime = new Date().getTime(); } }, { key: '_handleEvent', value: function _handleEvent(event) { + if (this._remainingTime) { + return false; + } + if (event.type === 'mousemove') { if (typeof event.pageX === 'undefined' && typeof event.pageY === 'undefined' || event.pageX === this._lastPageX && event.pageY === this._lastPageY) { return; @@ -101,10 +107,36 @@ var IdleTimeout = function () { this._callback(); } + }, { + key: 'pause', + value: function pause() { + var remainingTime = this._startTime + this._options.timeout - new Date().getTime(); + if (remainingTime <= 0) { + return; + } + + this._remainingTime = remainingTime; + + if (this._timeoutFunction) { + clearTimeout(this._timeoutFunction); + this._timeoutFunction = null; + } + } + }, { + key: 'resume', + value: function resume() { + if (!this._remainingTime) { + return; + } + + this._reset(); + this._remainingTime = null; + } }, { key: 'reset', value: function reset() { this._idle = false; + this._remainingTime = null; this._reset(); } }, { @@ -124,6 +156,8 @@ var IdleTimeout = function () { this._idle = null; this._boundHandleEvent = null; this._eventNames = null; + this._startTime = null; + this._remainingTime = null; this._lastPageX = null; this._lastPageY = null; this._callback = null; @@ -191,4 +225,4 @@ function extend(baseObject) { } },{}]},{},[1]) -//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vZGVfbW9kdWxlcy9icm93c2VyLXBhY2svX3ByZWx1ZGUuanMiLCJzcmMvaW5kZXguanMiLCJzcmMvdXRpbHMuanMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7Ozs7Ozs7QUNTQTs7Ozs7Ozs7QUFFQTs7OztJQUVNO0FBQ0osV0FESSxXQUNKLENBQVksUUFBWixFQUFvQzs7O1FBQWQsZ0VBQVUsa0JBQUk7OzBCQURoQyxhQUNnQzs7QUFDbEMsU0FBSyxVQUFMLEdBQWtCLGFBQWxCLENBRGtDOztBQUdsQyxTQUFLLGdCQUFMLEdBQXdCLElBQXhCLENBSGtDO0FBSWxDLFNBQUssS0FBTCxHQUFhLEtBQWIsQ0FKa0M7O0FBTWxDLFNBQUssaUJBQUwsR0FBeUI7YUFBUyxNQUFLLFlBQUwsQ0FBa0IsS0FBbEI7S0FBVCxDQU5TO0FBT2xDLFNBQUssV0FBTCxHQUFtQixDQUNqQixnQkFEaUIsRUFFakIsV0FGaUIsRUFFSixXQUZJLEVBRVMsWUFGVCxFQUdqQixlQUhpQixFQUdBLGVBSEEsRUFJakIsU0FKaUIsRUFLakIsV0FMaUIsRUFLSixZQUxJLEVBTWpCLE9BTmlCLENBQW5CLENBUGtDOztBQWdCbEMsU0FBSyxVQUFMLEdBQWtCLENBQUMsQ0FBRCxDQWhCZ0I7QUFpQmxDLFNBQUssVUFBTCxHQUFrQixDQUFDLENBQUQsQ0FqQmdCOztBQW1CbEMsU0FBSyxTQUFMLEdBQWlCLFFBQWpCLENBbkJrQztBQW9CbEMsU0FBSyxRQUFMLEdBQWdCLG1CQUFPO0FBQ3JCLGVBQVMsS0FBSyxJQUFMLEdBQVksQ0FBWjtBQ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AgIH1cbiAgfSk7XG5cbiAgcmV0dXJuIGJhc2VPYmplY3Q7XG59XG4iXX0= diff --git a/dist/idle-timeout.min.js b/dist/idle-timeout.min.js index 52016b8..225c9b4 100644 --- a/dist/idle-timeout.min.js +++ b/dist/idle-timeout.min.js @@ -1,2 +1,2 @@ -/*! IdleTimeout v0.0.2 | https://github.com/jackmu95/idle-timeout/ | (c) 2016 Jacob Müller */ -!function t(e,n,i){function o(s,r){if(!n[s]){if(!e[s]){var l="function"==typeof require&&require;if(!r&&l)return l(s,!0);if(u)return u(s,!0);var a=new Error("Cannot find module '"+s+"'");throw a.code="MODULE_NOT_FOUND",a}var h=n[s]={exports:{}};e[s][0].call(h.exports,function(t){var n=e[s][1][t];return o(n?n:t)},h,h.exports,t,e,n,i)}return n[s].exports}for(var u="function"==typeof require&&require,s=0;s1?e-1:0),i=1;e>i;i++)n[i-1]=arguments[i];return n.forEach(function(e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}),t}Object.defineProperty(n,"__esModule",{value:!0}),n.extend=i},{}]},{},[1]); \ No newline at end of file +/*! IdleTimeout v0.0.3 | https://github.com/jackmu95/idle-timeout/ | (c) 2016 Jacob Müller */ +!function t(e,i,n){function o(s,r){if(!i[s]){if(!e[s]){var a="function"==typeof require&&require;if(!r&&a)return a(s,!0);if(u)return u(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var h=i[s]={exports:{}};e[s][0].call(h.exports,function(t){var i=e[s][1][t];return o(i?i:t)},h,h.exports,t,e,i,n)}return i[s].exports}for(var u="function"==typeof require&&require,s=0;s=t||(this._remainingTime=t,this._timeoutFunction&&(clearTimeout(this._timeoutFunction),this._timeoutFunction=null))}},{key:"resume",value:function(){this._remainingTime&&(this._reset(),this._remainingTime=null)}},{key:"reset",value:function(){this._idle=!1,this._remainingTime=null,this._reset()}},{key:"destroy",value:function(){var t=this;this._eventNames.forEach(function(e){document.removeEventListener(e,t._boundHandleEvent)}),this._timeoutFunction&&clearTimeout(this._timeoutFunction),this._timeoutFunction=null,this._idle=null,this._boundHandleEvent=null,this._eventNames=null,this._startTime=null,this._remainingTime=null,this._lastPageX=null,this._lastPageY=null,this._callback=null,this._options=null}},{key:"idle",get:function(){return this._idle},set:function(t){t?this._handleTimeout():this.reset()}},{key:"timeout",set:function(t){this._options.timeout=t}},{key:"loop",set:function(t){this._options.loop=t}}]),t}();window.IdleTimeout=s,i["default"]=s},{"./utils":2}],2:[function(t,e,i){"use strict";function n(t){for(var e=arguments.length,i=Array(e>1?e-1:0),n=1;e>n;n++)i[n-1]=arguments[n];return i.forEach(function(e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])}),t}Object.defineProperty(i,"__esModule",{value:!0}),i.extend=n},{}]},{},[1]); \ No newline at end of file diff --git a/package.json b/package.json index 6fd2081..2da2272 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "idle-timeout", - "version": "0.0.2", + "version": "0.0.3", "description": "A basic idle state detector written in ES6.", "main": "src/index.js", "license": "MIT", diff --git a/src/index.js b/src/index.js index e17ca29..318cc52 100644 --- a/src/index.js +++ b/src/index.js @@ -1,7 +1,7 @@ /*! * IdleTimeout * - * @version 0.0.2 + * @version 0.0.3 * @overview A basic idle state detector written in ES6. * @author Jacob Müller [jacob.mueller.elz@gmail.com] * @see {@link https://github.com/jackmu95/idle-timeout|GitHub}