Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
adds method to not check for ie8 (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
wheresrhys authored and gvonkoss committed Sep 24, 2018
1 parent 02bdf0d commit 55194c2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Expand Up @@ -696,6 +696,17 @@ When using o-grid silent mode, make sure to surface the grid
information to make it readable by the JavaScript Helper
by adding `@include oGridSurfaceLayoutSizes;` to your Sass file.


### `setMinSupportedIeVersion(version)`

By default, o-grid supports IE8. The feature detect for this can cause performance problems. By setting version to a number greater than 8 this can be avoided.

```js
var oGrid = require('o-grid');

oGrid.setMinSupportedIeVersion(11);
```

## Grid Bookmarklet

1. Create a new Bookmark with this URL:
Expand Down
9 changes: 9 additions & 0 deletions main.js
@@ -1,5 +1,7 @@
/*global module*/

let minSupportedIeVersion = 8;

/**
* Detect IE 8 through injected conditional comments:
* no UA detection, no need for conditional compilation or JS check
Expand All @@ -18,8 +20,12 @@ function detectIE8() {
}

const isIE8 = (function () {

let result;
return function () {
if (minSupportedIeVersion > 8) {
return false;
}
if (result === undefined) {
result = detectIE8();
}
Expand Down Expand Up @@ -149,4 +155,7 @@ export default {
getCurrentGutter: getCurrentGutter,
getGridBreakpoints: getGridBreakpoints,
enableLayoutChangeEvents: enableLayoutChangeEvents,
setMinSupportedIeVersion: version => {
minSupportedIeVersion = version;
}
};

0 comments on commit 55194c2

Please sign in to comment.