Permalink
Browse files

Fixes for pull request #3

  • Loading branch information...
1 parent de41bd7 commit 237508200fc96db991ba2b842a218b0cf6ac8b23 @lorenzos committed Dec 7, 2012
Showing with 18 additions and 3 deletions.
  1. +1 −0 README.md
  2. +9 −0 Source/FancySelect.css
  3. +7 −2 Source/FancySelect.js
  4. +1 −1 package.yml
View
@@ -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:**
@@ -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 {
@@ -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,
View
@@ -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.