fix bugs with images in text lists

This commit is contained in:
rolux 2011-11-03 12:58:22 +00:00
parent a1d9a08e36
commit 9c55c93fc1
8 changed files with 36 additions and 47 deletions

View file

@ -557,7 +557,7 @@
"system": "0xdb@0xdb.org"
},
"id": "oxdb",
"name": "0xDb",
"name": "0xDB",
"url": "0xdb.org",
"videoprefix": ""
},

View file

@ -31,9 +31,7 @@ pandora.ui.folderBrowserList = function(id) {
},
*/
id: 'id',
title: $('<img>').attr({
src: Ox.UI.getImageURL('symbolIcon')
}),
titleImage: 'icon',
unique: true,
visible: true,
width: 16
@ -79,10 +77,7 @@ pandora.ui.folderBrowserList = function(id) {
},
id: 'type',
operator: '+',
title: $('<img>')
.attr({
src: Ox.UI.getImageURL('symbolEdit')
}),
titleImage: 'edit',
tooltip: function(data) {
return data.type == 'smart'
? (data.user == pandora.user.username ? 'Edit Query' : 'Show Query')
@ -111,12 +106,7 @@ pandora.ui.folderBrowserList = function(id) {
},
id: id == 'favorite' ? 'subscribed' : 'status',
operator: '+',
title: $('<img>')
.attr({
src: Ox.UI.getImageURL(
'symbol' + (id == 'favorite' ? 'Like' : 'Star')
)
}),
titleImage: id == 'favorite' ? 'like' : 'star',
tooltip: function(data) {
var checked = id == 'favorite' ? data.subscribed : data.status == 'featured';
return (checked ? 'Remove from' : 'Add to')

View file

@ -36,9 +36,8 @@ 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 }
],
max: 0,
min: 0,
selectable: false,
title: 'set', // FIXME: why does this work in VideoEditor, but not here?
tooltip: 'Manage Personal Lists',
type: 'image'
})

View file

@ -11,7 +11,7 @@ pandora.ui.group = function(id) {
align: 'left',
id: 'name',
format: function(value) {
return ['country', 'language'].indexOf(id) > -1
return ['country', 'language'].indexOf(id) > -1 && pandora.user.ui.showFlags
? $('<div>')
.append(
$('<img>')
@ -28,6 +28,7 @@ pandora.ui.group = function(id) {
)
.append(
$('<div>')
.addClass('flagname')
.css({
float: 'left',
width: pandora.user.ui.groupsSizes[i] - 64 - Ox.UI.SCROLLBAR_SIZE,

View file

@ -56,25 +56,8 @@ pandora.ui.list = function() {
},
id: 'posterRatio',
resizable: false,
///*
title: '<img src="' + Ox.UI.getImageURL(
pandora.user.ui.icons == 'posters'
? 'symbolSetPoster' : 'symbolIcon'
) + '" style="width: 12px; height: 12px; margin: 0 0 0 -2px">',
//*/
/*
title: $('<img>').attr({
src: Ox.UI.getImageURL(
pandora.user.ui.icons == 'posters'
? 'symbolSetPoster' : 'symbolIcon'
)
})
.css({
width: '12px',
height: '12px',
margin: '0 0 0 -2px'
}),
*/
title: 'Icon',
titleImage: pandora.user.ui.icons == 'posters' ? 'SetPoster' : 'Icon',
visible: pandora.user.ui.listColumns.indexOf('posterRatio') > -1,
width: 16
}], Ox.map(pandora.site.sortKeys, function(key) {
@ -550,11 +533,25 @@ pandora.ui.list = function() {
if (['list', 'grid', 'timelines'].indexOf(pandora.user.ui.listView) > -1) {
that.bindEvent({
pandora_icons: function(data) {
var src, previousSrc;
// fixme: doesn't update title icon, passes useless options
hasIcons() && that.options({
borderRadius: data.value == 'posters' ? 0 : 16,
defaultRatio: data.value == 'posters' ? 5/8 : 1
}).reloadList(true);
if (hasIcons()) {
if (pandora.user.ui.listView == 'list') {
src = Ox.UI.getImageURL(
data.value == 'posters' ? 'symbolSetPoster' : 'symbolIcon'
);
previousSrc = Ox.UI.getImageURL(
data.previousValue == 'posters' ? 'symbolSetPoster' : 'symbolIcon'
)
that.$element.find('img[src="' + previousSrc + '"]').attr({src: src});
} else {
that.options({
borderRadius: data.value == 'posters' ? 0 : 16,
defaultRatio: data.value == 'posters' ? 5/8 : 1
});
}
that.reloadList(true);
}
},
pandora_showsiteposter: function() {
// fixme: should be disabled if ui.icons != 'posters'

View file

@ -107,8 +107,8 @@ pandora.ui.logsDialog = function() {
init: function(data) {
numberOfLogs = data.items;
$status.html(
Ox.formatNumber(numberOfLogs)
+ ' log ' + (numberOfLogs == 1 ? 'entry' : 'entries')
Ox.formatNumber(numberOfLogs) + ' '
+ (numberOfLogs == 1 ? 'entry' : 'entries')
);
},
'delete': function(data) {
@ -189,8 +189,8 @@ pandora.ui.logsDialog = function() {
.css({
position: 'absolute',
top: '4px',
left: '4px',
right: '256px',
left: '128px',
right: '128px',
bottom: '4px',
paddingTop: '2px',
fontSize: '9px',

View file

@ -41,7 +41,6 @@ pandora.ui.mainPanel = function() {
}
},
pandora_item: function(data) {
Ox.print('PANDORA_ITEM', data.value, data.previousValue)
if (!data.value || !data.previousValue) {
that.replaceElement(1, pandora.$ui.rightPanel = pandora.ui.rightPanel());
}

View file

@ -752,8 +752,11 @@ pandora.resizeGroups = function(width) {
pandora.$ui.groupsInnerPanel
.size(0, pandora.user.ui.groupsSizes[1])
.size(2, pandora.user.ui.groupsSizes[3]);
pandora.$ui.groups.forEach(function(list, i) {
list.resizeColumn('name', pandora.user.ui.groupsSizes[i] - 40 - Ox.UI.SCROLLBAR_SIZE);
pandora.$ui.groups.forEach(function($list, i) {
$list.resizeColumn('name', pandora.user.ui.groupsSizes[i] - 40 - Ox.UI.SCROLLBAR_SIZE);
if (pandora.user.ui.showFlags) {
$list.find('.flagname').css({width: pandora.user.ui.groupsSizes[i] - 64 - Ox.UI.SCROLLBAR_SIZE})
}
});
};