From d6a9a9927c23e8b4307dc2164407481f8c542682 Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 15 Jul 2022 17:50:02 +0000 Subject: HQ dashboard - initial checkin --- view/js/main.js | 6 +++--- view/js/mod_cloud.js | 5 +++++ view/js/mod_hq.js | 33 +++++++++++++++++++++++++++++---- 3 files changed, 37 insertions(+), 7 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index f7709f9d1..3fe916d1d 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -164,8 +164,8 @@ $(document).ready(function() { jQuery.timeago.settings.allowFuture = true; $(document).on('click', '.notification, .message', function(e) { - let b64mid = $(this).data('b64mid'); - let notify_id = $(this).data('notify_id'); + let b64mid = this.dataset.b64mid; + let notify_id = this.dataset.notify_id; let path = $(this)[0].pathname.split('/')[1]; let stateObj = { b64mid: b64mid }; let singlethread_modules = ['display', 'hq']; @@ -882,7 +882,7 @@ function updateInit() { if($('#live-channel').length) { src = 'channel'; } if($('#live-pubstream').length) { src = 'pubstream'; } if($('#live-display').length) { src = 'display'; } - if($('#live-hq').length) { src = 'hq'; } + //if($('#live-hq').length) { src = 'hq'; } if($('#live-search').length) { src = 'search'; } // if($('#live-cards').length) { src = 'cards'; } // if($('#live-articles').length) { src = 'articles'; } diff --git a/view/js/mod_cloud.js b/view/js/mod_cloud.js index 1f444e4fe..7f9cb4fd1 100644 --- a/view/js/mod_cloud.js +++ b/view/js/mod_cloud.js @@ -14,6 +14,11 @@ $(document).ready(function () { // Per File Tools + // highlight and scroll into view if we got an id via hash + if(window.location.hash) { + $('#cloud-index-' + window.location.hash.substr(1)).addClass('cloud-index-active').get(0).scrollIntoView({block: 'center'}); + } + $('.cloud-tool-info-btn').on('click', function (e) { e.preventDefault(); let id = $(this).data('id'); diff --git a/view/js/mod_hq.js b/view/js/mod_hq.js index 5f8430b4d..dc274c5bf 100644 --- a/view/js/mod_hq.js +++ b/view/js/mod_hq.js @@ -1,17 +1,42 @@ $(document).ready(function() { - $(document).on('click', '.jot-toggle', function(e) { + $('.autotime').timeago(); + + if (bParam_mid) { + src = 'hq'; + $('.channel-activities-toggle').removeClass('d-none'); + } + else { + $('#channel-activities').removeClass('d-none'); + } + + $(document).one('click', '.notification, .message', function(e) { + page_load = false; + followUpPageLoad = true; + src = 'hq'; + $('#channel-activities').addClass('d-none'); + $('.channel-activities-toggle').removeClass('d-none'); + }); + + $(document).on('click', '.channel-activities-toggle', function(e) { $(window).scrollTop(0); + $(document).trigger('hz:hqControlsClickAction'); + $('#channel-activities').toggleClass('d-none'); + $(this).toggleClass('active'); + }); + + $(document).on('click', '.jot-toggle', function(e) { $(document).trigger('hz:hqControlsClickAction'); $('#jot-popup').toggle(); - $('#profile-jot-text').focus(); + $('#profile-jot-text').focus().get(0).scrollIntoView({block: 'center'}); + $(this).toggleClass('active'); }); $(document).on('click', '.notes-toggle', function(e) { - $(window).scrollTop(0); $(document).trigger('hz:hqControlsClickAction'); $('#personal-notes').toggleClass('d-none'); - $('#note-text').focus(); + $('#note-text-html').get(0).scrollIntoView({block: 'center'}); + $(this).toggleClass('active'); }); }); -- cgit v1.2.3