Skip to content

Commit

Permalink
Merge pull request #193 from StefanBilliet/issue175-squashed
Browse files Browse the repository at this point in the history
Fix for issue 175
  • Loading branch information
JedWatson committed May 19, 2015
2 parents 3345d4a + bdc1c28 commit d1ca39b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
4 changes: 3 additions & 1 deletion examples/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ <h2>Examples:</h2>
<div class="footer">
Copyright &copy; Jed Watson 2014. MIT Licensed.
</div>
</div>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.1/es5-shim.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/es5-shim/4.1.1/es5-sham.js"></script>
<script src="common.js"></script>
<script src="bundle.js"></script>
<script src="app.js"></script>
Expand Down
12 changes: 10 additions & 2 deletions src/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,19 @@ var Select = React.createClass({
};

this._bindCloseMenuIfClickedOutside = function() {
document.addEventListener('click', self._closeMenuIfClickedOutside);
if (!document.addEventListener && document.attachEvent) {
document.attachEvent('onclick', this._closeMenuIfClickedOutside);
} else {
document.addEventListener('click', this._closeMenuIfClickedOutside);
}
};

this._unbindCloseMenuIfClickedOutside = function() {
document.removeEventListener('click', self._closeMenuIfClickedOutside);
if (!document.removeEventListener && document.detachEvent) {
document.detachEvent('onclick', this._closeMenuIfClickedOutside);
} else {
document.removeEventListener('click', this._closeMenuIfClickedOutside);
}
};
},

Expand Down

0 comments on commit d1ca39b

Please sign in to comment.