Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Change log
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
**Table of Contents** *generated with [DocToc](http://doctoc.herokuapp.com/)*

- [4.2.2-dev](#422-dev)
- [4.2.3 (2021-5-8)](#423-2021-5-8)
- [4.2.2 (2021-4-23)](#422-2021-4-23)
- [4.2.1 (2021-4-18)](#421-2021-4-18)
- [4.2.0 (2021-4-11)](#420-2021-4-11)
Expand Down Expand Up @@ -56,7 +56,7 @@ Change log
- [v0.1.0 (2014-11-18)](#v010-2014-11-18)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->
## 4.2.2-dev
## 4.2.3 (2021-5-8)

- `Utils.getScrollParent()` -> `getScrollElement()` rename
- fix [#1745](https://github.com/gridstack/gridstack.js/issues/1745) digression on scrolling in v4.2.1. Thanks [@Manfred-on-github](https://github.com/Manfred-on-github) for fixing your prev change.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gridstack",
"version": "4.2.2-dev",
"version": "4.2.3",
"description": "TypeScript/JS lib for dashboard layout and creation, no external dependencies, with many wrappers (React, Angular, Vue, Ember, knockout...)",
"main": "./dist/gridstack.js",
"types": "./dist/gridstack.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion src/gridstack-dd.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack-dd.ts 4.2.2-dev
* gridstack-dd.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack-ddi.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack-ddi.ts 4.2.2-dev
* gridstack-ddi.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack-engine.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack-engine.ts 4.2.2-dev
* gridstack-engine.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack-h5.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* index-h5.ts 4.2.2-dev - everything you need for a Grid that uses HTML5 native drag&drop
* index-h5.ts 4.2.3 - everything you need for a Grid that uses HTML5 native drag&drop
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack-jq.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* index-jq.ts 4.2.2-dev - everything you need for a Grid that uses Jquery-ui drag&drop (original, full feature)
* index-jq.ts 4.2.3 - everything you need for a Grid that uses Jquery-ui drag&drop (original, full feature)
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack-poly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack-poly.ts 4.2.2-dev - used for older browser support (not currently supported in v2+)
* gridstack-poly.ts 4.2.3 - used for older browser support (not currently supported in v2+)
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack-static.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* index-static.ts 4.2.2-dev - much smaller, everything you need for a static Grid (non draggable, API driven)
* index-static.ts 4.2.3 - much smaller, everything you need for a static Grid (non draggable, API driven)
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack SASS styles 4.2.2-dev
* gridstack SASS styles 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/gridstack.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* GridStack 4.2.2-dev
* GridStack 4.2.3
* https://gridstackjs.com/
*
* Copyright (c) 2021 Alain Dumesny
Expand Down
2 changes: 1 addition & 1 deletion src/h5/dd-base-impl.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-base-impl.ts 4.2.2-dev
* dd-base-impl.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/h5/dd-draggable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-draggable.ts 4.2.2-dev
* dd-draggable.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/h5/dd-droppable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-droppable.ts 4.2.2-dev
* dd-droppable.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/h5/dd-element.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-elements.ts 4.2.2-dev
* dd-elements.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/h5/dd-manager.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-manager.ts 4.2.2-dev
* dd-manager.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/h5/dd-resizable-handle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-resizable-handle.ts 4.2.2-dev
* dd-resizable-handle.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/h5/dd-resizable.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-resizable.ts 4.2.2-dev
* dd-resizable.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/h5/dd-utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* dd-utils.ts 4.2.2-dev
* dd-utils.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/
export class DDUtils {
Expand Down
2 changes: 1 addition & 1 deletion src/h5/gridstack-dd-native.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* gridstack-dd-native.ts 4.2.2-dev
* gridstack-dd-native.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
2 changes: 1 addition & 1 deletion src/jq/gridstack-dd-jqueryui.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// gridstack-dd-jqueryui.ts 4.2.2-dev
// gridstack-dd-jqueryui.ts 4.2.3
// Copyright (c) 2021 Alain Dumesny - see root license
import { GridStackElement } from '../gridstack';
import { GridStackDD, DDOpts, DDKey, DDDropOpt, DDCallback, DDValue } from '../gridstack-dd';
Expand Down
2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* types.ts 4.2.2-dev
* types.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down
16 changes: 4 additions & 12 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* utils.ts 4.2.2-dev
* utils.ts 4.2.3
* Copyright (c) 2021 Alain Dumesny - see GridStack root license
*/

Expand Down Expand Up @@ -351,19 +351,11 @@ export class Utils {
static updateScrollResize(event: MouseEvent, el: HTMLElement, distance: number): void {
const scrollEl = this.getScrollElement(el);
const height = scrollEl.clientHeight;
// #1745 #1727 - check if mouse position is leaving scroll element.
// event.clientY is relative to origin of viewport, must compare this against position of scrollEl,
// accessible via clientHeight and getBoundingClientRect().top.
// Special situation if scroll element is 'html': here browser spec states that
// #1727 event.clientY is relative to viewport, so must compare this against position of scrollEl getBoundingClientRect().top
// #1745 Special situation if scrollEl is document 'html': here browser spec states that
// clientHeight is height of viewport, but getBoundingClientRect() is rectangle of html element;
// this discrepancy arises because in reality scrollbar is attached to viewport, not html element itself.
let offsetTop : number;
if (scrollEl === this.getScrollElement()) {
offsetTop = 0;
} else {
offsetTop = scrollEl.getBoundingClientRect().top;
}

const offsetTop = (scrollEl === this.getScrollElement()) ? 0 : scrollEl.getBoundingClientRect().top;
const pointerPosY = event.clientY - offsetTop;
const top = pointerPosY < distance;
const bottom = pointerPosY > height - distance;
Expand Down