diff options
author | Andrew Manning <andrew@reticu.li> | 2016-03-21 06:33:02 -0400 |
---|---|---|
committer | Andrew Manning <andrew@reticu.li> | 2016-03-21 06:33:02 -0400 |
commit | 56c86b656788aa48f88fca54c2a9dc1c86558db4 (patch) | |
tree | dc7a257d4c300ae00805673cc2de40b441f61aef /view/tpl | |
parent | 51cd4e8519ef97f348013320e612811f9da1ad0e (diff) | |
download | volse-hubzilla-56c86b656788aa48f88fca54c2a9dc1c86558db4.tar.gz volse-hubzilla-56c86b656788aa48f88fca54c2a9dc1c86558db4.tar.bz2 volse-hubzilla-56c86b656788aa48f88fca54c2a9dc1c86558db4.zip |
Override navbar help button to open contextual help panel. Contextual help for mail written.
Diffstat (limited to 'view/tpl')
-rwxr-xr-x | view/tpl/nav.tpl | 49 |
1 files changed, 47 insertions, 2 deletions
diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index 3d6809c22..dc5dd27f3 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -1,4 +1,44 @@ - <div class="container-fluid"> +<script> + $(document).mouseup(function (e) + { + var container = $("#help-content"); + + if (!container.is(e.target) // if the target of the click isn't the container... + && container.has(e.target).length === 0 // ... nor a descendant of the container + && container.hasClass('help-content-open')) + { + container.removeClass('help-content-open'); + } + }); +</script> +<style> +.help-content { + background: rgba(255, 255, 255, 0.9); + color: #333333; + position: fixed; + top: 50px; + left: -80%; + width: 80%; + padding: 20px; + transition: left 300ms cubic-bezier(0.17, 0.04, 0.03, 0.94); + overflow: hidden; + box-sizing: border-box; + border: #CCC thin solid; +} + +.help-content-open { + left: 0px; + -moz-box-shadow: 3px 3px 3px #ccc; + -webkit-box-shadow: 3px 3px 3px #ccc; + box-shadow: 3px 3px 3px #ccc; +} + +.help-content dd { + margin-bottom: 1em; +} +</style> + +<div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1"> <span class="icon-bar"></span> @@ -189,8 +229,13 @@ {{if $nav.help}} <li class="{{$sel.help}}"> - <a class="{{$nav.help.2}}" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}" id="{{$nav.help.4}}"><i class="icon-question"></i></a> + <a class="{{$nav.help.2}}" target="hubzilla-help" href="{{$nav.help.0}}" title="{{$nav.help.3}}" id="{{$nav.help.4}}" onclick="$('#help-content').toggleClass('help-content-open'); return false;"><i class="icon-question"></i></a> </li> + + <div id="help-content" class="help-content"> + {{$nav.help.5}} + <p class="pull-right"><a href="{{$nav.help.0}}">Click here for more documentation...</a></p> + </div> {{/if}} </ul> </div> |