1
0
Fork 0
forked from 0x2620/oxjs

allow for max width in menus

This commit is contained in:
rlx 2011-11-02 18:21:49 +00:00
commit 16556c0604
4 changed files with 11 additions and 0 deletions

View file

@ -35,6 +35,7 @@ Ox.Menu = function(options, self) {
id: '',
items: [],
mainmenu: null,
maxWidth: 0,
offset: {
left: 0,
top: 0
@ -198,6 +199,7 @@ Ox.Menu = function(options, self) {
var position;
if ('id' in item) {
that.items.push(Ox.MenuItem(Ox.extend(item, {
maxWidth: self.options.maxWidth,
menu: that,
position: position = that.items.length
})).data('position', position).appendTo(that.$content)); // fixme: jquery bug when passing {position: position}? does not return the object?;

View file

@ -32,6 +32,7 @@ Ox.MenuItem = function(options, self) {
id: '',
items: [],
keyboard: '',
maxWidth: 0,
menu: null, // fixme: is passing the menu to 100s of menu items really memory-neutral?
position: 0,
title: [],
@ -70,6 +71,7 @@ Ox.MenuItem = function(options, self) {
.append(
that.$title = $('<td>', {
'class': 'OxCell OxTitle',
css: self.options.maxWidth ? {maxWidth: self.options.maxWidth} : {},
html: self.options.title[0]
})
)