aboutsummaryrefslogtreecommitdiffstats
path: root/view/js
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2016-04-23 16:39:56 +0200
committerMario Vavti <mario@mariovavti.com>2016-04-23 16:39:56 +0200
commitb0a2e5d3f70cb4c87f32cbee2f9ca6f30ebb22eb (patch)
tree4476e7d85f1382348df2b9c69b1be62212a1514f /view/js
parent0463df62f0d7146b557ba881ac60b0a6916fefa6 (diff)
downloadvolse-hubzilla-b0a2e5d3f70cb4c87f32cbee2f9ca6f30ebb22eb.tar.gz
volse-hubzilla-b0a2e5d3f70cb4c87f32cbee2f9ca6f30ebb22eb.tar.bz2
volse-hubzilla-b0a2e5d3f70cb4c87f32cbee2f9ca6f30ebb22eb.zip
simplify context help js and move it to main.js where all the nav related js resides, do not close the context help if we click outside of it - members might want to work on something while help is open, move the link to /help to dropdown-menu.
Diffstat (limited to 'view/js')
-rw-r--r--view/js/main.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/view/js/main.js b/view/js/main.js
index 2813b3b19..748853939 100644
--- a/view/js/main.js
+++ b/view/js/main.js
@@ -443,6 +443,32 @@ function NavUpdate() {
timer = setTimeout(NavUpdate, updateInterval);
}
+function contextualHelp() {
+ var container = $("#contextual-help-content");
+
+ if(container.hasClass('contextual-help-content-open')) {
+ container.removeClass('contextual-help-content-open');
+ $('main').css('top', '')
+ }
+ else {
+ container.addClass('contextual-help-content-open');
+ var mainTop = container.outerHeight(true);
+ $('main').css('top', mainTop + 'px');
+ }
+}
+
+function contextualHelpFocus(target, openSidePanel) {
+ if (openSidePanel) {
+ $("main").addClass('region_1-on'); // Open the side panel to highlight element
+ }
+ else {
+ $("main").removeClass('region_1-on');
+ }
+ $('html,body').animate({ scrollTop: $(target).offset().top - $('nav').outerHeight(true) - $('#contextual-help-content').outerHeight(true)}, 'slow');
+ for (i = 0; i < 3; i++) {
+ $(target).fadeTo('slow', 0.1).fadeTo('slow', 1.0);
+ }
+}
function updatePageItems(mode, data) {