From daec431d1a6576d15219fd8aa04f77984f0893e0 Mon Sep 17 00:00:00 2001 From: Rolux Date: Sat, 6 Feb 2010 12:05:40 +0530 Subject: [PATCH] adding change event to select --- build/css/ox.ui.css | 12 +++++++----- build/js/ox.ui.js | 11 ++++++++++- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/build/css/ox.ui.css b/build/css/ox.ui.css index 51098f1..78877e9 100644 --- a/build/css/ox.ui.css +++ b/build/css/ox.ui.css @@ -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 { diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 0219ded..23826a3 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -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(); }