From ced7dbe65a74541075546167d0e874d80b40465d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Sun, 19 Jun 2011 13:09:50 +0200 Subject: [PATCH] item map --- static/js/pandora/ui/item.js | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/static/js/pandora/ui/item.js b/static/js/pandora/ui/item.js index 49468b17..a0902d58 100644 --- a/static/js/pandora/ui/item.js +++ b/static/js/pandora/ui/item.js @@ -97,7 +97,39 @@ pandora.ui.item = function() { } } else if (pandora.user.ui.itemView == 'map') { - pandora.$ui.contentPanel.replaceElement(1, Ox.Element().html('Map')); + pandora.$ui.contentPanel.replaceElement(1, new Ox.SplitPanel({ + elements: [ + { + element: pandora.$ui.map = Ox.Map({ + height: window.innerHeight - pandora.user.ui.showGroups * pandora.user.ui.groupsSize - 61, + places: function(data, callback) { + var itemQuery = {conditions: [{ + key: 'id', + value: pandora.user.ui.item, + operator: '=' + }]}, + query = {conditions:[]}; + return pandora.api.findPlaces($.extend(data, { + itemQuery: itemQuery, + query: query + }), callback); + }, + showTypes: true, + toolbar: true, + width: window.innerWidth - pandora.user.ui.showSidebar * pandora.user.ui.sidebarSize - 2 - 144 - Ox.UI.SCROLLBAR_SIZE + }) + }, + { + element: new Ox.Element(), + id: 'place', + size: 144 + Ox.UI.SCROLLBAR_SIZE + } + ], + orientation: 'horizontal' + }) + .bindEvent('resize', function() { + pandora.$ui.map.resizeMap(); + })); } else if (pandora.user.ui.itemView == 'player') { var video = result.data.stream, format = $.support.video.supportedFormat(video.formats);