forked from 0x2620/oxjs
adding change event to select
This commit is contained in:
parent
75f16e5fb8
commit
f1a6df298b
2 changed files with 17 additions and 6 deletions
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue