Skip to content

Commit

Permalink
'prototype' undefined fix for dd-gridstack.js
Browse files Browse the repository at this point in the history
* fix gridstack#2039
* moved all the D7D gridstack code into the gridstack.ts file as I gave up on the idea to build s a smaller static only code and delay load the D&D (which is much much smaller now)
as it was causing some build issues for some users...
  • Loading branch information
adumesny committed Dec 27, 2022
1 parent 57ae798 commit b628f54
Show file tree
Hide file tree
Showing 4 changed files with 622 additions and 688 deletions.
4 changes: 4 additions & 0 deletions doc/CHANGES.md
Expand Up @@ -5,6 +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/)*

- [7.1.1-dev (TBD)](#711-dev-tbd)
- [7.1.1 (2022-11-13)](#711-2022-11-13)
- [7.1.0 (2022-10-23)](#710-2022-10-23)
- [7.0.1 (2022-10-14)](#701-2022-10-14)
Expand Down Expand Up @@ -76,6 +77,9 @@ Change log

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## 7.1.1-dev (TBD)
* fix [#939](https://github.com/gridstack/gridstack.js/issues/2039) 'prototype' undefined error for dd-gridstack.js

## 7.1.1 (2022-11-13)
* fix [#939](https://github.com/gridstack/gridstack.js/issues/939) editable elements focus (regression in v6). Thank you [@Gezdy](https://github.com/Gezdy)

Expand Down
8 changes: 4 additions & 4 deletions spec/gridstack-spec.ts
Expand Up @@ -1150,7 +1150,7 @@ describe('gridstack', function() {
let grid = GridStack.init({float: true});
let items = Utils.getElements('.grid-stack-item');
let el = items[1];
let dd = DDGridStack.get();
let dd = GridStack.getDD();

grid.update(el, {noMove: true, noResize: false});
expect(el.getAttribute('gs-no-move')).toBe('true');
Expand Down Expand Up @@ -1478,7 +1478,7 @@ describe('gridstack', function() {
let grid = GridStack.init(options);
expect(grid.opts.disableResize).toBe(true);
let items = Utils.getElements('.grid-stack-item');
let dd = DDGridStack.get();
let dd = GridStack.getDD();
// expect(dd).toBe(null); // sanity test to verify type
for (let i = 0; i < items.length; i++) {
expect(dd.isResizable(items[i])).toBe(false);
Expand All @@ -1499,7 +1499,7 @@ describe('gridstack', function() {
let grid = GridStack.init(options);
expect(grid.opts.disableResize).toBeFalsy();
let items = Utils.getElements('.grid-stack-item');
let dd = DDGridStack.get();
let dd = GridStack.getDD();
for (let i = 0; i < items.length; i++) {
expect(dd.isResizable(items[i])).toBe(true);
expect(dd.isDraggable(items[i])).toBe(true);
Expand Down Expand Up @@ -1527,7 +1527,7 @@ describe('gridstack', function() {
};
let grid = GridStack.init(options);
let items = Utils.getElements('.grid-stack-item');
let dd = DDGridStack.get();
let dd = GridStack.getDD();
grid.enableResize(false);
grid.enableMove(false);
for (let i = 0; i < items.length; i++) {
Expand Down

0 comments on commit b628f54

Please sign in to comment.