resize map on window and browser resize

This commit is contained in:
rolux 2011-10-03 00:08:00 +00:00
parent 18810602fb
commit 6810af3164
2 changed files with 43 additions and 31 deletions

View file

@ -180,35 +180,36 @@ Ox.load({
pandora.$ui.leftPanel.size(2, pandora.getInfoHeight()); pandora.$ui.leftPanel.size(2, pandora.getInfoHeight());
pandora.$ui.info.resizeInfo(); pandora.$ui.info.resizeInfo();
if (!pandora.user.ui.item) { if (!pandora.user.ui.item) {
pandora.$ui.list.size();
pandora.resizeGroups(pandora.$ui.rightPanel.width()); pandora.resizeGroups(pandora.$ui.rightPanel.width());
if (!pandora.user.ui.item) {
if (pandora.user.ui.listView == 'map') { if (pandora.user.ui.listView == 'map') {
pandora.$ui.map.resize(); pandora.$ui.map.resizeMap();
} else if (pandora.user.ui.listView == 'calendar') {
// ...
} else { } else {
pandora.$ui.list.size(); pandora.$ui.list.size();
} }
// ...
} else {
if (pandora.user.ui.itemView == 'map') {
pandora.$ui.map.resize();
}
// ...
}
} else { } else {
//Ox.print('pandora.$ui.window.resize'); //Ox.print('pandora.$ui.window.resize');
pandora.$ui.browser.scrollToSelection(); pandora.$ui.browser.scrollToSelection();
pandora.user.ui.itemView == 'info' && pandora.$ui.item.resize(); if (pandora.user.ui.itemView == 'info') {
pandora.user.ui.itemView == 'video' && pandora.$ui.player.options({ pandora.$ui.info.resize();
} else if (pandora.user.ui.itemView == 'video') {
pandora.$ui.player.options({
// fixme: duplicated // fixme: duplicated
height: pandora.$ui.contentPanel.size(1), height: pandora.$ui.contentPanel.size(1),
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1 width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
}); });
pandora.user.ui.itemView == 'timeline' && pandora.$ui.editor.options({ } else if (pandora.user.ui.itemView == 'timeline') {
pandora.$ui.editor.options({
// fixme: duplicated // fixme: duplicated
height: pandora.$ui.contentPanel.size(1), height: pandora.$ui.contentPanel.size(1),
width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1 width: pandora.$ui.document.width() - pandora.$ui.mainPanel.size(0) - 1
}); });
} else if (pandora.user.ui.itemView == 'map') {
pandora.$ui.map.resizeMap();
} else if (pandora.user.ui.itemView == 'calendar') {
// ...
}
} }
} }

View file

@ -26,15 +26,9 @@ pandora.ui.browser = function() {
pandora.$ui.groups.forEach(function(list) { pandora.$ui.groups.forEach(function(list) {
list.size(); list.size();
}); });
if (!pandora.user.ui.item) {
if (pandora.user.ui.listView == 'map') { if (pandora.user.ui.listView == 'map') {
pandora.$ui.map.resize(); pandora.$ui.map.resizeMap();
} } else if (pandora.user.ui.listView == 'calendar') {
// ...
} else {
if (pandora.user.ui.itemView == 'map') {
pandora.$ui.map.resize();
}
// ... // ...
} }
}, },
@ -44,6 +38,11 @@ pandora.ui.browser = function() {
toggle: function(data) { toggle: function(data) {
data.collapsed && pandora.$ui.list.gainFocus(); data.collapsed && pandora.$ui.list.gainFocus();
pandora.UI.set({showGroups: !data.collapsed}); pandora.UI.set({showGroups: !data.collapsed});
if (pandora.user.ui.listView == 'map') {
pandora.$ui.map.resizeMap();
} else if (pandora.user.ui.listView == 'calendar') {
// ...
}
} }
}); });
} else { } else {
@ -88,6 +87,13 @@ pandora.ui.browser = function() {
open: function() { open: function() {
that.scrollToSelection(); that.scrollToSelection();
}, },
resize: function(data) {
if (pandora.user.ui.itemView == 'map') {
pandora.ui.$map.resizeMap();
} else if (pandora.user.ui.itemView == 'calendar') {
// ...
}
},
select: function(data) { select: function(data) {
pandora.UI.set({ pandora.UI.set({
'item': data.ids[0] 'item': data.ids[0]
@ -100,6 +106,11 @@ pandora.ui.browser = function() {
pandora.$ui.editor.gainFocus(); pandora.$ui.editor.gainFocus();
} }
} }
if (pandora.user.ui.itemView == 'map') {
pandora.ui.$map.resizeMap();
} else if (pandora.user.ui.itemView == 'calendar') {
// ...
}
}, },
pandora_icons: function(data) { pandora_icons: function(data) {
that.options({ that.options({