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?
|
||||
checked: null,
|
||||
disabled: false,
|
||||
file: false,
|
||||
group: '',
|
||||
icon: '',
|
||||
id: '',
|
||||
|
@ -56,47 +57,53 @@ Ox.MenuItem = function(options, self) {
|
|||
|
||||
// construct
|
||||
that.append(
|
||||
that.$status = $('<td>', {
|
||||
'class': 'OxCell OxStatus',
|
||||
html: self.options.checked ? Ox.UI.symbols.check : ''
|
||||
})
|
||||
that.$status = $('<td>')
|
||||
.addClass('OxCell OxStatus')
|
||||
.html(self.options.checked ? Ox.UI.symbols.check : '')
|
||||
)
|
||||
.append(
|
||||
that.$icon = $('<td>', {
|
||||
'class': 'OxCell OxIcon'
|
||||
})
|
||||
.append(self.options.icon
|
||||
? $('<img>', {src: self.options.icon}) : null
|
||||
)
|
||||
that.$icon = $('<td>')
|
||||
.addClass('OxCell OxIcon')
|
||||
.append(
|
||||
self.options.icon
|
||||
? $('<img>').attr({src: self.options.icon})
|
||||
: null
|
||||
)
|
||||
)
|
||||
.append(
|
||||
that.$title = $('<td>', {
|
||||
'class': 'OxCell OxTitle',
|
||||
css: self.options.maxWidth
|
||||
that.$title = $('<td>')
|
||||
.addClass('OxCell OxTitle')
|
||||
.css(
|
||||
self.options.maxWidth
|
||||
? {maxWidth: self.options.maxWidth - 46}
|
||||
: {},
|
||||
html: Ox.isString(self.options.title[0])
|
||||
: {}
|
||||
)
|
||||
.html(
|
||||
Ox.isString(self.options.title[0])
|
||||
? self.options.title[0]
|
||||
: $('<div>').html(self.options.title[0]).html()
|
||||
})
|
||||
)
|
||||
)
|
||||
.append(
|
||||
$('<td>', {
|
||||
'class': 'OxCell OxModifiers',
|
||||
html: self.options.keyboard.modifiers.map(function(modifier) {
|
||||
return Ox.UI.symbols[modifier];
|
||||
}).join('')
|
||||
})
|
||||
$('<td>')
|
||||
.addClass('OxCell OxModifiers')
|
||||
.html(
|
||||
self.options.keyboard.modifiers.map(function(modifier) {
|
||||
return Ox.UI.symbols[modifier];
|
||||
}).join('')
|
||||
)
|
||||
)
|
||||
.append(
|
||||
$('<td>', {
|
||||
'class': 'OxCell Ox'
|
||||
+ (self.options.items.length ? 'Submenu' : 'Key'),
|
||||
html: self.options.items.length
|
||||
$('<td>')
|
||||
.addClass(
|
||||
'OxCell Ox' + (self.options.items.length ? 'Submenu' : 'Key')
|
||||
)
|
||||
.html(
|
||||
self.options.items.length
|
||||
? Ox.UI.symbols.triangle_right
|
||||
: Ox.UI.symbols[self.options.keyboard.key]
|
||||
|| self.options.keyboard.key.toUpperCase()
|
||||
})
|
||||
|| self.options.keyboard.key.toUpperCase()
|
||||
)
|
||||
);
|
||||
|
||||
function parseKeyboard(str) {
|
||||
|
|
Loading…
Reference in a new issue