diff options
author | Andrew Manning <andrew@reticu.li> | 2016-11-26 20:29:53 -0700 |
---|---|---|
committer | Andrew Manning <andrew@reticu.li> | 2016-11-26 20:29:53 -0700 |
commit | d96ab7c86798c692890ead5c54475fdabb5f83c9 (patch) | |
tree | 27d1d086a6a332e3f573f2413d466588570c962a /view/js | |
parent | 68fd1c28b0bf21864753106e4345f0908b4f2e49 (diff) | |
download | volse-hubzilla-d96ab7c86798c692890ead5c54475fdabb5f83c9.tar.gz volse-hubzilla-d96ab7c86798c692890ead5c54475fdabb5f83c9.tar.bz2 volse-hubzilla-d96ab7c86798c692890ead5c54475fdabb5f83c9.zip |
Update wiki context help. Modify context page element focus feature to do nothing if the target DOM element is not found.
Diffstat (limited to 'view/js')
-rw-r--r-- | view/js/main.js | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/view/js/main.js b/view/js/main.js index 96adf0be3..e78725931 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -444,16 +444,18 @@ function contextualHelp() { } 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); - } + if($(target).length) { + 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) { |