Skip to content

Commit

Permalink
Merge pull request okfde#51 from felixebert/master
Browse files Browse the repository at this point in the history
Fix for issue okfde#50: Mobile: Section "Ähnliche Anfrage" overlays request content area
  • Loading branch information
stefanw committed Apr 18, 2013
2 parents 066cc4a + 3c93f48 commit 1d138ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions froide/static/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ $(function(){
win.focus();
});
$(".sticky").each(function(i, el){
$(el).scrollToFixed({marginTop: 10});
$(el).scrollToFixed({marginTop: 10, minWidth: 768});
});
$("a.show-target").live("click", function(e){
var obj = $('#' + $(this).attr("href").split('#')[1]).find(".toggle");
Expand Down Expand Up @@ -500,4 +500,4 @@ $(function(){
* ScrollToFixed by Joseph Cava-Lynch
* https://github.com/bigspotteddog/ScrollToFixed
*/
(function(a){a.ScrollToFixed=function(c,f){var i=this;i.$el=a(c);i.el=c;i.$el.data("ScrollToFixed",i);var b=false;var u=i.$el;var t=0;var l=0;var g=-1;var d=-1;var n=null;function o(){h();d=-1;t=u.offset().top;l=u.offset().left;if(g==-1){orginalOffsetLeft=l}b=true;if(i.options.bottom!=-1){q()}}function k(){return u.css("position")=="fixed"}function r(){return u.css("position")=="absolute"}function e(){return !(k()||r())}function q(){if(!k()){n.css({display:u.css("display"),width:u.outerWidth(true),height:u.outerHeight(true),"float":u.css("float")});u.css({width:u.width(),position:"fixed",top:i.options.bottom==-1?m():"",bottom:i.options.bottom==-1?"":i.options.bottom})}}function h(){if(!e()){d=-1;n.css("display","none");u.css({width:"",position:"",left:"",top:""})}}function p(v){if(v!=d){u.css("left",l-v);d=v}}function m(){return i.options.marginTop}function s(){if(!b){o()}var v=a(window).scrollLeft();var w=a(window).scrollTop();if(i.options.bottom==-1){if(i.options.limit>0&&w>=i.options.limit-m()){if(!r()){j();u.trigger("preAbsolute");u.css({width:u.width(),position:"absolute",top:i.options.limit,left:l});u.trigger("unfixed")}}else{if(w>=t-m()){if(!k()){j();u.trigger("preFixed");q();d=-1;u.trigger("fixed")}p(v)}else{if(k()){j();u.trigger("preUnfixed");h();u.trigger("unfixed")}}}}else{if(i.options.limit>0){if(w+a(window).height()-u.outerHeight(true)>=i.options.limit-m()){if(k()){j();u.trigger("preUnfixed");h();u.trigger("unfixed")}}else{if(!k()){j();u.trigger("preFixed");q()}p(v);u.trigger("fixed")}}else{p(v)}}}function j(){var v=u.css("position");if(v=="absolute"){u.trigger("postAbsolute")}else{if(v=="fixed"){u.trigger("postFixed")}else{u.trigger("postUnfixed")}}}i.init=function(){i.options=a.extend({},a.ScrollToFixed.defaultOptions,f);if(navigator.platform=="iPad"||navigator.platform=="iPhone"||navigator.platform=="iPod"){return}i.$el.css("z-index",i.options.zIndex);n=a("<div/>");i.$el.after(n);a(window).bind("resize",function(v){o();s()});a(window).bind("scroll",function(v){s()});if(i.options.preFixed){u.bind("preFixed",i.options.preFixed)}if(i.options.postFixed){u.bind("postFixed",i.options.postFixed)}if(i.options.preUnfixed){u.bind("preUnfixed",i.options.preUnfixed)}if(i.options.postUnfixed){u.bind("postUnfixed",i.options.postUnfixed)}if(i.options.preAbsolute){u.bind("preAbsolute",i.options.preAbsolute)}if(i.options.postAbsolute){u.bind("postAbsolute",i.options.postAbsolute)}if(i.options.fixed){u.bind("fixed",i.options.fixed)}if(i.options.unfixed){u.bind("unfixed",i.options.unfixed)}if(i.options.bottom!=-1){if(!k()){j();u.trigger("preFixed");q()}}};i.init()};a.ScrollToFixed.defaultOptions={marginTop:0,limit:0,bottom:-1,zIndex:1000};a.fn.scrollToFixed=function(b){return this.each(function(){(new a.ScrollToFixed(this,b))})}})(jQuery);
(function(a){a.isScrollToFixed=function(b){return a(b).data("ScrollToFixed")!==undefined};a.ScrollToFixed=function(d,h){var k=this;k.$el=a(d);k.el=d;k.$el.data("ScrollToFixed",k);var c=false;var F=k.$el;var G;var D;var p;var C=0;var q=0;var i=-1;var e=-1;var t=null;var y;var f;function u(){F.trigger("preUnfixed.ScrollToFixed");j();F.trigger("unfixed.ScrollToFixed");e=-1;C=F.offset().top;q=F.offset().left;if(k.options.offsets){q+=(F.offset().left-F.position().left)}if(i==-1){i=q}G=F.css("position");c=true;if(k.options.bottom!=-1){F.trigger("preFixed.ScrollToFixed");w();F.trigger("fixed.ScrollToFixed")}}function m(){var H=k.options.limit;if(!H){return 0}if(typeof(H)==="function"){return H.apply(F)}return H}function o(){return G==="fixed"}function x(){return G==="absolute"}function g(){return !(o()||x())}function w(){if(!o()){t.css({display:F.css("display"),width:F.outerWidth(true),height:F.outerHeight(true),"float":F.css("float")});F.css({width:F.width(),position:"fixed",top:k.options.bottom==-1?s():"",bottom:k.options.bottom==-1?"":k.options.bottom,"margin-left":"0px"});F.addClass("scroll-to-fixed-fixed");if(k.options.className){F.addClass(k.options.className)}G="fixed"}}function b(){var I=m();var H=q;if(k.options.removeOffsets){H=0;I=I-C}F.css({width:F.width(),position:"absolute",top:I,left:H,"margin-left":"0px",bottom:""});G="absolute"}function j(){if(!g()){e=-1;t.css("display","none");F.css({width:"",position:D,left:"",top:p.top,"margin-left":""});F.removeClass("scroll-to-fixed-fixed");if(k.options.className){F.removeClass(k.options.className)}G=null}}function v(H){if(H!=e){F.css("left",q-H);e=H}}function s(){var H=k.options.marginTop;if(!H){return 0}if(typeof(H)==="function"){return H.apply(F)}return H}function z(){if(!a.isScrollToFixed(F)){return}var J=c;if(!c){u()}var H=a(window).scrollLeft();var K=a(window).scrollTop();var I=m();if(k.options.minWidth&&a(window).width()<k.options.minWidth){if(!g()||!J){n();F.trigger("preUnfixed.ScrollToFixed");j();F.trigger("unfixed.ScrollToFixed")}}else{if(k.options.bottom==-1){if(I>0&&K>=I-s()){if(!x()||!J){n();F.trigger("preAbsolute.ScrollToFixed");b();F.trigger("unfixed.ScrollToFixed")}}else{if(K>=C-s()){if(!o()||!J){n();F.trigger("preFixed.ScrollToFixed");w();e=-1;F.trigger("fixed.ScrollToFixed")}v(H)}else{if(!g()||!J){n();F.trigger("preUnfixed.ScrollToFixed");j();F.trigger("unfixed.ScrollToFixed")}}}}else{if(I>0){if(K+a(window).height()-F.outerHeight(true)>=I-(s()||-l())){if(o()){n();F.trigger("preUnfixed.ScrollToFixed");if(D==="absolute"){b()}else{j()}F.trigger("unfixed.ScrollToFixed")}}else{if(!o()){n();F.trigger("preFixed.ScrollToFixed");w()}v(H);F.trigger("fixed.ScrollToFixed")}}else{v(H)}}}}function l(){if(!k.options.bottom){return 0}return k.options.bottom}function n(){var H=F.css("position");if(H=="absolute"){F.trigger("postAbsolute.ScrollToFixed")}else{if(H=="fixed"){F.trigger("postFixed.ScrollToFixed")}else{F.trigger("postUnfixed.ScrollToFixed")}}}var B=function(H){if(F.is(":visible")){c=false;z()}};var E=function(H){z()};var A=function(){var I=document.body;if(document.createElement&&I&&I.appendChild&&I.removeChild){var K=document.createElement("div");if(!K.getBoundingClientRect){return null}K.innerHTML="x";K.style.cssText="position:fixed;top:100px;";I.appendChild(K);var L=I.style.height,M=I.scrollTop;I.style.height="3000px";I.scrollTop=500;var H=K.getBoundingClientRect().top;I.style.height=L;var J=(H===100);I.removeChild(K);I.scrollTop=M;return J}return null};var r=function(H){H=H||window.event;if(H.preventDefault){H.preventDefault()}H.returnValue=false};k.init=function(){k.options=a.extend({},a.ScrollToFixed.defaultOptions,h);k.$el.css("z-index",k.options.zIndex);t=a("<div />");G=F.css("position");D=F.css("position");p=a.extend({},F.offset());if(g()){k.$el.after(t)}a(window).bind("resize.ScrollToFixed",B);a(window).bind("scroll.ScrollToFixed",E);if(k.options.preFixed){F.bind("preFixed.ScrollToFixed",k.options.preFixed)}if(k.options.postFixed){F.bind("postFixed.ScrollToFixed",k.options.postFixed)}if(k.options.preUnfixed){F.bind("preUnfixed.ScrollToFixed",k.options.preUnfixed)}if(k.options.postUnfixed){F.bind("postUnfixed.ScrollToFixed",k.options.postUnfixed)}if(k.options.preAbsolute){F.bind("preAbsolute.ScrollToFixed",k.options.preAbsolute)}if(k.options.postAbsolute){F.bind("postAbsolute.ScrollToFixed",k.options.postAbsolute)}if(k.options.fixed){F.bind("fixed.ScrollToFixed",k.options.fixed)}if(k.options.unfixed){F.bind("unfixed.ScrollToFixed",k.options.unfixed)}if(k.options.spacerClass){t.addClass(k.options.spacerClass)}F.bind("resize.ScrollToFixed",function(){t.height(F.height())});F.bind("scroll.ScrollToFixed",function(){F.trigger("preUnfixed.ScrollToFixed");j();F.trigger("unfixed.ScrollToFixed");z()});F.bind("detach.ScrollToFixed",function(H){r(H);F.trigger("preUnfixed.ScrollToFixed");j();F.trigger("unfixed.ScrollToFixed");a(window).unbind("resize.ScrollToFixed",B);a(window).unbind("scroll.ScrollToFixed",E);F.unbind(".ScrollToFixed");k.$el.removeData("ScrollToFixed")});B()};k.init()};a.ScrollToFixed.defaultOptions={marginTop:0,limit:0,bottom:-1,zIndex:1000};a.fn.scrollToFixed=function(b){return this.each(function(){(new a.ScrollToFixed(this,b))})}})(jQuery);

0 comments on commit 1d138ef

Please sign in to comment.