Skip to content

Commit

Permalink
Fixed issue with IE detaching click event.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathias Kunto committed Jan 16, 2014
1 parent 5584f10 commit 4032d63
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion BookmarkLinks/BookmarkLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,14 @@ SampleCode.BookmarkLinks = function () {
var onClickAttrArr = onClickAttribute.split(',');
onClickAttrArr[7] = "SampleCode.BookmarkLinks.pageSelectorCallback";
onClickAttribute = onClickAttrArr.join(',');
pageSelectButton.attr("onclick", onClickAttribute);

// We cannot put it back in the onclick attribute since IE won't accept it, and nothing will happen when
// the button is pushed. globalEval here should be as dangerous as if someone changed the vanilla onclick
// string with FireBug.
pageSelectButton.removeAttr('onclick');
pageSelectButton.on('click', function () {
$.globalEval(onClickAttribute);
});
}

return {
Expand Down

0 comments on commit 4032d63

Please sign in to comment.