Skip to content

Commit

Permalink
remove startsWith/triggerNative code for IE8 (#2259)
Browse files Browse the repository at this point in the history
  • Loading branch information
caseyjhol committed May 8, 2020
1 parent 8fadf3c commit 25099e2
Showing 1 changed file with 2 additions and 19 deletions.
21 changes: 2 additions & 19 deletions js/bootstrap-select.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,16 +239,6 @@
if (!String.prototype.startsWith) {
(function () {
'use strict'; // needed to support `apply`/`call` with `undefined`/`null`
var defineProperty = (function () {
// IE 8 only supports `Object.defineProperty` on DOM elements
try {
var object = {};
var $defineProperty = Object.defineProperty;
var result = $defineProperty(object, object, object) && $defineProperty;
} catch (error) {
}
return result;
}());
var toString = {}.toString;
var startsWith = function (search) {
if (this == null) {
Expand Down Expand Up @@ -280,8 +270,8 @@
}
return true;
};
if (defineProperty) {
defineProperty(String.prototype, 'startsWith', {
if (Object.defineProperty) {
Object.defineProperty(String.prototype, 'startsWith', {
'value': startsWith,
'configurable': true,
'writable': true
Expand Down Expand Up @@ -385,13 +375,6 @@
}

el.dispatchEvent(event);
} else if (el.fireEvent) { // for IE8
event = document.createEventObject();
event.eventType = eventName;
el.fireEvent('on' + eventName, event);
} else {
// fall back to jQuery.trigger
this.trigger(eventName);
}
};
// </editor-fold>
Expand Down

0 comments on commit 25099e2

Please sign in to comment.