From a9cf0306d475aa63816e3f22db2d8798d5e94346 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 20 Feb 2012 05:55:53 +0000 Subject: [PATCH] resize news, fixes #555 --- static/js/pandora/news.js | 14 +++++++++----- static/js/pandora/siteDialog.js | 2 +- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/static/js/pandora/news.js b/static/js/pandora/news.js index 86f392de..010dc264 100644 --- a/static/js/pandora/news.js +++ b/static/js/pandora/news.js @@ -13,7 +13,8 @@ pandora.ui.news = function(width, height) { ? 'rgb(32, 32, 32)' : 'rgb(224, 224, 224)', isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level], items = [], - selected; + selected, + $text; pandora.api.getNews({}, function(result) { items = result.data.items; @@ -60,7 +61,7 @@ pandora.ui.news = function(width, height) { function renderItem() { $left.empty(); - var $title, $date, $text, + var $title, $date, index = Ox.getIndexById(items, selected); $title = Ox.Editable({ editable: isEditable, @@ -182,10 +183,13 @@ pandora.ui.news = function(width, height) { }); } - that.resize = function() { - + that.resize = function(data) { + width = data.width; + height = data.height; + $left.css({width: width - 512}); + $text.css({width: width - 512}); }; return that; -}; \ No newline at end of file +}; diff --git a/static/js/pandora/siteDialog.js b/static/js/pandora/siteDialog.js index e94fce6c..eadfde9f 100644 --- a/static/js/pandora/siteDialog.js +++ b/static/js/pandora/siteDialog.js @@ -151,7 +151,7 @@ pandora.ui.siteDialog = function(section) { if (selected == 'contact') { pandora.$ui.contactForm.resize(); } else if (selected == 'news') { - + pandora.$ui.news.resize(data); } } });