Skip to content

Commit

Permalink
Fixes for pull request #3
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzos committed Dec 7, 2012
1 parent de41bd7 commit 2375082
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -65,6 +65,7 @@ Docs
- **autoHide**: If `TRUE` auto-hide the dropdown menu when user clicks outside.
- **autoScrollWindow**: If `TRUE` auto-scroll browser window when FancySelect is out of viewport.
- **animateFade**: If `TRUE` (default) animate the dropdown menu appearance.
- **legacyEvents**: If `TRUE` fires "change" event for the original `<select>` element.
- **fx**: An object for additional `Fx` options (default `{'duration': 'short'}`).

**Events:**
Expand Down
9 changes: 9 additions & 0 deletions Source/FancySelect.css
Expand Up @@ -46,6 +46,15 @@ div.fancy-select .arrow {
ul.fancy-select {
margin: 0; /* Reccomended! */
padding: 0;

/* Use the folliwing if you want to set a fixed height
* on the dropdown and let user "scroll" options...
width: 150px;
height: 200px;
overflow: auto;
*overflow-x: hidden;
*overflow-y: auto; */

}

ul.fancy-select li {
Expand Down
9 changes: 7 additions & 2 deletions Source/FancySelect.js
Expand Up @@ -81,14 +81,19 @@ var FancySelect = new Class({
},

select: function(value) {

// Update hidden <select>
if(this.element.get('value') != value) {
if (this.element.get('value') != value) {
this.element.set('value', value);
if(this.options.legacyEvents) {

// Throw "change" event
if (this.options.legacyEvents) {
this.element.fireEvent('change');
this.element.getParents().fireEvent('change');
}

}

if (this.options.showText) this.div.getElement('span.text').set('text', this.selectOptions[value].text);
if (this.options.showImages) this.div.getElement('img.image').setProperties({
'src': this.selectOptions[value].image,
Expand Down
2 changes: 1 addition & 1 deletion package.yml
Expand Up @@ -4,6 +4,6 @@ category: Interface
tags: [dropdown, select, image]
demo: http://www.lorenzostanco.com/demos/FancySelect/Demo.html
docs: http://wiki.github.com/lorenzos/FancySelect/docs
current: 0.3
current: 0.4
sources:
- "Source/FancySelect.js"

0 comments on commit 2375082

Please sign in to comment.