git.gnu.io has moved to IP address 209.51.188.249 -- please double check where you are logging in.

Commit b301d1e1 authored by buttle's avatar buttle

fixed window resize

parent b986ac76
......@@ -154,7 +154,7 @@ class SantsPlugin extends Plugin
function onEndShowJQueryScripts($action)
{
$action->script($this->path('scripts/jquery.visible.min.js'));
$action->script($this->path('scripts/jquery.viewport.mini.js'));
$action->script($this->path('scripts/header.js'));
}
......
......@@ -48,7 +48,7 @@
background-color: #FAFAFA;
left:0px;
top:42px;
width: 950px;
width: 690px;
padding:5px;
border-bottom: 5px solid #A6ADBF;
}
......@@ -93,3 +93,5 @@
{
background-color:white;
}
/* #aside_primary .entity_actions { display:none; } */
......@@ -5,27 +5,24 @@ function scrollToTop(){
return false;
}
function scrollToContent(){
$(document).scrollTop( $("#content").offset().top-42 );
}
$(function() {
//var x = $(document).height();
//actualheight = x - 20;
//alert(actualheight);
//http://web-profile.com.ua/jquery/dev/jquery-check-if-element-is-visible-on-screen/
if($('#footer').visible(true, true)){
$('#content').height(function(index, height) {
return window.innerHeight +100; // - $("#site_notice").offset().top-20;
});
if ($('#footer:in-viewport')){
var headerHeight = 330;
var windowHeight = $(window).height();
var contentHeight = $('#content_wrapper').height();
var footerHeight = $('#footer').height();
$('#aside_primary').height(windowHeight - headerHeight + footerHeight);
}
$(document).scrollTop( $("#site_notice").offset().top-20 );
scrollToContent();
});
$(function() {
if( $('#content').find('.input_forms').length > 0) {
$('#content').find('.input_forms').appendTo("#site_nav_global_primary");
}else{
if ( ! $('#content').find('.input_forms').length > 0 ) {
$("#site_nav_global_primary").find('.icon-comment').hide();
}
if( $('.third_level_menu').length > 0 ){
......@@ -80,13 +77,16 @@ $(function() {
function toggleDentForm(){
var main_dent_form = $("#site_nav_global_primary").find('.input_forms');
var main_dent_form = $("#content").find('.input_forms');
if(! main_dent_form.is(':visible') ){
main_dent_form.show();
main_dent_form.focus();
}else{
main_dent_form.fadeOut('fast');
}
if ($('#site_notice:in-viewport')){
scrollToContent();
}
main_dent_form.show(0, function() {
if (! $("#content").find('.input_forms:in-viewport')){
scrollToContent();
}
main_dent_form.focus();
});
}
(function($){$.belowthefold=function(element,settings){var fold=$(window).height()+$(window).scrollTop();return fold<=$(element).offset().top-settings.threshold;};$.abovethetop=function(element,settings){var top=$(window).scrollTop();return top>=$(element).offset().top+$(element).height()-settings.threshold;};$.rightofscreen=function(element,settings){var fold=$(window).width()+$(window).scrollLeft();return fold<=$(element).offset().left-settings.threshold;};$.leftofscreen=function(element,settings){var left=$(window).scrollLeft();return left>=$(element).offset().left+$(element).width()-settings.threshold;};$.inviewport=function(element,settings){return!$.rightofscreen(element,settings)&&!$.leftofscreen(element,settings)&&!$.belowthefold(element,settings)&&!$.abovethetop(element,settings);};$.extend($.expr[':'],{"below-the-fold":function(a,i,m){return $.belowthefold(a,{threshold:0});},"above-the-top":function(a,i,m){return $.abovethetop(a,{threshold:0});},"left-of-screen":function(a,i,m){return $.leftofscreen(a,{threshold:0});},"right-of-screen":function(a,i,m){return $.rightofscreen(a,{threshold:0});},"in-viewport":function(a,i,m){return $.inviewport(a,{threshold:0});}});})(jQuery);
\ No newline at end of file
;(function(e){e.fn.visible=function(t,n,r){var i=e(this).eq(0),s=i.get(0),o=e(window),u=o.scrollTop(),a=u+o.height(),f=o.scrollLeft(),l=f+o.width(),c=i.offset().top,h=c+i.height(),p=i.offset().left,d=p+i.width(),v=t===true?h:c,m=t===true?c:h,g=t===true?d:p,y=t===true?p:d,b=n===true?s.offsetWidth*s.offsetHeight:true,r=r?r:"both";if(r==="both")return!!b&&m<=a&&v>=u&&y<=l&&g>=f;else if(r==="vertical")return!!b&&m<=a&&v>=u;else if(r==="horizontal")return!!b&&y<=l&&g>=f}})(jQuery);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment