diff options
Diffstat (limited to 'view/tpl')
-rw-r--r-- | view/tpl/app.tpl | 4 | ||||
-rwxr-xr-x | view/tpl/cover_photo_widget.tpl | 76 | ||||
-rw-r--r-- | view/tpl/notifications_widget.tpl | 11 |
3 files changed, 52 insertions, 39 deletions
diff --git a/view/tpl/app.tpl b/view/tpl/app.tpl index 7d2e46c59..3245a86e0 100644 --- a/view/tpl/app.tpl +++ b/view/tpl/app.tpl @@ -11,11 +11,11 @@ <a href="{{$app.page}}" class="btn btn-outline-secondary" title="{{$purchase}}" ><i class="fa fa-external"></i></a> </div> {{/if}} - {{if $install || $update || $delete || $feature}} + {{if $action_label || $update || $delete || $feature}} <div class="text-center app-tools"> <form action="{{$hosturl}}appman" method="post"> <input type="hidden" name="papp" value="{{$app.papp}}" /> - {{if $install}}<button type="submit" name="install" value="{{$install}}" class="btn btn-outline-secondary btn-sm" title="{{$install}}" ><i class="fa fa-fw fa-arrow-circle-o-down" ></i></button>{{/if}} + {{if $action_label}}<button type="submit" name="install" value="{{$action_label}}" class="btn btn-outline-{{if $installed}}secondary{{else}}success{{/if}} btn-sm" title="{{$action_label}}" ><i class="fa fa-fw {{if $installed}}fa-refresh{{else}}fa-arrow-circle-o-down{{/if}}" ></i> {{$action_label}}</button>{{/if}} {{if $edit}}<input type="hidden" name="appid" value="{{$app.guid}}" /><button type="submit" name="edit" value="{{$edit}}" class="btn btn-outline-secondary btn-sm" title="{{$edit}}" ><i class="fa fa-fw fa-pencil" ></i></button>{{/if}} {{if $delete}}<button type="submit" name="delete" value="{{if $deleted}}{{$undelete}}{{else}}{{$delete}}{{/if}}" class="btn btn-outline-secondary btn-sm" title="{{if $deleted}}{{$undelete}}{{else}}{{$delete}}{{/if}}" ><i class="fa fa-fw fa-trash-o drop-icons"></i></button>{{/if}} {{if $feature}}<button type="submit" name="feature" value="nav_featured_app" class="btn btn-outline-secondary btn-sm" title="{{if $featured}}{{$remove}}{{else}}{{$add}}{{/if}}"><i class="fa fa-fw fa-star{{if $featured}} text-warning{{/if}}"></i></button>{{/if}} diff --git a/view/tpl/cover_photo_widget.tpl b/view/tpl/cover_photo_widget.tpl index 2de3c74be..7739d24b8 100755 --- a/view/tpl/cover_photo_widget.tpl +++ b/view/tpl/cover_photo_widget.tpl @@ -3,66 +3,57 @@ var section_padding_top; var coverSlid = false; var hide_cover = Boolean({{$hide_cover}}); + var cover_height; $(document).ready(function() { if(! $('#cover-photo').length) return; - aside_padding_top = parseInt($('aside').css('padding-top')); - section_padding_top = parseInt($('section').css('padding-top')); - - $(document).on('click mouseup keyup', slideUpCover); + if($(window).width() < 755) { + $('#cover-photo').remove(); + coverSlid = true; + return; + } - if($(window).width() > 755) { - $('#cover-photo').removeClass('d-none'); - datasrc2src('#cover-photo > img'); + $('#cover-photo').removeClass('d-none'); + cover_height = Math.ceil($(window).width()/2.75862069); + $('#cover-photo').css('height', cover_height + 'px'); + datasrc2src('#cover-photo > img'); - if(hide_cover) { - hideCover(); - coverSlid = true; - } + $(document).on('click mouseup keyup', slideUpCover); - if($(window).scrollTop() < $('#cover-photo').height()) { - $('body').css('cursor', 'n-resize'); - $('.navbar').removeClass('fixed-top'); - $('main').css('margin-top', - $('nav').outerHeight(true) + 'px'); - $('main').css('opacity', 0); - } + if(hide_cover) { + hideCover(); } - else { - $('#cover-photo').remove(); - coverSlid = true; + else if(!hide_cover && !coverSlid) { + coverVisibleActions(); } }); $(window).scroll(function () { - if($(window).width() > 755 && $(window).scrollTop() >= $('#cover-photo').height()) { - $('body').css('cursor', ''); - $('.navbar').addClass('fixed-top'); - $('main').css('margin-top', ''); - $('main').css('opacity', 1); + if($(window).scrollTop() >= cover_height) { + coverHiddenActions(); coverSlid = true; } - else if ($(window).width() > 755 && $(window).scrollTop() < $('#cover-photo').height()){ + else if ($(window).scrollTop() < cover_height){ if(coverSlid) { - $(window).scrollTop(Math.ceil($('#cover-photo').height())); + $(window).scrollTop(cover_height); setTimeout(function(){ coverSlid = false; }, 1000); } else { - if($(window).scrollTop() < $('#cover-photo').height()) { - $('body').css('cursor', 'n-resize'); - $('.navbar').removeClass('fixed-top'); - $('main').css('margin-top', - $('nav').outerHeight(true) + 'px'); - $('main').css('opacity', 0); + if($(window).scrollTop() < cover_height) { + coverVisibleActions(); } } } if($('main').css('opacity') < 1) { - $('main').css('opacity', ($(window).scrollTop()/$('#cover-photo').height()).toFixed(1)); + $('main').css('opacity', ($(window).scrollTop()/cover_height).toFixed(1)); } }); $(window).resize(function () { + cover_height = Math.ceil($(window).width()/2.75862069); + $('#cover-photo').css('height', cover_height + 'px'); if($(window).width() < 755) { $('#cover-photo').remove(); $('.navbar').addClass('fixed-top'); @@ -76,7 +67,7 @@ if(coverSlid) { return; } - $('html, body').animate({scrollTop: Math.ceil($('#cover-photo').height()) + 'px' }, 'fast'); + $('html, body').animate({scrollTop: cover_height + 'px'}, 'fast'); return; } @@ -84,7 +75,22 @@ if(coverSlid) { return; } - window.scrollTo(0, Math.ceil($('#cover-photo').height())); + window.scrollTo(0, cover_height); + return; + } + + function coverVisibleActions() { + $('body').css('cursor', 'n-resize'); + $('.navbar').removeClass('fixed-top'); + $('main').css('margin-top', - $('nav').outerHeight(true) + 'px'); + $('main').css('opacity', 0); + } + + function coverHiddenActions() { + $('body').css('cursor', ''); + $('.navbar').addClass('fixed-top'); + $('main').css('margin-top', ''); + $('main').css('opacity', 1); } </script> diff --git a/view/tpl/notifications_widget.tpl b/view/tpl/notifications_widget.tpl index 068441997..9b3d7487e 100644 --- a/view/tpl/notifications_widget.tpl +++ b/view/tpl/notifications_widget.tpl @@ -5,10 +5,17 @@ $(document).ready(function() { notifications_parent = $('#notifications_wrapper')[0].parentElement.id; $('.notifications-btn').click(function() { - if($('#notifications_wrapper').hasClass('fs')) + if($('#notifications_wrapper').hasClass('fs')) { $('#notifications_wrapper').prependTo('#' + notifications_parent); - else + //undo scrollbar remove + $('section').css('height', ''); + } + else { $('#notifications_wrapper').prependTo('section'); + //remove superfluous scrollbar + //setting overflow to hidden here has issues with some browsers + $('section').css('height', '100vh'); + } $('#notifications_wrapper').toggleClass('fs'); if($('#navbar-collapse-2').hasClass('show')){ |