Skip to content

Commit

Permalink
Fixed drop down display issue in safari. Fixes #14
Browse files Browse the repository at this point in the history
  • Loading branch information
Hai Nguyen committed Nov 9, 2014
1 parent 540bafe commit 8c86b50
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
24 changes: 19 additions & 5 deletions docs/dist/js/menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,28 @@ var Menu = React.createClass({

componentDidMount: function() {
var $el = $(this.getDOMNode()),
menuWidth = $el.width();

//Make sure the width is an increment of the keylines
menuWidth = $el.width(),
currentTransition = $el.css('transition');

menuWidth = KeyLine.getIncrementalDim(menuWidth);
$el.css('width', menuWidth);

//Update the menu width
//We need to remove the transition because of safari
$el.css({
transition: 'none',
width: menuWidth
});

//force a redraw
$el.height();

//put the transition back
$el.css({
transition: currentTransition
});

//Save the initial menu height for later
this._initialMenuHeight = $(this.getDOMNode()).height() + KeyLine.Desktop.GUTTER_LESS;
this._initialMenuHeight = $el.height() + KeyLine.Desktop.GUTTER_LESS;

//Show or Hide the menu according to visibility
this._renderVisibility();
Expand Down
2 changes: 1 addition & 1 deletion docs/dist/less/components/drop-down-menu.less
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.mui-drop-down-menu {

* { .ease-out; }
* { .ease-out(); }

position: relative;
height: @desktop-toolbar-height;
Expand Down

0 comments on commit 8c86b50

Please sign in to comment.