Picker: use Ox.$; use on click, not click

This commit is contained in:
rlx 2014-09-22 13:18:28 +02:00
parent fe5dc99d26
commit e7f9279a9d

View file

@ -43,8 +43,7 @@ Ox.Picker = function(options, self) {
height: (self.options.elementHeight + 24) + 'px' height: (self.options.elementHeight + 24) + 'px'
}); });
self.options.element self.options.element.css({
.css({
width: self.options.elementWidth + 'px', width: self.options.elementWidth + 'px',
height: self.options.elementHeight + 'px' height: self.options.elementHeight + 'px'
}) })
@ -65,12 +64,16 @@ Ox.Picker = function(options, self) {
title: Ox._('Done'), title: Ox._('Done'),
width: 48 width: 48
}) })
.click(hideMenu) .bindEvent({
click: hideMenu
})
.appendTo(self.$bar); .appendTo(self.$bar);
self.$layer = $('<div>') self.$layer = Ox.$('<div>')
.addClass('OxLayer') .addClass('OxLayer')
.click(hideMenu); .on({
click: hideMenu
});
function hideMenu() { function hideMenu() {
self.$menu.detach(); self.$menu.detach();