From 8817870db5811b31a69a99f4e132b51ccb355dab Mon Sep 17 00:00:00 2001 From: Keshav Sethi <36025262+keshavsethi@users.noreply.github.com> Date: Wed, 3 Jun 2020 20:52:08 +0530 Subject: [PATCH] Update filter on dashboard (#7843) * update filter * update filter * wiki adjusted * changed viewport --- app/assets/javascripts/dashboard.js | 52 ++++++++++++++++++++++---- app/views/dashboard/_activity.html.erb | 16 ++++---- 2 files changed, 52 insertions(+), 16 deletions(-) diff --git a/app/assets/javascripts/dashboard.js b/app/assets/javascripts/dashboard.js index 72d156c56d..69c6d9eed3 100644 --- a/app/assets/javascripts/dashboard.js +++ b/app/assets/javascripts/dashboard.js @@ -1,4 +1,46 @@ +$(document).ready(function () { + $('#selectall').click(function () { + $('.node-type').prop('checked', this.checked); + }); + $('.node-type').change(function () { + var check = ($('.node-type').filter(":checked").length == $('.node-type').length); + $('#selectall').prop("checked", check); + }); +}); +var viewport = function() { + var e = window, a = 'inner'; + if (!('innerWidth' in window )) { + a = 'client'; + e = document.documentElement || document.body; + } + return { width : e[ a+'Width' ] , height : e[ a+'Height' ] }; +} +function listselect(){ + var types = [ + 'note', + 'question', + 'event', + 'comment', + 'wiki' + ]; + + + var selected = []; + $('#checkboxes input:checked').each(function() { + selected.push($(this).attr('data-type')); + }); + let intersection = types.filter(x => selected.includes(x)); + let difference = types.filter(x => !selected.includes(x)); + for(var i=0;i 992)){ + $('.note-container-' + intersection[i]).show(); + } + } + for(var j=0;j -