Skip to content

Commit

Permalink
Merging fix for IE events triggering on all IE.
Browse files Browse the repository at this point in the history
  • Loading branch information
thednp committed Apr 25, 2015
1 parent 6f82ddd commit bea63dc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
12 changes: 10 additions & 2 deletions dist/bootstrap-native.js
Original file line number Diff line number Diff line change
Expand Up @@ -871,8 +871,16 @@
var labels = target.querySelectorAll('.btn'); // all the button group buttons
var input = label.getElementsByTagName('INPUT')[0];

//register the change event and assign to a function
var changeEvent = new Event("change"); // The built in event that will be triggered on demand
// The built in event that will be triggered on demand
var changeEvent;
if ( Event !== undefined && typeof Event === 'function' && typeof Event !== 'object' ) {
changeEvent = new Event('change');
} else { // define event type, new Event('type') does not work in any IE
changeEvent = document.createEvent('HTMLEvents');
changeEvent.initEvent('change', true, true);
}

// assign event to a trigger function
function triggerChange(t) { t.dispatchEvent(changeEvent) }

//manage the dom manipulation
Expand Down
Loading

0 comments on commit bea63dc

Please sign in to comment.