From e10e860699c20244d7a6896e89eb634e9eff7af2 Mon Sep 17 00:00:00 2001 From: rolux Date: Tue, 11 Oct 2011 18:13:51 +0000 Subject: [PATCH] add find functionality to manage titles/names dialogs --- static/js/pandora/ui/eventsDialog.js | 3 ++- static/js/pandora/ui/namesDialog.js | 27 ++++++++++++++++++++++++--- static/js/pandora/ui/placesDialog.js | 3 ++- static/js/pandora/ui/titlesDialog.js | 27 ++++++++++++++++++++++++--- static/js/pandora/ui/usersDialog.js | 3 ++- 5 files changed, 54 insertions(+), 9 deletions(-) diff --git a/static/js/pandora/ui/eventsDialog.js b/static/js/pandora/ui/eventsDialog.js index 449696e2..988183ce 100644 --- a/static/js/pandora/ui/eventsDialog.js +++ b/static/js/pandora/ui/eventsDialog.js @@ -16,7 +16,8 @@ pandora.ui.eventsDialog = function() { {}, Ox.Button({ id: 'done', - title: 'Done' + title: 'Done', + width: 48 }).bindEvent({ click: function() { that.close(); diff --git a/static/js/pandora/ui/namesDialog.js b/static/js/pandora/ui/namesDialog.js index 9dad1b9d..47121f6b 100644 --- a/static/js/pandora/ui/namesDialog.js +++ b/static/js/pandora/ui/namesDialog.js @@ -87,6 +87,9 @@ pandora.ui.namesDialog = function() { .find('.OxItem.OxSelected > .OxCell.OxColumnSortname') .trigger('mousedown'); }, + select: function(data) { + $findButton.options({disabled: !data.ids.length}); + }, submit: function(data) { Ox.Request.clearCache('findNames'); pandora.api.editName({ @@ -96,10 +99,27 @@ pandora.ui.namesDialog = function() { } }), + $findButton = Ox.Button({ + disabled: true, + title: 'Find', + width: 48, + }).bindEvent({ + click: function() { + that.close(); + pandora.UI.set('find', { + conditions: [{ + key: 'name', + value: $list.value($list.options('selected'), 'name'), + operator: '=' + }], + operator: '&' + }) + } + }), + that = Ox.Dialog({ buttons: [ Ox.Button({ - id: 'manageTitles', title: 'Manage Titles...' }).bindEvent({ click: function() { @@ -107,9 +127,10 @@ pandora.ui.namesDialog = function() { } }), {}, + $findButton, Ox.Button({ - id: 'done', - title: 'Done' + title: 'Done', + width: 48 }).bindEvent({ click: function() { that.close(); diff --git a/static/js/pandora/ui/placesDialog.js b/static/js/pandora/ui/placesDialog.js index 64e67737..2b870b86 100644 --- a/static/js/pandora/ui/placesDialog.js +++ b/static/js/pandora/ui/placesDialog.js @@ -44,7 +44,8 @@ pandora.ui.placesDialog = function() { {}, Ox.Button({ id: 'done', - title: 'Done' + title: 'Done', + width: 48 }).bindEvent({ click: function() { that.close(); diff --git a/static/js/pandora/ui/titlesDialog.js b/static/js/pandora/ui/titlesDialog.js index 36172a4b..0b8bf43e 100644 --- a/static/js/pandora/ui/titlesDialog.js +++ b/static/js/pandora/ui/titlesDialog.js @@ -76,6 +76,9 @@ pandora.ui.titlesDialog = function() { .find('.OxItem.OxSelected > .OxCell.OxColumnSorttitle') .trigger('mousedown'); }, + select: function(data) { + $findButton.options({disabled: !data.ids.length}); + }, submit: function(data) { Ox.Request.clearCache('findTitles'); pandora.api.editTitle({ @@ -85,10 +88,27 @@ pandora.ui.titlesDialog = function() { } }), + $findButton = Ox.Button({ + disabled: true, + title: 'Find', + width: 48, + }).bindEvent({ + click: function() { + that.close(); + pandora.UI.set('find', { + conditions: [{ + key: 'title', + value: $list.value($list.options('selected'), 'title'), + operator: '=' + }], + operator: '&' + }) + } + }), + that = Ox.Dialog({ buttons: [ Ox.Button({ - id: 'manageNames', title: 'Manage Names...' }).bindEvent({ click: function() { @@ -96,9 +116,10 @@ pandora.ui.titlesDialog = function() { } }), {}, + $findButton, Ox.Button({ - id: 'done', - title: 'Done' + title: 'Done', + width: 48 }).bindEvent({ click: function() { that.close(); diff --git a/static/js/pandora/ui/usersDialog.js b/static/js/pandora/ui/usersDialog.js index 959d7199..fcd56b11 100644 --- a/static/js/pandora/ui/usersDialog.js +++ b/static/js/pandora/ui/usersDialog.js @@ -292,7 +292,8 @@ pandora.ui.usersDialog = function() { }), Ox.Button({ id: 'done', - title: 'Done' + title: 'Done', + width: 48 }).bindEvent({ click: function() { that.close();