From f945b9190722ebfaff2ab26e73cc356eea732e37 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 22 Dec 2011 07:27:48 +0000 Subject: [PATCH] use new form element syntax --- static/js/pandora/findElement.js | 2 +- static/js/pandora/folders.js | 4 ++-- static/js/pandora/sectionButtons.js | 9 +++++---- static/js/pandora/sectionSelect.js | 9 +++++---- static/js/pandora/sortSelect.js | 6 +++--- static/js/pandora/viewSelect.js | 6 +++--- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/static/js/pandora/findElement.js b/static/js/pandora/findElement.js index 7beb2b16..6e1550b8 100644 --- a/static/js/pandora/findElement.js +++ b/static/js/pandora/findElement.js @@ -31,7 +31,6 @@ pandora.ui.findElement = function() { ? { id: key.id, title: 'Find: ' + key.title, - checked: findKey == key.id } : null; }), [{}, { @@ -41,6 +40,7 @@ pandora.ui.findElement = function() { }] ), overlap: 'right', + value: findKey, width: 112 }) .bindEvent({ diff --git a/static/js/pandora/folders.js b/static/js/pandora/folders.js index 7dac9b04..12b0eac3 100644 --- a/static/js/pandora/folders.js +++ b/static/js/pandora/folders.js @@ -39,7 +39,7 @@ pandora.ui.folders = function() { { id: 'editlist', title: 'Edit 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', type: 'image' }) @@ -190,7 +190,7 @@ pandora.ui.folders = function() { {}, { id: 'import', title: 'Import Movies...', disabled: true } ], - title: 'set', + title: 'edit', tooltip: 'Manage Volumes', type: 'image' }) diff --git a/static/js/pandora/sectionButtons.js b/static/js/pandora/sectionButtons.js index d705642f..8e4bb831 100644 --- a/static/js/pandora/sectionButtons.js +++ b/static/js/pandora/sectionButtons.js @@ -3,12 +3,13 @@ pandora.ui.sectionButtons = function() { var that = Ox.ButtonGroup({ buttons: [ - {id: 'items', selected: pandora.user.ui.section == 'items', title: pandora.site.itemName.plural}, - {id: 'edits', selected: pandora.user.ui.section == 'edits', title: 'Edits', disabled: true}, - {id: 'texts', selected: pandora.user.ui.section == 'texts', title: 'Texts', disabled: true} + {id: 'items', title: pandora.site.itemName.plural}, + {id: 'edits', title: 'Edits', disabled: true}, + {id: 'texts', title: 'Texts', disabled: true} ], id: 'sectionButtons', - selectable: true + selectable: true, + value: pandora.user.ui.section }).css({ float: 'left', margin: '4px' diff --git a/static/js/pandora/sectionSelect.js b/static/js/pandora/sectionSelect.js index 81da14fe..4a03da6c 100644 --- a/static/js/pandora/sectionSelect.js +++ b/static/js/pandora/sectionSelect.js @@ -5,10 +5,11 @@ pandora.ui.sectionSelect = function() { var that = Ox.Select({ id: 'sectionSelect', items: [ - {checked: pandora.user.ui.section == 'items', id: 'items', title: pandora.site.itemName.plural}, - {checked: pandora.user.ui.section == 'edits', id: 'edits', title: 'Edits', disabled: true}, - {checked: pandora.user.ui.section == 'texts', id: 'texts', title: 'Texts', disabled: true} - ] + {id: 'items', title: pandora.site.itemName.plural}, + {id: 'edits', title: 'Edits', disabled: true}, + {id: 'texts', title: 'Texts', disabled: true} + ], + value: pandora.user.ui.section }).css({ float: 'left', margin: '4px' diff --git a/static/js/pandora/sortSelect.js b/static/js/pandora/sortSelect.js index f8628db1..9457a140 100644 --- a/static/js/pandora/sortSelect.js +++ b/static/js/pandora/sortSelect.js @@ -21,7 +21,6 @@ pandora.ui.sortSelect = function(isNavigationView) { items = Ox.merge(items, Ox.map(pandora.site.sortKeys, function(key) { return Ox.getPositionById(items, key.id) == -1 ? Ox.extend(Ox.clone(key), { - checked: key.id == pandora.user.ui[sortKey][0].key, title: 'Sort by ' + key.title }) : null; @@ -30,6 +29,7 @@ pandora.ui.sortSelect = function(isNavigationView) { that = Ox.Select({ id: 'sortSelect', items: items, + value: pandora.user.ui[sortKey][0].key, width: isNavigationView ? 128 : 144 }) .css({ @@ -45,10 +45,10 @@ pandora.ui.sortSelect = function(isNavigationView) { }]); }, pandora_listsort: function(data) { - that.selectItem(data.value[0].key); + that.value(data.value[0].key); }, pandora_itemsort: function(data) { - that.selectItem(data.value[0].key); + that.value(data.value[0].key); } }); return that; diff --git a/static/js/pandora/viewSelect.js b/static/js/pandora/viewSelect.js index 55088cc9..2b27b839 100644 --- a/static/js/pandora/viewSelect.js +++ b/static/js/pandora/viewSelect.js @@ -13,11 +13,11 @@ pandora.ui.viewSelect = function() { || ['data', 'files'].indexOf(view.id) == -1 || pandora.site.capabilities.canSeeExtraItemViews[pandora.user.level] ? Ox.extend(Ox.clone(view), { - checked: view.id == ui[viewKey], title: 'View ' + view.title }) : null; }), + value: ui[viewKey], width: !ui.item ? 144 : 128 }) .css({ @@ -29,10 +29,10 @@ pandora.ui.viewSelect = function() { pandora.UI.set(viewKey, data.value); }, pandora_listview: function(data) { - that.selectItem(data.value); + that.value(data.value); }, pandora_itemview: function(data) { - that.selectItem(data.value); + that.value(data.value); } }); return that;