diff options
| author | 2014-03-16 19:45:39 +0100 | |
|---|---|---|
| committer | 2014-03-16 19:45:39 +0100 | |
| commit | e685b541487b814cbab87ea2b6a6a4d12cd72f06 (patch) | |
| tree | 184cf3d29662b0fa1cc6ea8e0250c972abc25715 /p/scripts/main.js | |
| parent | dbdda1d0c19b48d06b30879e8fe78679f79cc0c4 (diff) | |
| parent | 996c387f50f9b65f271b3cd13b9d63165236b6d2 (diff) | |
Merge branch 'dev' into 163-export
Diffstat (limited to 'p/scripts/main.js')
| -rw-r--r-- | p/scripts/main.js | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js index 6cc992379..a03be85eb 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -278,11 +278,8 @@ function next_entry() { new_active = old_active.length === 0 ? $(".flux:first") : old_active.nextAll(".flux:first"); toggleContent(new_active, old_active); - if (!auto_load_more) { - var last_active = $(".flux:last"); - if (last_active.attr("id") === new_active.attr("id")) { - load_more_posts(); - } + if (new_active.nextAll().length < 3) { + load_more_posts(); } } @@ -609,7 +606,7 @@ function init_shortcuts() { } function init_stream(divStream) { - divStream.on('click', '.flux_header', function (e) { //flux_header_toggle + divStream.on('click', '.flux_header,.flux_content', function (e) { //flux_toggle if ($(e.target).closest('.item.website, .item.link').length > 0) { return; } @@ -971,12 +968,12 @@ function init_print_action() { function init_share_observers() { shares = $('.form-group:not(".form-actions")').length; - $('.post').on('click', '.share.remove', function(e){ + $('.post').on('click', '.share.remove', function(e) { e.preventDefault(); $(this).parents('.form-group').remove(); }); - $('.share.add').on('click',function(e){ + $('.share.add').on('click', function(e) { e.preventDefault(); var opt = $(this).siblings('select').find(':selected'); var row = $(this).parents('form').data(opt.data('form')); @@ -987,7 +984,30 @@ function init_share_observers() { $(this).parents('.form-actions').before(row); shares++; }); -}; +} + +function init_feed_observers() { + $('select[id="category"]').on('change', function() { + var detail = $(this).parent('li').next('li'); + if ($(this).val() === 'nc') { + detail.show(); + detail.find('input').focus(); + } else { + detail.hide(); + } + }); +} + +function init_password_observers() { + $('input[type="password"] + a.btn.toggle-password').on('click', function(e) { + e.preventDefault(); + var passwordField = $(this).siblings('input[type="password"]'); + passwordField.attr('type', 'text'); + setTimeout(function() { + passwordField.attr('type', 'password'); + }, 2000); + }); +} function init_all() { if (!(window.$ && window.url_freshrss && ((!full_lazyload) || $.fn.lazyload))) { @@ -1020,6 +1040,8 @@ function init_all() { window.setInterval(refreshUnreads, 120000); } else { init_share_observers(); + init_feed_observers(); + init_password_observers(); } if (window.console) { |
