diff options
Diffstat (limited to 'view')
-rwxr-xr-x | view/tpl/cover_photo_widget.tpl | 75 | ||||
-rwxr-xr-x | view/tpl/follow.tpl | 2 | ||||
-rwxr-xr-x | view/tpl/peoplefind.tpl | 2 | ||||
-rw-r--r-- | view/tpl/searchbox.tpl | 2 | ||||
-rw-r--r-- | view/tpl/wiki.tpl | 2 |
5 files changed, 45 insertions, 38 deletions
diff --git a/view/tpl/cover_photo_widget.tpl b/view/tpl/cover_photo_widget.tpl index e8af6f6dc..7739d24b8 100755 --- a/view/tpl/cover_photo_widget.tpl +++ b/view/tpl/cover_photo_widget.tpl @@ -3,65 +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(); - } + $(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'); @@ -75,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; } @@ -83,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/follow.tpl b/view/tpl/follow.tpl index 2fb753784..bccb25068 100755 --- a/view/tpl/follow.tpl +++ b/view/tpl/follow.tpl @@ -2,7 +2,7 @@ <h3>{{$connect}}</h3> <form action="follow" method="post" /> <div class="input-group"> - <input class="form-control form-control-sm" type="text" name="url" title="{{$hint}}" placeholder="{{$desc}}" /> + <input class="form-control" type="text" name="url" title="{{$hint}}" placeholder="{{$desc}}" /> <div class="input-group-append"> <button class="btn btn-success" type="submit" name="submit" value="{{$follow}}" title="{{$follow}}"><i class="fa fa-fw fa-plus"></i></button> </div> diff --git a/view/tpl/peoplefind.tpl b/view/tpl/peoplefind.tpl index b4d9ef19f..206be694e 100755 --- a/view/tpl/peoplefind.tpl +++ b/view/tpl/peoplefind.tpl @@ -2,7 +2,7 @@ <h3>{{$findpeople}}</h3> <form action="directory" method="post" /> <div class="input-group form-group"> - <input class="form-control form-control-sm" type="text" name="search" title="{{$hint}}{{if $advanced_search}}{{$advanced_hint}}{{/if}}" placeholder="{{$desc}}" /> + <input class="form-control" type="text" name="search" title="{{$hint}}{{if $advanced_search}}{{$advanced_hint}}{{/if}}" placeholder="{{$desc}}" /> <div class="input-group-append"> <button class="btn btn-outline-secondary" type="submit" name="submit"><i class="fa fa-fw fa-search"></i></button> </div> diff --git a/view/tpl/searchbox.tpl b/view/tpl/searchbox.tpl index abcdb8933..2fcf3e374 100644 --- a/view/tpl/searchbox.tpl +++ b/view/tpl/searchbox.tpl @@ -1,7 +1,7 @@ <form action="{{$action_url}}" method="get" > <input type="hidden" name="f" value="" /> <div id="{{$id}}" class="input-group"> - <input class="form-control form-control-sm" type="text" name="search" id="search-text" value="{{$s}}" onclick="this.submit();" /> + <input class="form-control" type="text" name="search" id="search-text" value="{{$s}}" onclick="this.submit();" /> <div class="input-group-append"> <button type="submit" name="submit" class="btn btn-outline-secondary" id="search-submit" value="{{$search_label}}"><i class="fa fa-search"></i></button> {{if $savedsearch}} diff --git a/view/tpl/wiki.tpl b/view/tpl/wiki.tpl index 0f725749f..2aabc7b5f 100644 --- a/view/tpl/wiki.tpl +++ b/view/tpl/wiki.tpl @@ -66,7 +66,7 @@ {{if $showPageControls}} <div id="id_{{$commitMsg.0}}_wrapper" class="field input" style="display: none"> <div class="input-group"> - <input class="form-control form-control-sm" name="{{$commitMsg.0}}" id="id_{{$commitMsg.0}}" type="text" value="{{$commitMsg.2}}"{{if $commitMsg.5}} {{$commitMsg.5}}{{/if}}> + <input class="form-control" name="{{$commitMsg.0}}" id="id_{{$commitMsg.0}}" type="text" value="{{$commitMsg.2}}"{{if $commitMsg.5}} {{$commitMsg.5}}{{/if}}> <div class="input-group-append"> <button id="save-page" type="button" class="btn btn-primary disabled">Save</button> </div> |