resize news, fixes #555
This commit is contained in:
parent
3af0520c9c
commit
a9cf0306d4
2 changed files with 10 additions and 6 deletions
|
@ -13,7 +13,8 @@ pandora.ui.news = function(width, height) {
|
||||||
? 'rgb(32, 32, 32)' : 'rgb(224, 224, 224)',
|
? 'rgb(32, 32, 32)' : 'rgb(224, 224, 224)',
|
||||||
isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level],
|
isEditable = pandora.site.capabilities.canEditSitePages[pandora.user.level],
|
||||||
items = [],
|
items = [],
|
||||||
selected;
|
selected,
|
||||||
|
$text;
|
||||||
|
|
||||||
pandora.api.getNews({}, function(result) {
|
pandora.api.getNews({}, function(result) {
|
||||||
items = result.data.items;
|
items = result.data.items;
|
||||||
|
@ -60,7 +61,7 @@ pandora.ui.news = function(width, height) {
|
||||||
|
|
||||||
function renderItem() {
|
function renderItem() {
|
||||||
$left.empty();
|
$left.empty();
|
||||||
var $title, $date, $text,
|
var $title, $date,
|
||||||
index = Ox.getIndexById(items, selected);
|
index = Ox.getIndexById(items, selected);
|
||||||
$title = Ox.Editable({
|
$title = Ox.Editable({
|
||||||
editable: isEditable,
|
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;
|
return that;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -151,7 +151,7 @@ pandora.ui.siteDialog = function(section) {
|
||||||
if (selected == 'contact') {
|
if (selected == 'contact') {
|
||||||
pandora.$ui.contactForm.resize();
|
pandora.$ui.contactForm.resize();
|
||||||
} else if (selected == 'news') {
|
} else if (selected == 'news') {
|
||||||
|
pandora.$ui.news.resize(data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue