Skip to content

Commit

Permalink
Merge pull request #1359 from harvesthq/fix-percentage-width-issues
Browse files Browse the repository at this point in the history
Remove memoization of search field width.
  • Loading branch information
pfiller committed Jul 17, 2013
2 parents 840addd + e5833ed commit 5dd7df1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions coffee/chosen.jquery.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -476,10 +476,10 @@ class Chosen extends AbstractChosen
w = div.width() + 25
div.remove()

@f_width = @container.outerWidth() unless @f_width
f_width = @container.outerWidth()

if( w > @f_width-10 )
w = @f_width - 10
if( w > f_width - 10 )
w = f_width - 10

@search_field.css({'width': w + 'px'})

Expand Down
6 changes: 3 additions & 3 deletions coffee/chosen.proto.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -467,10 +467,10 @@ class Chosen extends AbstractChosen
w = Element.measure(div, 'width') + 25
div.remove()

@f_width = @container.getWidth() unless @f_width
f_width = @container.getWidth()

if( w > @f_width-10 )
w = @f_width - 10
if( w > f_width-10 )
w = f_width - 10

@search_field.setStyle({'width': w + 'px'})

Expand Down

0 comments on commit 5dd7df1

Please sign in to comment.