Skip to content

Commit

Permalink
chore: remove unused old IE code
Browse files Browse the repository at this point in the history
- we no longer support these old IE versions, so let's cleanup the code
  • Loading branch information
ghiscoding committed Jul 19, 2023
1 parent 43d5068 commit 6434369
Showing 1 changed file with 3 additions and 24 deletions.
27 changes: 3 additions & 24 deletions examples/example-column-hidden.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,6 @@ <h2>View Source:</h2>
<script src="../dist/browser/controls/slick.columnpicker.js"></script>

<script>
function isIEPreVer9() { var v = navigator.appVersion.match(/MSIE ([\d.]+)/i); return (v ? v[1] < 9 : false); }

var dataView;
var grid;
var data = [];
Expand Down Expand Up @@ -218,28 +216,9 @@ <h2>View Source:</h2>
sortdir = args.sortAsc ? 1 : -1;
sortcol = args.sortCol.field;

if (isIEPreVer9()) {
// using temporary Object.prototype.toString override
// more limited and does lexicographic sort only by default, but can be much faster

var percentCompleteValueFn = function () {
var val = this["percentComplete"];
if (val < 10) {
return "00" + val;
} else if (val < 100) {
return "0" + val;
} else {
return val;
}
};

// use numeric sort of % and lexicographic for everything else
dataView.fastSort((sortcol == "percentComplete") ? percentCompleteValueFn : sortcol, args.sortAsc);
} else {
// using native sort with comparer
// preferred method but can be very slow in IE with huge datasets
dataView.sort(comparer, args.sortAsc);
}
// using native sort with comparer
// preferred method but can be very slow in IE with huge datasets
dataView.sort(comparer, args.sortAsc);
});

// wire up model events to drive the grid
Expand Down

0 comments on commit 6434369

Please sign in to comment.