From fcaf7c037555c598875c07482c945181786b350f Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 28 Jun 2012 00:24:02 +0200 Subject: [PATCH] in TableLists, use options.unique, not options.columns[i].unique --- static/js/pandora/filesView.js | 7 ++++--- static/js/pandora/filter.js | 4 ++-- static/js/pandora/folderBrowserList.js | 6 ++---- static/js/pandora/folderList.js | 5 ++--- static/js/pandora/list.js | 4 ++-- static/js/pandora/logsDialog.js | 6 ++---- static/js/pandora/namesDialog.js | 4 ++-- static/js/pandora/titlesDialog.js | 4 ++-- static/js/pandora/usersDialog.js | 9 ++------- 9 files changed, 20 insertions(+), 29 deletions(-) diff --git a/static/js/pandora/filesView.js b/static/js/pandora/filesView.js index 9904dc2d6..4619b7c57 100644 --- a/static/js/pandora/filesView.js +++ b/static/js/pandora/filesView.js @@ -168,7 +168,6 @@ pandora.ui.filesView = function(options, self) { id: 'id', operator: '+', title: 'ID', - unique: true, visible: false, width: 120 }, @@ -199,7 +198,8 @@ pandora.ui.filesView = function(options, self) { }, keys: ['wanted', 'instances'], scrollbarVisible: true, - sort: [{key: 'path', operator: '+'}] + sort: [{key: 'path', operator: '+'}], + unique: 'id' }) .bindEvent({ click: function(data) { @@ -269,7 +269,8 @@ pandora.ui.filesView = function(options, self) { id: 'files', items: [], scrollbarVisible: true, - sort: [{key: 'user', operator: '+'}] + sort: [{key: 'user', operator: '+'}], + unique: 'path' }); self.$movieLabel = Ox.Label({ diff --git a/static/js/pandora/filter.js b/static/js/pandora/filter.js index 6784c729c..320fc4d98 100644 --- a/static/js/pandora/filter.js +++ b/static/js/pandora/filter.js @@ -45,7 +45,6 @@ pandora.ui.filter = function(id) { }, operator: filter.type == 'string' ? '+' : '-', title: title, - unique: true, visible: true, width: pandora.user.ui.filterSizes[i] - 40 - Ox.UI.SCROLLBAR_SIZE }, @@ -78,7 +77,8 @@ pandora.ui.filter = function(id) { sort: [{ key: pandora.user.ui.filters[i].sort[0].key, operator: pandora.user.ui.filters[i].sort[0].operator - }] + }], + unique: 'name' }) .bindEvent({ paste: function(data) { diff --git a/static/js/pandora/folderBrowserList.js b/static/js/pandora/folderBrowserList.js index a940e8a37..2d1e1029f 100644 --- a/static/js/pandora/folderBrowserList.js +++ b/static/js/pandora/folderBrowserList.js @@ -33,7 +33,6 @@ pandora.ui.folderBrowserList = function(id) { */ id: 'id', titleImage: 'icon', - unique: true, visible: true, width: 16 }, @@ -141,9 +140,8 @@ pandora.ui.folderBrowserList = function(id) { keys: id == 'featured' ? ['subscribed'] : [], pageLength: 1000, selected: pandora.getListData().folder == id ? [pandora.user.ui._list] : [], - sort: [ - {key: 'name', operator: '+'} - ] + sort: [{key: 'name', operator: '+'}], + unique: 'id' }) .bindEvent({ click: function(data) { diff --git a/static/js/pandora/folderList.js b/static/js/pandora/folderList.js index f54546a33..45a3d9904 100644 --- a/static/js/pandora/folderList.js +++ b/static/js/pandora/folderList.js @@ -39,7 +39,6 @@ pandora.ui.folderList = function(id) { }, id: 'id', operator: '+', - unique: true, visible: id == 'favorite', // fixme: user and name are set to the same width here, // but resizeFolders will set them to different widths @@ -167,7 +166,6 @@ pandora.ui.folderList = function(id) { id: 'name', operator: '+', tooltip: 'Edit Title', - unique: true, visible: true, width: pandora.user.ui.sidebarWidth - 96 }, @@ -249,7 +247,8 @@ pandora.ui.folderList = function(id) { pageLength: 1000, //selected: pandora.getListData().folder == id ? [pandora.user.ui._list] : [], sort: [{key: 'position', operator: '+'}], - sortable: id != 'featured' || canEditFeaturedLists + sortable: id != 'featured' || canEditFeaturedLists, + unique: id != 'volumes' ? 'id' : 'name' }) .css({ left: 0, diff --git a/static/js/pandora/list.js b/static/js/pandora/list.js index aa95efeaf..cbfb2fda2 100644 --- a/static/js/pandora/list.js +++ b/static/js/pandora/list.js @@ -69,7 +69,6 @@ pandora.ui.list = function() { removable: !key.columnRequired, title: key.title, type: key.type, - unique: key.id == 'id', visible: position > -1, width: pandora.user.ui.listColumnWidth[key.id] || key.columnWidth }; @@ -88,7 +87,8 @@ pandora.ui.list = function() { }, scrollbarVisible: true, selected: pandora.user.ui.listSelection, - sort: pandora.user.ui.listSort + sort: pandora.user.ui.listSort, + unique: 'id' }) .bindEvent({ columnchange: function(data) { diff --git a/static/js/pandora/logsDialog.js b/static/js/pandora/logsDialog.js index a271caa99..159502df0 100644 --- a/static/js/pandora/logsDialog.js +++ b/static/js/pandora/logsDialog.js @@ -56,7 +56,6 @@ pandora.ui.logsDialog = function() { { id: 'id', title: 'ID', - unique: true, visible: false }, { @@ -107,9 +106,8 @@ pandora.ui.logsDialog = function() { items: pandora.api.findLogs, keys: ['line'], scrollbarVisible: true, - sort: [ - {key: 'created', operator: '-'} - ] + sort: [{key: 'created', operator: '-'}], + unique: 'id' }) .bindEvent({ init: function(data) { diff --git a/static/js/pandora/namesDialog.js b/static/js/pandora/namesDialog.js index ccb4df9c9..cd44d2a35 100644 --- a/static/js/pandora/namesDialog.js +++ b/static/js/pandora/namesDialog.js @@ -35,7 +35,6 @@ pandora.ui.namesDialog = function() { { id: 'id', title: 'ID', - unique: true, visible: false, width: 0 }, @@ -69,7 +68,8 @@ pandora.ui.namesDialog = function() { items: pandora.api.findNames, max: 1, scrollbarVisible: true, - sort: [{key: 'sortname', operator: '+'}] + sort: [{key: 'sortname', operator: '+'}], + unique: 'id' }) .bindEvent({ init: function(data) { diff --git a/static/js/pandora/titlesDialog.js b/static/js/pandora/titlesDialog.js index a09e54228..4ac15ff95 100644 --- a/static/js/pandora/titlesDialog.js +++ b/static/js/pandora/titlesDialog.js @@ -33,7 +33,6 @@ pandora.ui.titlesDialog = function() { { id: 'id', title: 'ID', - unique: true, visible: false }, { @@ -58,7 +57,8 @@ pandora.ui.titlesDialog = function() { keys: [], max: 1, scrollbarVisible: true, - sort: [{key: 'sorttitle', operator: '+'}] + sort: [{key: 'sorttitle', operator: '+'}], + unique: 'id' }) .bindEvent({ init: function(data) { diff --git a/static/js/pandora/usersDialog.js b/static/js/pandora/usersDialog.js index 4ed67c9e7..9dc53d31e 100644 --- a/static/js/pandora/usersDialog.js +++ b/static/js/pandora/usersDialog.js @@ -95,12 +95,6 @@ pandora.ui.usersDialog = function() { $list = Ox.TableList({ columns: [ - { - id: 'id', - title: 'ID', - unique: true, - visible: false - }, { format: function(value, data) { return $('') @@ -371,7 +365,8 @@ pandora.ui.usersDialog = function() { keys: ['notes', 'groups'], max: -1, scrollbarVisible: true, - sort: [{key: 'lastseen', operator: '-'}] + sort: [{key: 'lastseen', operator: '-'}], + unique: 'id' }) .bindEvent({ init: function(data) {