forked from 0x2620/oxjs
simpler text list column head elements, better column drag
This commit is contained in:
parent
7bf42e5b0b
commit
0ba258281f
12 changed files with 461 additions and 330 deletions
|
|
@ -36,7 +36,7 @@ Ox.MenuItem = function(options, self) {
|
|||
position: 0,
|
||||
title: [],
|
||||
})
|
||||
.options($.extend(options, {
|
||||
.options(Ox.extend(options, {
|
||||
keyboard: parseKeyboard(options.keyboard || self.defaults.keyboard),
|
||||
title: Ox.toArray(options.title || self.defaults.title)
|
||||
}))
|
||||
|
|
@ -63,10 +63,8 @@ Ox.MenuItem = function(options, self) {
|
|||
that.$icon = $('<td>', {
|
||||
'class': 'OxCell OxIcon'
|
||||
})
|
||||
.append(self.options.icon ?
|
||||
$('<img>', {
|
||||
src: self.options.icon
|
||||
}) : null
|
||||
.append(self.options.icon
|
||||
? $('<img>', {src: self.options.icon}) : null
|
||||
)
|
||||
)
|
||||
.append(
|
||||
|
|
@ -78,17 +76,19 @@ Ox.MenuItem = function(options, self) {
|
|||
.append(
|
||||
$('<td>', {
|
||||
'class': 'OxCell OxModifiers',
|
||||
html: $.map(self.options.keyboard.modifiers, function(modifier) {
|
||||
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 ? Ox.UI.symbols.triangle_right :
|
||||
Ox.UI.symbols[self.options.keyboard.key] ||
|
||||
self.options.keyboard.key.toUpperCase()
|
||||
'class': '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()
|
||||
})
|
||||
);
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ Ox.MenuItem = function(options, self) {
|
|||
if (key == 'checked') {
|
||||
that.$status.html(value ? Ox.UI.symbols.check : '')
|
||||
} else if (key == 'disabled') {
|
||||
that.toggleClass('OxDisabled'); // fixme: this will only work if onChange is only invoked on actual change
|
||||
that.toggleClass('OxDisabled');
|
||||
} else if (key == 'title') {
|
||||
self.options.title = Ox.toArray(value);
|
||||
that.$title.html(self.options.title[0]);
|
||||
|
|
@ -120,12 +120,11 @@ Ox.MenuItem = function(options, self) {
|
|||
};
|
||||
|
||||
/*@
|
||||
toggelChecked <f> toggleChecked
|
||||
toggleChecked <f> toggleChecked
|
||||
@*/
|
||||
that.toggleChecked = function() {
|
||||
that.options({
|
||||
checked: !self.options.checked
|
||||
});
|
||||
that.options({checked: !self.options.checked});
|
||||
return that;
|
||||
};
|
||||
|
||||
that.toggleDisabled = function() {
|
||||
|
|
@ -133,13 +132,11 @@ Ox.MenuItem = function(options, self) {
|
|||
};
|
||||
|
||||
/*@
|
||||
toggelTitle <f> toggleTitle
|
||||
toggleTitle <f> toggleTitle
|
||||
@*/
|
||||
that.toggleTitle = function() {
|
||||
//Ox.print('s.o.t', self.options.title)
|
||||
that.options({
|
||||
title: self.options.title.reverse()
|
||||
});
|
||||
that.options({title: self.options.title.reverse()});
|
||||
return that;
|
||||
};
|
||||
|
||||
return that;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue