resize news, fixes #555

This commit is contained in:
j 2012-02-20 05:55:53 +00:00
parent 3af0520c9c
commit a9cf0306d4
2 changed files with 10 additions and 6 deletions

View file

@ -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,8 +183,11 @@ 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;

View file

@ -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);
}
}
});