new notification changes - use sticky_kit instead of position fixed

This commit is contained in:
Mario Vavti 2017-10-09 17:49:15 +02:00
parent 54a0690323
commit f99c007187
7 changed files with 37 additions and 24 deletions

View File

@ -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'],

View File

@ -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;
}
}

View File

@ -15,7 +15,7 @@
<div id="page-footer"></div>
<div id="pause"></div>
</section>
<aside id="region_3" class="d-none d-xl-table-cell"><?php if(x($page,'right_aside')) echo $page['right_aside']; ?></aside>
<aside id="region_3" class="d-none d-xl-table-cell"><div id="right_aside_spacer"><div id="right_aside_wrapper"><?php if(x($page,'right_aside')) echo $page['right_aside']; ?></div></div></aside>
</main>
<footer><?php if(x($page,'footer')) echo $page['footer']; ?></footer>
</body>

View File

@ -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;

View File

@ -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);

View File

@ -22,7 +22,7 @@
<a class="dropdown-item{{if $usermenu.2}} active{{/if}}" href="{{$usermenu.0}}" title="{{$usermenu.3}}" role="menuitem" id="{{$usermenu.4}}">{{$usermenu.1}}</a>
{{/foreach}}
{{if $nav.manage}}
<a class="dropdown-item{{if $sel.active == Manage}} active{{/if}}" href="{{$nav.manage.0}}" title="{{$nav.manage.3}}" role="menuitem" id="{{$nav.manage.4}}">{{$nav.manage.1}}</a>
<a class="dropdown-item{{if $sel.name == Manage}} active{{/if}}" href="{{$nav.manage.0}}" title="{{$nav.manage.3}}" role="menuitem" id="{{$nav.manage.4}}">{{$nav.manage.1}}</a>
{{/if}}
{{if $nav.channels}}
{{foreach $nav.channels as $chan}}
@ -34,11 +34,11 @@
{{/if}}
{{if $nav.settings}}
<div class="dropdown-divider"></div>
<a class="dropdown-item{{if $sel.active == Settings}} active{{/if}}" href="{{$nav.settings.0}}" title="{{$nav.settings.3}}" role="menuitem" id="{{$nav.settings.4}}">{{$nav.settings.1}}</a>
<a class="dropdown-item{{if $sel.name == Settings}} active{{/if}}" href="{{$nav.settings.0}}" title="{{$nav.settings.3}}" role="menuitem" id="{{$nav.settings.4}}">{{$nav.settings.1}}</a>
{{/if}}
{{if $nav.admin}}
<div class="dropdown-divider"></div>
<a class="dropdown-item{{if $sel.active == Admin}} active{{/if}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" role="menuitem" id="{{$nav.admin.4}}">{{$nav.admin.1}}</a>
<a class="dropdown-item{{if $sel.name == Admin}} active{{/if}}" href="{{$nav.admin.0}}" title="{{$nav.admin.3}}" role="menuitem" id="{{$nav.admin.4}}">{{$nav.admin.1}}</a>
{{/if}}
{{if $nav.logout}}
<div class="dropdown-divider"></div>
@ -54,7 +54,7 @@
{{/if}}
</div>
<div class="navbar-nav mr-auto">
<div class="text-white">{{$sel.active}}</div>
<div><a id="nav-app-link" href="{{$url}}" class="nav-link">{{$sel.name}}</a></div>
</div>
{{/if}}
<div class="navbar-toggler-right">

View File

@ -1,13 +1,6 @@
<style>
#notifications {
position: fixed;
top: 4.5rem;
width: 266px;
padding: 0 .5rem;
}
.notification-content {
max-height: 50vh;
max-height: 70vh;
overflow: auto;
}
@ -16,11 +9,12 @@
}
.fs {
top: 0px !important;
position: fixed;
top: 0px;
left: 0px;
padding-top: 4.5rem !important;
padding: 4.5rem .5rem 0 .5rem;
background-color: white;
width: 100% !important;
width: 100%;
max-width: 100%;
height: 100vh;
z-index: 1030;