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

View file

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