adding change event to select

This commit is contained in:
Rolux 2010-02-06 12:05:40 +05:30
parent 75f16e5fb8
commit f1a6df298b
2 changed files with 17 additions and 6 deletions

View file

@ -136,6 +136,9 @@ input[type=submit] {
-moz-box-sizing: content-box; -moz-box-sizing: content-box;
-webkit-box-sizing: content-box; -webkit-box-sizing: content-box;
} }
input[type=image] {
cursor: default;
}
input:focus { input:focus {
outline: none; outline: none;
} }
@ -321,13 +324,12 @@ OxSelect
} }
.OxSelect > .OxSymbol { .OxSelect > .OxSymbol {
text-align: right; text-align: right;
cursor: pointer; cursor: default;
-moz-user-select: none; -moz-user-select: none;
-webkit-user-select: none; -webkit-user-select: none;
} }
.OxSelect.OxMedium > .OxSymbol { .OxSelect.OxMedium > .OxSymbol {
margin-left: 8px; margin: -16px 8px 0 8px;
margin-top: -16px;
} }
/* /*
================================================================================ ================================================================================
@ -372,7 +374,7 @@ Menus
border-spacing: 0; border-spacing: 0;
} }
.OxMenu .OxItem { .OxMenu .OxItem {
cursor: pointer; cursor: default;
} }
.OxMenu.OxLarge .OxItem { .OxMenu.OxLarge .OxItem {
height: 20px; height: 20px;
@ -474,7 +476,7 @@ Menus
} }
.OxMenu .OxScrollbar { .OxMenu .OxScrollbar {
text-align: center; text-align: center;
cursor: pointer; cursor: default;
display: none; display: none;
} }
.OxMenu.OxLarge .OxScrollbar { .OxMenu.OxLarge .OxScrollbar {

View file

@ -1364,6 +1364,9 @@ requires
}); });
} else { } else {
that.val(value); that.val(value);
Ox.Event.trigger("OxChangeButton." + self.options.id, {
value: value
});
} }
} }
} }
@ -1714,7 +1717,8 @@ requires
size: "medium" size: "medium"
}) })
.options(options) .options(options)
.addClass("OxSelect Ox" + Ox.toTitleCase(self.options.size)), .addClass("OxSelect Ox" + Ox.toTitleCase(self.options.size))
.bindEvent("OxChangeButton." + self.options.id, changeButton),
selected; selected;
$.each(self.options.items, function(i, item) { $.each(self.options.items, function(i, item) {
@ -1728,6 +1732,7 @@ requires
}) })
that.$button = new Ox.Button($.extend(self.options, { that.$button = new Ox.Button($.extend(self.options, {
id: self.options.id,
type: "text", // fixme: this shouldn't be necessary type: "text", // fixme: this shouldn't be necessary
value: self.options.items[selected].title value: self.options.items[selected].title
}), {}) }), {})
@ -1752,6 +1757,10 @@ requires
size: self.options.size size: self.options.size
}); });
function changeButton(event, data) {
Ox.Event.trigger("OxChangeSelect." + self.options.id, data);
}
function clickButton() { function clickButton() {
that.$menu.toggleMenu(); that.$menu.toggleMenu();
} }