use new form element syntax

This commit is contained in:
rolux 2011-12-22 07:27:48 +00:00
parent e86d25fd55
commit f945b91907
6 changed files with 19 additions and 17 deletions

View file

@ -31,7 +31,6 @@ pandora.ui.findElement = function() {
? { ? {
id: key.id, id: key.id,
title: 'Find: ' + key.title, title: 'Find: ' + key.title,
checked: findKey == key.id
} : null; } : null;
}), }),
[{}, { [{}, {
@ -41,6 +40,7 @@ pandora.ui.findElement = function() {
}] }]
), ),
overlap: 'right', overlap: 'right',
value: findKey,
width: 112 width: 112
}) })
.bindEvent({ .bindEvent({

View file

@ -39,7 +39,7 @@ pandora.ui.folders = function() {
{ id: 'editlist', title: 'Edit Selected List...', disabled: !pandora.user.ui._list }, { id: 'editlist', title: 'Edit Selected List...', disabled: !pandora.user.ui._list },
{ id: 'deletelist', title: 'Delete Selected List...', disabled: !pandora.user.ui._list } { id: 'deletelist', title: 'Delete Selected List...', disabled: !pandora.user.ui._list }
], ],
title: 'set', title: 'edit',
tooltip: 'Manage Personal Lists', tooltip: 'Manage Personal Lists',
type: 'image' type: 'image'
}) })
@ -190,7 +190,7 @@ pandora.ui.folders = function() {
{}, {},
{ id: 'import', title: 'Import Movies...', disabled: true } { id: 'import', title: 'Import Movies...', disabled: true }
], ],
title: 'set', title: 'edit',
tooltip: 'Manage Volumes', tooltip: 'Manage Volumes',
type: 'image' type: 'image'
}) })

View file

@ -3,12 +3,13 @@
pandora.ui.sectionButtons = function() { pandora.ui.sectionButtons = function() {
var that = Ox.ButtonGroup({ var that = Ox.ButtonGroup({
buttons: [ buttons: [
{id: 'items', selected: pandora.user.ui.section == 'items', title: pandora.site.itemName.plural}, {id: 'items', title: pandora.site.itemName.plural},
{id: 'edits', selected: pandora.user.ui.section == 'edits', title: 'Edits', disabled: true}, {id: 'edits', title: 'Edits', disabled: true},
{id: 'texts', selected: pandora.user.ui.section == 'texts', title: 'Texts', disabled: true} {id: 'texts', title: 'Texts', disabled: true}
], ],
id: 'sectionButtons', id: 'sectionButtons',
selectable: true selectable: true,
value: pandora.user.ui.section
}).css({ }).css({
float: 'left', float: 'left',
margin: '4px' margin: '4px'

View file

@ -5,10 +5,11 @@ pandora.ui.sectionSelect = function() {
var that = Ox.Select({ var that = Ox.Select({
id: 'sectionSelect', id: 'sectionSelect',
items: [ items: [
{checked: pandora.user.ui.section == 'items', id: 'items', title: pandora.site.itemName.plural}, {id: 'items', title: pandora.site.itemName.plural},
{checked: pandora.user.ui.section == 'edits', id: 'edits', title: 'Edits', disabled: true}, {id: 'edits', title: 'Edits', disabled: true},
{checked: pandora.user.ui.section == 'texts', id: 'texts', title: 'Texts', disabled: true} {id: 'texts', title: 'Texts', disabled: true}
] ],
value: pandora.user.ui.section
}).css({ }).css({
float: 'left', float: 'left',
margin: '4px' margin: '4px'

View file

@ -21,7 +21,6 @@ pandora.ui.sortSelect = function(isNavigationView) {
items = Ox.merge(items, Ox.map(pandora.site.sortKeys, function(key) { items = Ox.merge(items, Ox.map(pandora.site.sortKeys, function(key) {
return Ox.getPositionById(items, key.id) == -1 return Ox.getPositionById(items, key.id) == -1
? Ox.extend(Ox.clone(key), { ? Ox.extend(Ox.clone(key), {
checked: key.id == pandora.user.ui[sortKey][0].key,
title: 'Sort by ' + key.title title: 'Sort by ' + key.title
}) })
: null; : null;
@ -30,6 +29,7 @@ pandora.ui.sortSelect = function(isNavigationView) {
that = Ox.Select({ that = Ox.Select({
id: 'sortSelect', id: 'sortSelect',
items: items, items: items,
value: pandora.user.ui[sortKey][0].key,
width: isNavigationView ? 128 : 144 width: isNavigationView ? 128 : 144
}) })
.css({ .css({
@ -45,10 +45,10 @@ pandora.ui.sortSelect = function(isNavigationView) {
}]); }]);
}, },
pandora_listsort: function(data) { pandora_listsort: function(data) {
that.selectItem(data.value[0].key); that.value(data.value[0].key);
}, },
pandora_itemsort: function(data) { pandora_itemsort: function(data) {
that.selectItem(data.value[0].key); that.value(data.value[0].key);
} }
}); });
return that; return that;

View file

@ -13,11 +13,11 @@ pandora.ui.viewSelect = function() {
|| ['data', 'files'].indexOf(view.id) == -1 || ['data', 'files'].indexOf(view.id) == -1
|| pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level] || pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level]
? Ox.extend(Ox.clone(view), { ? Ox.extend(Ox.clone(view), {
checked: view.id == ui[viewKey],
title: 'View ' + view.title title: 'View ' + view.title
}) })
: null; : null;
}), }),
value: ui[viewKey],
width: !ui.item ? 144 : 128 width: !ui.item ? 144 : 128
}) })
.css({ .css({
@ -29,10 +29,10 @@ pandora.ui.viewSelect = function() {
pandora.UI.set(viewKey, data.value); pandora.UI.set(viewKey, data.value);
}, },
pandora_listview: function(data) { pandora_listview: function(data) {
that.selectItem(data.value); that.value(data.value);
}, },
pandora_itemview: function(data) { pandora_itemview: function(data) {
that.selectItem(data.value); that.value(data.value);
} }
}); });
return that; return that;