use standard jquery syntax
This commit is contained in:
parent
429d5c744b
commit
1c3e257bc8
1 changed files with 35 additions and 28 deletions
|
@ -28,6 +28,7 @@ Ox.MenuItem = function(options, self) {
|
||||||
bind: [], // fixme: what's this?
|
bind: [], // fixme: what's this?
|
||||||
checked: null,
|
checked: null,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
|
file: false,
|
||||||
group: '',
|
group: '',
|
||||||
icon: '',
|
icon: '',
|
||||||
id: '',
|
id: '',
|
||||||
|
@ -56,47 +57,53 @@ Ox.MenuItem = function(options, self) {
|
||||||
|
|
||||||
// construct
|
// construct
|
||||||
that.append(
|
that.append(
|
||||||
that.$status = $('<td>', {
|
that.$status = $('<td>')
|
||||||
'class': 'OxCell OxStatus',
|
.addClass('OxCell OxStatus')
|
||||||
html: self.options.checked ? Ox.UI.symbols.check : ''
|
.html(self.options.checked ? Ox.UI.symbols.check : '')
|
||||||
})
|
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
that.$icon = $('<td>', {
|
that.$icon = $('<td>')
|
||||||
'class': 'OxCell OxIcon'
|
.addClass('OxCell OxIcon')
|
||||||
})
|
.append(
|
||||||
.append(self.options.icon
|
self.options.icon
|
||||||
? $('<img>', {src: self.options.icon}) : null
|
? $('<img>').attr({src: self.options.icon})
|
||||||
|
: null
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
that.$title = $('<td>', {
|
that.$title = $('<td>')
|
||||||
'class': 'OxCell OxTitle',
|
.addClass('OxCell OxTitle')
|
||||||
css: self.options.maxWidth
|
.css(
|
||||||
|
self.options.maxWidth
|
||||||
? {maxWidth: self.options.maxWidth - 46}
|
? {maxWidth: self.options.maxWidth - 46}
|
||||||
: {},
|
: {}
|
||||||
html: Ox.isString(self.options.title[0])
|
)
|
||||||
|
.html(
|
||||||
|
Ox.isString(self.options.title[0])
|
||||||
? self.options.title[0]
|
? self.options.title[0]
|
||||||
: $('<div>').html(self.options.title[0]).html()
|
: $('<div>').html(self.options.title[0]).html()
|
||||||
})
|
)
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
$('<td>', {
|
$('<td>')
|
||||||
'class': 'OxCell OxModifiers',
|
.addClass('OxCell OxModifiers')
|
||||||
html: self.options.keyboard.modifiers.map(function(modifier) {
|
.html(
|
||||||
|
self.options.keyboard.modifiers.map(function(modifier) {
|
||||||
return Ox.UI.symbols[modifier];
|
return Ox.UI.symbols[modifier];
|
||||||
}).join('')
|
}).join('')
|
||||||
})
|
)
|
||||||
)
|
)
|
||||||
.append(
|
.append(
|
||||||
$('<td>', {
|
$('<td>')
|
||||||
'class': 'OxCell Ox'
|
.addClass(
|
||||||
+ (self.options.items.length ? 'Submenu' : 'Key'),
|
'OxCell Ox' + (self.options.items.length ? 'Submenu' : 'Key')
|
||||||
html: self.options.items.length
|
)
|
||||||
|
.html(
|
||||||
|
self.options.items.length
|
||||||
? Ox.UI.symbols.triangle_right
|
? Ox.UI.symbols.triangle_right
|
||||||
: Ox.UI.symbols[self.options.keyboard.key]
|
: Ox.UI.symbols[self.options.keyboard.key]
|
||||||
|| self.options.keyboard.key.toUpperCase()
|
|| self.options.keyboard.key.toUpperCase()
|
||||||
})
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
function parseKeyboard(str) {
|
function parseKeyboard(str) {
|
||||||
|
|
Loading…
Reference in a new issue