Skip to content

Commit

Permalink
Exported offset in parts/Utilities.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin19 authored and TorsteinHonsi committed Nov 28, 2019
1 parent 0bb2557 commit 853a007
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 10 deletions.
1 change: 1 addition & 0 deletions js/masters/highcharts.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ extend(Highcharts, {
isString: U.isString,
numberFormat: U.numberFormat,
objectEach: U.objectEach,
offset: U.offset,
pad: U.pad,
pick: U.pick,
pInt: U.pInt,
Expand Down
4 changes: 2 additions & 2 deletions js/modules/oldie.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'use strict';
import H from '../parts/Globals.js';
import U from '../parts/Utilities.js';
var defined = U.defined, discardElement = U.discardElement, erase = U.erase, extend = U.extend, extendClass = U.extendClass, isArray = U.isArray, isNumber = U.isNumber, isObject = U.isObject, pick = U.pick, pInt = U.pInt;
var defined = U.defined, discardElement = U.discardElement, erase = U.erase, extend = U.extend, extendClass = U.extendClass, isArray = U.isArray, isNumber = U.isNumber, isObject = U.isObject, offset = U.offset, pick = U.pick, pInt = U.pInt;
import '../parts/SvgRenderer.js';
var VMLRenderer, VMLRendererExtension, VMLElement, Chart = H.Chart, createElement = H.createElement, css = H.css, deg2rad = H.deg2rad, doc = H.doc, merge = H.merge, noop = H.noop, svg = H.svg, SVGElement = H.SVGElement, SVGRenderer = H.SVGRenderer, win = H.win;
/**
Expand Down Expand Up @@ -86,7 +86,7 @@ if (!svg) {
}
// Get mouse position
if (!chartPosition) {
this.chartPosition = chartPosition = H.offset(this.chart.container);
this.chartPosition = chartPosition = offset(this.chart.container);
}
return extend(e, {
// #2005, #2129: the second case is for IE10 quirks mode within
Expand Down
4 changes: 2 additions & 2 deletions js/parts/Pointer.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ import Highcharts from './Globals.js';
* @type {Array<Highcharts.SelectDataObject>}
*/
import U from './Utilities.js';
var attr = U.attr, defined = U.defined, extend = U.extend, isNumber = U.isNumber, isObject = U.isObject, objectEach = U.objectEach, pick = U.pick, splat = U.splat;
var attr = U.attr, defined = U.defined, extend = U.extend, isNumber = U.isNumber, isObject = U.isObject, objectEach = U.objectEach, offset = U.offset, pick = U.pick, splat = U.splat;
import './Tooltip.js';
import './Color.js';
var H = Highcharts, addEvent = H.addEvent, charts = H.charts, color = H.color, css = H.css, find = H.find, fireEvent = H.fireEvent, offset = H.offset, Tooltip = H.Tooltip;
var H = Highcharts, addEvent = H.addEvent, charts = H.charts, color = H.color, css = H.css, find = H.find, fireEvent = H.fireEvent, Tooltip = H.Tooltip;
/* eslint-disable no-invalid-this, valid-jsdoc */
/**
* The mouse and touch tracker object. Each {@link Chart} item has one
Expand Down
5 changes: 3 additions & 2 deletions js/parts/Utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -1929,7 +1929,7 @@ H.keys = Object.keys;
* An object containing `left` and `top` properties for the position in
* the page.
*/
H.offset = function (el) {
function offset(el) {
var docElem = doc.documentElement, box = (el.parentElement || el.parentNode) ?
el.getBoundingClientRect() :
{ top: 0, left: 0 };
Expand All @@ -1939,7 +1939,7 @@ H.offset = function (el) {
left: box.left + (win.pageXOffset || docElem.scrollLeft) -
(docElem.clientLeft || 0)
};
};
}
/**
* Stop running animation.
*
Expand Down Expand Up @@ -2536,6 +2536,7 @@ var utils = {
isString: isString,
numberFormat: numberFormat,
objectEach: objectEach,
offset: offset,
pad: pad,
pick: pick,
pInt: pInt,
Expand Down
3 changes: 2 additions & 1 deletion ts/modules/oldie.src.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ const {
isArray,
isNumber,
isObject,
offset,
pick,
pInt
} = U;
Expand Down Expand Up @@ -450,7 +451,7 @@ if (!svg) {

// Get mouse position
if (!chartPosition) {
this.chartPosition = chartPosition = H.offset(this.chart.container);
this.chartPosition = chartPosition = offset(this.chart.container);
}

return extend(e, {
Expand Down
2 changes: 1 addition & 1 deletion ts/parts/Pointer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ const {
isNumber,
isObject,
objectEach,
offset,
pick,
splat
} = U;
Expand All @@ -245,7 +246,6 @@ var H = Highcharts,
css = H.css,
find = H.find,
fireEvent = H.fireEvent,
offset = H.offset,
Tooltip = H.Tooltip;

/* eslint-disable no-invalid-this, valid-jsdoc */
Expand Down
5 changes: 3 additions & 2 deletions ts/parts/Utilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2684,7 +2684,7 @@ H.keys = Object.keys;
* An object containing `left` and `top` properties for the position in
* the page.
*/
H.offset = function (el: Highcharts.HTMLDOMElement): Highcharts.OffsetObject {
function offset(el: Highcharts.HTMLDOMElement): Highcharts.OffsetObject {
var docElem = doc.documentElement,
box = (el.parentElement || el.parentNode) ?
el.getBoundingClientRect() :
Expand All @@ -2696,7 +2696,7 @@ H.offset = function (el: Highcharts.HTMLDOMElement): Highcharts.OffsetObject {
left: box.left + (win.pageXOffset || docElem.scrollLeft) -
(docElem.clientLeft || 0)
};
};
}

/**
* Stop running animation.
Expand Down Expand Up @@ -3421,6 +3421,7 @@ const utils = {
isString,
numberFormat,
objectEach,
offset,
pad,
pick,
pInt,
Expand Down

0 comments on commit 853a007

Please sign in to comment.