Skip to content

Commit 0597e7c

Browse files
committed
v2: explicit IE11 support drop
explicit drop for IE11 and no longer compile polyfill (size increase and still issue don't ewarrant such a obsolete support - use 1.x instead).
1 parent 731d5fa commit 0597e7c

File tree

4 files changed

+86
-2
lines changed

4 files changed

+86
-2
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,8 @@ v2.x is a Typescript rewrite of 1.x, removing all jquery events, using classes a
382382

383383
3. `oneColumnMode` would trigger when `window.width` < 768px by default. We now check for grid width instead (more correct and supports nesting). You might need to adjust grid `minWidth` or `disableOneColumnMode`.
384384

385+
**Note:** 2.x no longer support legacy IE11 and older due to using more compact ES6 output and typecsript native code. You will need to stay at 1.x
386+
385387
Changes
386388
=====
387389

doc/CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ You can now have perfect square cells (default) [723](https://github.com/gridsta
6363
- fix [1299](https://github.com/gridstack/gridstack.js/pull/1299) many columns round-off error
6464
- fix [1102](https://github.com/gridstack/gridstack.js/issues/1102) loose functionality when they are moved to a new grid
6565
- add optional params to `removeWidget()` to have quiet mode (no callbacks)
66+
- drop support for IE11 due to more compact ES6 output and newer TS code
6667

6768
## 1.2.1 (2020-09-04)
6869

src/gridstack-poly.js

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,4 +122,87 @@ if (!Array.prototype.findIndex) {
122122
configurable: true,
123123
writable: true
124124
});
125+
}
126+
127+
// Source: https://github.com/jserz/js_piece/blob/master/DOM/ParentNode/append()/append().md
128+
(function (arr) {
129+
arr.forEach(function (item) {
130+
if (item.hasOwnProperty('append')) {
131+
return;
132+
}
133+
Object.defineProperty(item, 'append', {
134+
configurable: true,
135+
enumerable: true,
136+
writable: true,
137+
value: function append() {
138+
var argArr = Array.prototype.slice.call(arguments),
139+
docFrag = document.createDocumentFragment();
140+
141+
argArr.forEach(function (argItem) {
142+
var isNode = argItem instanceof Node;
143+
docFrag.appendChild(isNode ? argItem : document.createTextNode(String(argItem)));
144+
});
145+
146+
this.appendChild(docFrag);
147+
}
148+
});
149+
});
150+
})([Element.prototype, Document.prototype, DocumentFragment.prototype]);
151+
152+
// Production steps of ECMA-262, Edition 5, 15.4.4.18
153+
// Reference: http://es5.github.io/#x15.4.4.18
154+
155+
if (!Array.prototype['forEach']) {
156+
157+
Array.prototype.forEach = function(callback, thisArg) {
158+
159+
if (this == null) { throw new TypeError('Array.prototype.forEach called on null or undefined'); }
160+
161+
var T, k;
162+
// 1. Let O be the result of calling toObject() passing the
163+
// |this| value as the argument.
164+
var O = Object(this);
165+
166+
// 2. Let lenValue be the result of calling the Get() internal
167+
// method of O with the argument "length".
168+
// 3. Let len be toUint32(lenValue).
169+
var len = O.length >>> 0;
170+
171+
// 4. If isCallable(callback) is false, throw a TypeError exception.
172+
// See: http://es5.github.com/#x9.11
173+
if (typeof callback !== "function") { throw new TypeError(callback + ' is not a function'); }
174+
175+
// 5. If thisArg was supplied, let T be thisArg; else let
176+
// T be undefined.
177+
if (arguments.length > 1) { T = thisArg; }
178+
179+
// 6. Let k be 0
180+
k = 0;
181+
182+
// 7. Repeat, while k < len
183+
while (k < len) {
184+
185+
var kValue;
186+
187+
// a. Let Pk be ToString(k).
188+
// This is implicit for LHS operands of the in operator
189+
// b. Let kPresent be the result of calling the HasProperty
190+
// internal method of O with argument Pk.
191+
// This step can be combined with c
192+
// c. If kPresent is true, then
193+
if (k in O) {
194+
195+
// i. Let kValue be the result of calling the Get internal
196+
// method of O with argument Pk.
197+
kValue = O[k];
198+
199+
// ii. Call the Call internal method of callback with T as
200+
// the this value and argument list containing kValue, k, and O.
201+
callback.call(T, kValue, k, O);
202+
}
203+
// d. Increase k by 1.
204+
k++;
205+
}
206+
// 8. return undefined
207+
};
125208
}

src/gridstack.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* (c) 2014-2020 Alain Dumesny, Dylan Weiss, Pavel Reznikov
66
* gridstack.js may be freely distributed under the MIT license.
77
*/
8-
import './gridstack-poly.js';
9-
108
import { GridStackEngine } from './gridstack-engine';
119
import { obsoleteOpts, obsoleteOptsDel, obsoleteAttr, obsolete, Utils } from './utils';
1210
import { GridItemHTMLElement, GridStackWidget, GridStackNode, GridStackOptions, numberOrString } from './types';

0 commit comments

Comments
 (0)