Skip to content
This repository has been archived by the owner on Apr 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #51 from celtra/add-close
Browse files Browse the repository at this point in the history
Add reform.close event
  • Loading branch information
rokburgar committed Feb 16, 2015
2 parents 05f5944 + 13d9005 commit b8174b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "reform",
"version": "0.3.7",
"version": "0.3.8",
"author": "Rod Petrovic <me@rodpetrovic.com>",
"description": "HTML forms the way you want them",
"contributors": [
Expand Down
6 changes: 4 additions & 2 deletions src/selectbox_abstract.coffee
Expand Up @@ -108,6 +108,8 @@ class SelectBoxAbstract
# Replicate changes from the original select box to the fake one
@orig.on 'reform.sync change DOMSubtreeModified', @refresh

@body.on 'reform.close', => @close()

# Close any other open options containers
@body.on 'reform.open', (e) => @close() unless e.target is @select

Expand All @@ -116,7 +118,7 @@ class SelectBoxAbstract
$item.addClass 'hover'

scrollTo: ($item) ->
$container = @list
$container = @$list
newScrollTop = $item.offset().top - $container.offset().top + $container.scrollTop()

@ignoreMouse = yes
Expand Down Expand Up @@ -263,7 +265,7 @@ class SelectBoxAbstract
$selectedItem.append @orig.data('title')
else
$title = @createClosedItem()
$selectedItem.append $title
$selectedItem.append $title

@createOptions()

Expand Down

0 comments on commit b8174b1

Please sign in to comment.