From d4cd72dd21a8bb9c959ac23311b24bc334ee0f8e Mon Sep 17 00:00:00 2001 From: romibi Date: Wed, 21 Jun 2017 13:35:35 +0200 Subject: Make feedlist padding a bit dynamic --- p/scripts/main.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 5be7bc36b..0fc6ca30b 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -541,9 +541,18 @@ function init_column_categories() { feed_web = $(this).data('fweb'), template = $('#feed_config_template').html().replace(/------/g, feed_id).replace('http://example.net/', feed_web); $(this).attr('href', '#dropdown-' + feed_id).prev('.dropdown-target').attr('id', 'dropdown-' + feed_id).parent().append(template); + $('.tree-folder-items .dropdown-close a').click(function(){ + $('.tree').removeClass('treepadding'); + $(document.body).trigger("sticky_kit:recalc"); + }); } }); + $('.tree-folder-items .dropdown-toggle').click(function(){ + $('.tree').addClass('treepadding'); + $(document.body).trigger("sticky_kit:recalc"); + }); + init_sticky_column(); } -- cgit v1.2.3 From 3108b2729f79ccaf5f8ba951a52ee35d28e2adb2 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 20 Aug 2017 10:18:54 +0200 Subject: Minor JS hints --- p/scripts/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 0fc6ca30b..8081b7f38 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -1,6 +1,6 @@ "use strict"; -/* globals context, i18n, shortcut, shortcuts, url */ -/* jshint globalstrict: true */ +/* globals $, jQuery, context, i18n, shortcut, shortcuts, url */ +/* jshint strict:global */ var $stream = null, isCollapsed = true, -- cgit v1.2.3 From eb84d4f8ff8a53f7eac52edf61951e5dba5906fc Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sun, 20 Aug 2017 10:21:08 +0200 Subject: Recalc sticky column on lazy img load https://github.com/FreshRSS/FreshRSS/issues/1593 --- p/scripts/main.js | 1 + 1 file changed, 1 insertion(+) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index 8081b7f38..117e8a598 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -227,6 +227,7 @@ function toggleContent(new_active, old_active) { if (context.does_lazyload) { new_active.find('img[data-original], iframe[data-original]').each(function () { + this.onload = function () { $(document.body).trigger("sticky_kit:recalc"); }; this.setAttribute('src', this.getAttribute('data-original')); this.removeAttribute('data-original'); }); -- cgit v1.2.3 From ca7d1fdddeb5faf48014e93fac50619fa22a893d Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 23 Sep 2017 13:41:26 +0200 Subject: Minor JS whitespace --- p/scripts/category.js | 2 +- p/scripts/global_view.js | 2 +- p/scripts/main.js | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/category.js b/p/scripts/category.js index fbcd83a01..caa4fa22f 100644 --- a/p/scripts/category.js +++ b/p/scripts/category.js @@ -92,7 +92,7 @@ function init_draggable() { $.ajax({ type: 'POST', url: './?c=feed&a=move', - data : { + data: { f_id: dragFeedId, c_id: e.target.parentNode.getAttribute('data-cat-id'), _csrf: context.csrf, diff --git a/p/scripts/global_view.js b/p/scripts/global_view.js index e3de0fd52..c5aaa48b1 100644 --- a/p/scripts/global_view.js +++ b/p/scripts/global_view.js @@ -33,7 +33,7 @@ function load_panel(link) { $.ajax({ type: "POST", url: $(this).attr("formaction"), - data : { + data: { _csrf: context.csrf, }, async: false diff --git a/p/scripts/main.js b/p/scripts/main.js index 117e8a598..aa2f1d58b 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -133,7 +133,7 @@ function mark_read(active, only_not_read) { $.ajax({ type: 'POST', url: url, - data : { + data: { ajax: true, _csrf: context.csrf, }, @@ -182,7 +182,7 @@ function mark_favorite(active) { $.ajax({ type: 'POST', url: url, - data : { + data: { ajax: true, _csrf: context.csrf, }, @@ -823,7 +823,7 @@ function updateFeed(feeds, feeds_count) { $.ajax({ type: 'POST', url: feed.url, - data : { + data: { _csrf: context.csrf, noCommit: feeds.length > 0 ? 1 : 0, }, @@ -860,7 +860,7 @@ function init_actualize() { $.ajax({ //Empty request to force refresh server database cache type: 'POST', url: './?c=feed&a=actualize&id=-1', - data : { + data: { _csrf: context.csrf, noCommit: 0, }, @@ -1299,7 +1299,7 @@ function init_slider_observers() { $.ajax({ type: 'GET', url: url_slide, - data : { ajax: true } + data: { ajax: true } }).done(function (data) { slider.html(data); closer.addClass('active'); -- cgit v1.2.3 From ee834888cd96df12d14686f3e75c82053e188a64 Mon Sep 17 00:00:00 2001 From: Alexis Degrugillier Date: Sat, 30 Sep 2017 08:25:07 +0200 Subject: Remove limitation on toggleContent (#1647) Before, articles were repositioned only when the new and the old article were different. When they were the same, it was just closed. It was frustrating with long articles, especially during reading. Now, when an article is collapsed, it is repositionned no matter the collapsing method. This should fix #1177 --- p/scripts/main.js | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'p/scripts/main.js') diff --git a/p/scripts/main.js b/p/scripts/main.js index aa2f1d58b..278ecfee9 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -266,11 +266,9 @@ function toggleContent(new_active, old_active) { new_pos += old_scroll; } - if (old_active[0] !== new_active[0]) { - new_active.children(".flux_content").first().each(function () { - box_to_move.scrollTop(new_pos).scrollTop(); - }); - } + new_active.children(".flux_content").first().each(function () { + box_to_move.scrollTop(new_pos).scrollTop(); + }); } else { if (relative_move) { new_pos += old_scroll; @@ -386,13 +384,8 @@ function last_category() { } function collapse_entry() { - isCollapsed = !isCollapsed; - var flux_current = $(".flux.current"); - flux_current.toggleClass("active"); - if (isCollapsed && context.auto_mark_article) { - mark_read(flux_current, true); - } + toggleContent(flux_current, flux_current); } function user_filter(key) { -- cgit v1.2.3