@financial-times/o-viewport
Advanced tools
Comparing version 3.3.1 to 3.3.2
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.debug = debug; | ||
exports.listenTo = listenTo; | ||
exports.stopListeningTo = stopListeningTo; | ||
exports.setThrottleInterval = setThrottleInterval; | ||
Object.defineProperty(exports, "getOrientation", { | ||
enumerable: true, | ||
get: function get() { | ||
return _utils2.getOrientation; | ||
} | ||
}); | ||
Object.defineProperty(exports, "getSize", { | ||
enumerable: true, | ||
get: function get() { | ||
return _utils2.getSize; | ||
} | ||
}); | ||
Object.defineProperty(exports, "getScrollPosition", { | ||
enumerable: true, | ||
get: function get() { | ||
return _utils2.getScrollPosition; | ||
} | ||
}); | ||
Object.defineProperty(exports, "getVisibility", { | ||
enumerable: true, | ||
get: function get() { | ||
return _utils2.getVisibility; | ||
} | ||
}); | ||
exports.default = void 0; | ||
// let debug; | ||
const utils = require("./dist/utils"); | ||
var utils = _interopRequireWildcard(require("./dist/utils")); | ||
var _utils2 = require("./dist/utils.js"); | ||
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } } | ||
// let debug; | ||
const debounce = utils.debounce, | ||
throttle = utils.throttle; | ||
const throttle = utils.throttle; | ||
const debounce = utils.debounce; | ||
const listeners = {}; | ||
@@ -173,12 +136,10 @@ const intervals = { | ||
function debug() { | ||
// debug = true; | ||
utils.debug(); | ||
} | ||
var _default = { | ||
debug, | ||
listenTo, | ||
stopListeningTo, | ||
setThrottleInterval, | ||
module.exports = { | ||
debug: function debug() { | ||
// debug = true; | ||
utils.debug(); | ||
}, | ||
listenTo: listenTo, | ||
stopListeningTo: stopListeningTo, | ||
setThrottleInterval: setThrottleInterval, | ||
getOrientation: utils.getOrientation, | ||
@@ -188,3 +149,2 @@ getSize: utils.getSize, | ||
getVisibility: utils.getVisibility | ||
}; | ||
exports.default = _default; | ||
}; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { | ||
value: true | ||
}); | ||
exports.debug = enableDebugMode; | ||
exports.broadcast = broadcast; | ||
exports.getWidth = getWidth; | ||
exports.getHeight = getHeight; | ||
exports.getSize = getSize; | ||
exports.getScrollPosition = getScrollPosition; | ||
exports.getVisibility = getVisibility; | ||
exports.getOrientation = getOrientation; | ||
exports.detectVisiblityAPI = detectVisiblityAPI; | ||
Object.defineProperty(exports, "debounce", { | ||
enumerable: true, | ||
get: function get() { | ||
return _oUtils.debounce; | ||
} | ||
}); | ||
Object.defineProperty(exports, "throttle", { | ||
enumerable: true, | ||
get: function get() { | ||
return _oUtils.throttle; | ||
} | ||
}); | ||
exports.default = void 0; | ||
/* jshint devel: true */ | ||
const oUtils = require("@financial-times/o-utils"); | ||
var _oUtils = require("@financial-times/o-utils"); | ||
let _debug; | ||
/* jshint devel: true */ | ||
let debug; | ||
function broadcast(eventType, data, target) { | ||
target = target || document.body; | ||
if (debug) { | ||
if (_debug) { | ||
console.log('o-viewport', eventType, data); | ||
@@ -57,4 +31,4 @@ } | ||
return { | ||
height: getHeight(ignoreScrollbars), | ||
width: getWidth(ignoreScrollbars) | ||
height: module.exports.getHeight(ignoreScrollbars), | ||
width: module.exports.getWidth(ignoreScrollbars) | ||
}; | ||
@@ -119,19 +93,16 @@ } | ||
function enableDebugMode() { | ||
debug = true; | ||
} | ||
var _default = { | ||
debug: enableDebugMode, | ||
broadcast, | ||
getWidth, | ||
getHeight, | ||
getSize, | ||
getScrollPosition, | ||
getVisibility, | ||
getOrientation, | ||
detectVisiblityAPI, | ||
debounce: _oUtils.debounce, | ||
throttle: _oUtils.throttle | ||
}; | ||
exports.default = _default; | ||
module.exports = { | ||
debug: function debug() { | ||
_debug = true; | ||
}, | ||
broadcast: broadcast, | ||
getWidth: getWidth, | ||
getHeight: getHeight, | ||
getSize: getSize, | ||
getScrollPosition: getScrollPosition, | ||
getVisibility: getVisibility, | ||
getOrientation: getOrientation, | ||
detectVisiblityAPI: detectVisiblityAPI, | ||
debounce: oUtils.debounce, | ||
throttle: oUtils.throttle | ||
}; |
@@ -26,3 +26,3 @@ { | ||
"name": "@financial-times/o-viewport", | ||
"version": "3.3.1", | ||
"version": "3.3.2", | ||
"description": "Utility for moderating listeners for browser events on window", | ||
@@ -29,0 +29,0 @@ "dependencies": { |
11824
241