From 27b11d0ce9b37bcc56eba66a8fa63d26b64dd3bd Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 24 Oct 2011 18:47:29 +0000 Subject: [PATCH] add tooltip when country and year are editable --- static/js/pandora/folderBrowserList.js | 14 ++++++++++++++ static/js/pandora/infoView.js | 2 ++ 2 files changed, 16 insertions(+) diff --git a/static/js/pandora/folderBrowserList.js b/static/js/pandora/folderBrowserList.js index 5bce352e8..38d69a121 100644 --- a/static/js/pandora/folderBrowserList.js +++ b/static/js/pandora/folderBrowserList.js @@ -7,6 +7,19 @@ pandora.ui.folderBrowserList = function(id) { that = Ox.TextList({ columns: [ { + clickable: true, + format: function(value) { + return $('').attr({ + src: '/list/' + value + '/icon16.jpg' + }).css({ + width: '14px', + height: '14px', + borderRadius: '4px', + margin: '0 0 0 -3px' + }); + }, + // FIXME: why does the above only work with clickable: true ?? + /* format: function() { return $('').attr({ src: Ox.UI.getImageURL('symbolIcon') @@ -16,6 +29,7 @@ pandora.ui.folderBrowserList = function(id) { padding: '3px' }); }, + */ id: 'id', operator: '+', title: $('').attr({ diff --git a/static/js/pandora/infoView.js b/static/js/pandora/infoView.js index 4be57d691..46758168e 100644 --- a/static/js/pandora/infoView.js +++ b/static/js/pandora/infoView.js @@ -197,11 +197,13 @@ pandora.ui.infoView = function(data) { .html(formatKey(key).replace('', ' ')) .appendTo($div); Ox.Editable({ + clickLink: clickLink, format: function(value) { return value ? formatValue(value.split(', '), key) : formatLight('unknown'); }, + tooltip: 'Doubleclick to edit', value: key == 'country' ? (data[key] ? data[key].join(', ') : ['']) : data[key] || ''