diff options
| author | 2014-06-14 08:58:33 +0200 | |
|---|---|---|
| committer | 2014-06-14 09:04:31 +0200 | |
| commit | a7e833280954a537e12d5a3f4fa12a5b9e8412da (patch) | |
| tree | a6705f67a706f3ee9e427e0dcd1d108b0ee64ef0 /p/scripts | |
| parent | 2b8dc666345d334f50bf2f4f32f0b127edb40c3a (diff) | |
Improve system of queries
- Coding style
- More checks server side
- Default query name is "Query n°X"
- List of queries is moved into nav_menu, in a dropdown
- Better system to remove fields in JS (to a.remove elements, give an
attibute data-remove="id_to_remove")
- Fix a bug in lib/Mine/Request.php (htmlspecialchars_utf8 can be applied on
arrays now)
- Few theme improvements
- Add an element .no-mobile to apply to elements which should not appear on
mobiles
See https://github.com/marienfressinaud/FreshRSS/pull/498
Diffstat (limited to 'p/scripts')
| -rw-r--r-- | p/scripts/main.js | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js index 079ae0da4..5a3b25c3f 100644 --- a/p/scripts/main.js +++ b/p/scripts/main.js @@ -975,11 +975,6 @@ function init_print_action() { function init_share_observers() { shares = $('.form-group:not(".form-actions")').length; - $('.post').on('click', '.share.remove', function(e) { - e.preventDefault(); - $(this).parents('.form-group').remove(); - }); - $('.share.add').on('click', function(e) { var opt = $(this).siblings('select').find(':selected'); var row = $(this).parents('form').data(opt.data('form')); @@ -994,10 +989,16 @@ function init_share_observers() { }); } -function init_queries_observers() { - $('.post').on('click', '.query.remove', function(e) { - e.preventDefault(); - $(this).parents('.form-group').remove(); +function init_remove_observers() { + $('.post').on('click', 'a.remove', function(e) { + var remove_what = $(this).attr('data-remove'); + + if (remove_what !== undefined) { + var remove_obj = $('#' + remove_what); + remove_obj.remove(); + } + + return false; }); } @@ -1061,7 +1062,7 @@ function init_all() { window.setInterval(refreshUnreads, 120000); } else { init_share_observers(); - init_queries_observers(); + init_remove_observers(); init_feed_observers(); init_password_observers(); } |
