aboutsummaryrefslogtreecommitdiffstats
path: root/view
diff options
context:
space:
mode:
authorgit-marijus <mario@mariovavti.com>2016-11-28 13:44:41 +0100
committerGitHub <noreply@github.com>2016-11-28 13:44:41 +0100
commit683a09781ad9c9be00ce67e35f560e6fca051f3b (patch)
treebb4477d49f872b91913d77f8967ffea61f6bcead /view
parentd8774cda8ed0bec9dbbe8638fd7af5307d569805 (diff)
parent5bcb373c00a500cd8120df41bc0788172fe7e347 (diff)
downloadvolse-hubzilla-683a09781ad9c9be00ce67e35f560e6fca051f3b.tar.gz
volse-hubzilla-683a09781ad9c9be00ce67e35f560e6fca051f3b.tar.bz2
volse-hubzilla-683a09781ad9c9be00ce67e35f560e6fca051f3b.zip
Merge pull request #602 from anaqreon/doco
Update context help content and context page element focus feature.
Diffstat (limited to 'view')
-rw-r--r--view/js/main.js22
-rw-r--r--view/tpl/help.tpl2
2 files changed, 13 insertions, 11 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) {
diff --git a/view/tpl/help.tpl b/view/tpl/help.tpl
index 22180bda6..484fd67c9 100644
--- a/view/tpl/help.tpl
+++ b/view/tpl/help.tpl
@@ -2,7 +2,7 @@
<div class="section-title-wrapper">
<h2>{{$title}}</h2>
</div>
- <div class="section-content-wrapper">
+ <div class="section-content-wrapper" id="doco-content">
{{$content}}
</div>
</div>