From f99c007187b83755d7b1c80c63fde7c1162a99c4 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Mon, 9 Oct 2017 17:49:15 +0200 Subject: [PATCH] new notification changes - use sticky_kit instead of position fixed --- Zotlabs/Module/Wiki.php | 7 +++++-- include/nav.php | 19 +++++++++++++------ view/php/default.php | 2 +- view/theme/redbasic/css/style.css | 4 ++++ view/theme/redbasic/js/redbasic.js | 5 +++++ view/tpl/nav.tpl | 8 ++++---- view/tpl/notifications_widget.tpl | 16 +++++----------- 7 files changed, 37 insertions(+), 24 deletions(-) diff --git a/Zotlabs/Module/Wiki.php b/Zotlabs/Module/Wiki.php index fe2bfbdfb..13144b61e 100644 --- a/Zotlabs/Module/Wiki.php +++ b/Zotlabs/Module/Wiki.php @@ -69,6 +69,11 @@ class Wiki extends \Zotlabs\Web\Controller { goaway('/' . argv(0)); } + nav_set_selected([ + 'name' => t('Wiki'), + 'url' =>'/wiki/' . $nick + ]); + $observer_hash = get_observer_hash(); // Determine if the observer is the channel owner so the ACL dialog can be populated @@ -76,8 +81,6 @@ class Wiki extends \Zotlabs\Web\Controller { $wiki_owner = true; - nav_set_selected(t('Wiki')); - // Obtain the default permission settings of the channel $owner_acl = array( 'allow_cid' => $owner['channel_allow_cid'], diff --git a/include/nav.php b/include/nav.php index 6b56c9aee..28ca54d07 100644 --- a/include/nav.php +++ b/include/nav.php @@ -103,12 +103,12 @@ EOT; $nav['logout'] = ['logout',t('Logout'), "", t('End this session'),'logout_nav_btn']; // user menu - $nav['usermenu'][] = ['profile/' . $channel['channel_address'], t('View Profile'), ((\App::$nav_sel['active'] == 'Profile') ? 'active' : ''), t('Your profile page'),'profile_nav_btn']; + $nav['usermenu'][] = ['profile/' . $channel['channel_address'], t('View Profile'), ((\App::$nav_sel['name'] == 'Profile') ? 'active' : ''), t('Your profile page'),'profile_nav_btn']; if(feature_enabled(local_channel(),'multi_profiles')) - $nav['usermenu'][] = ['profiles', t('Edit Profiles'), ((\App::$nav_sel['active'] == 'Profiles') ? 'active' : '') , t('Manage/Edit profiles'),'profiles_nav_btn']; + $nav['usermenu'][] = ['profiles', t('Edit Profiles'), ((\App::$nav_sel['name'] == 'Profiles') ? 'active' : '') , t('Manage/Edit profiles'),'profiles_nav_btn']; else - $nav['usermenu'][] = ['profiles/' . $prof[0]['id'], t('Edit Profile'), ((\App::$nav_sel['active'] == 'Profiles') ? 'active' : ''), t('Edit your profile'),'profiles_nav_btn']; + $nav['usermenu'][] = ['profiles/' . $prof[0]['id'], t('Edit Profile'), ((\App::$nav_sel['name'] == 'Profiles') ? 'active' : ''), t('Edit your profile'),'profiles_nav_btn']; } else { @@ -258,7 +258,7 @@ EOT; $syslist = Zlib\Apps::app_order(local_channel(),$syslist); foreach($syslist as $app) { - if(\App::$nav_sel['active'] == $app['name']) + if(\App::$nav_sel['name'] == $app['name']) $app['active'] = true; if($is_owner) @@ -291,7 +291,8 @@ EOT; '$addapps' => t('Add Apps'), '$orderapps' => t('Arrange Apps'), '$sysapps_toggle' => t('Toggle System Apps'), - '$loc' => $myident + '$loc' => $myident, + '$url' => ((App::$nav_sel['url']) ? App::$nav_sel['url'] : App::$cmd) )); if(x($_SESSION, 'reload_avatar') && $observer) { @@ -314,7 +315,13 @@ EOT; * */ function nav_set_selected($item){ - App::$nav_sel['active'] = $item; + if(is_array($item)) { + App::$nav_sel['name'] = $item['name']; + App::$nav_sel['url'] = $item['url']; + } + else { + App::$nav_sel['name'] = $item; + } } diff --git a/view/php/default.php b/view/php/default.php index 444e24197..b180a6eb8 100644 --- a/view/php/default.php +++ b/view/php/default.php @@ -15,7 +15,7 @@
- + diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index de6f8dac1..a912fb825 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -161,6 +161,10 @@ nav { filter:alpha(opacity=$nav_percent_min_opacity); } +#nav-app-link { + white-space: nowrap; +} + #powered-by { font-size: 0.5rem; position: absolute; diff --git a/view/theme/redbasic/js/redbasic.js b/view/theme/redbasic/js/redbasic.js index 257e7cfb6..3fa9d2a76 100644 --- a/view/theme/redbasic/js/redbasic.js +++ b/view/theme/redbasic/js/redbasic.js @@ -22,6 +22,11 @@ $(document).ready(function() { parent: 'main', spacer: '#left_aside_spacer' }); + $('#right_aside_wrapper').stick_in_parent({ + offset_top: parseInt($('#region_3').css('padding-top')), + parent: 'main', + spacer: '#right_aside_spacer' + }); } $('#expand-aside').on('click', toggleAside); diff --git a/view/tpl/nav.tpl b/view/tpl/nav.tpl index bbc5b4fb0..15896c159 100755 --- a/view/tpl/nav.tpl +++ b/view/tpl/nav.tpl @@ -22,7 +22,7 @@ {{$usermenu.1}} {{/foreach}} {{if $nav.manage}} - {{$nav.manage.1}} + {{$nav.manage.1}} {{/if}} {{if $nav.channels}} {{foreach $nav.channels as $chan}} @@ -34,11 +34,11 @@ {{/if}} {{if $nav.settings}} - {{$nav.settings.1}} + {{$nav.settings.1}} {{/if}} {{if $nav.admin}} - {{$nav.admin.1}} + {{$nav.admin.1}} {{/if}} {{if $nav.logout}} @@ -54,7 +54,7 @@ {{/if}} {{/if}}