Commit 2dcfd4b3 authored by yPhil's avatar yPhil
Browse files

Div feedBody height saved OK

parent 759b52cc
......@@ -1190,7 +1190,7 @@ li.feed div.feed-body {
border-left: 1px solid var(--color-bg1);
border-right: 1px solid var(--color-bg1);
margin: 0;
height: 150px;
/* height: 150px; */
overflow-y: auto;
/* resize: vertical; */
}
......@@ -1199,6 +1199,10 @@ li.feed div.feed-body {
height: 0 !important;
}
.folded-error {
height: 24px !important;
}
li.feed:hover div.feed-body {
border-color: var(--color-bg5);
}
......
......@@ -299,7 +299,7 @@ PTL.dialog = {
$dialog.find('div#feedLimit').slider({
value: oldLimit,
min: 1,
max: 128,
max: 600,
step: 1,
create: function() {
$('input#feedLimit').val(oldLimit);
......@@ -317,7 +317,7 @@ PTL.dialog = {
});
$dialog.on('submit', function () {
PTL.feed.populate($feedRefresh);
PTL.feed.populate($feedRefresh, $dataStore.data('limit'));
PTL.tab.saveTabs();
$(this).dialog('destroy');
return false;
......
......@@ -97,7 +97,7 @@ PTL.feed = {
.attr('title', PTL.tr('Move this feed (%1)', url))
.attr('class', 'feed-handle');
var $feedBody = $('<div>').attr('class', 'feed-body'),
var $feedBody = $('<div>').attr('class', 'feed-body').css('height', limit),
$feedBodyUl = $('<ul>').attr('class', 'feed-body'),
$header = $('<div>').attr('class', 'feed-header'),
$feedToggle = $('<div>').attr('class', 'feed-toggle').append($feedIcon),
......@@ -165,7 +165,7 @@ PTL.feed = {
}
},
populate:function($button, progress) {
populate:function($button, progress, newLimit) {
var $dataStore = $button.parent().parent(),
$refreshButton = $dataStore.find('i.feed-refresh'),
......@@ -174,14 +174,19 @@ PTL.feed = {
$feed = $dataStore.parent().parent(),
$feedTitle = $feed.children().children('.feed-title'),
$feedLink = $feedTitle.children('a'),
$feedBody = $feed.children().children('ul.feed-body'),
$feedBody = $dataStore.parent().next('div.feed-body'),
$feedBodyUl = $feed.children().children('ul.feed-body'),
feedUrl = $dataStore.data('url'),
feedType = $dataStore.data('type'),
feedLimit = $dataStore.data('limit'),
feedLimit = newLimit || $dataStore.data('limit'),
feedStatus = $dataStore.data('status'),
$feedToggle = $feed.find('.feed-toggle'),
$feedIcon = $feed.find('.feed-toggle > i');
console.log('feedLimit: %s (%s)', feedLimit);
$feedBody.css('height', feedLimit);
var l = PTL.util.getLocation(feedUrl),
feedProtocol = l.protocol ? l.protocol + '//' : '//',
feedHost = feedProtocol + l.hostname,
......@@ -208,7 +213,7 @@ PTL.feed = {
dataType: 'json'
}, function() {
$feedBody.empty();
$feedBodyUl.empty();
}).fail(function(error) {
PTL.util.say(PTL.tr('Problem reading feed [%1] Error type [%2]', feedUrl, error), 'error');
......@@ -234,7 +239,7 @@ PTL.feed = {
$w3cLink
.attr('href', 'https://validator.w3.org/feed/check.cgi?url=' + feedUrl)
.appendTo($feedBody);
.appendTo($feedBodyUl);
$feedLink
.text(PTL.tr('Error'))
......@@ -268,7 +273,7 @@ PTL.feed = {
.append('&nbsp;')
.append($value);
$feedBody
$feedBodyUl
.append($errorItem);
$feedIcon.addClass('icon-rss');
......@@ -298,7 +303,7 @@ PTL.feed = {
$.each(data.feedItems, function(index, item) {
if (index == parseInt(feedLimit)) return false;
// if (index == parseInt(feedLimit)) return false;
// console.log('i: (%s)', JSON.stringify(item));
......@@ -463,7 +468,7 @@ PTL.feed = {
$itemLink.appendTo($itemDiv);
$itemDiv.appendTo($feedItem);
$feedItem.appendTo($feedBody);
$feedItem.appendTo($feedBodyUl);
$tempDom.empty();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment