From f821580b50361f1cf5e115c64351fa685ea6c48e Mon Sep 17 00:00:00 2001 From: Ozzieisaacs Date: Thu, 3 Jan 2019 22:01:52 +0100 Subject: [PATCH] #Fix 745 --- cps/static/js/caliBlur.js | 13 ------------- cps/static/js/libs/jquery.visible.min.js | 1 + cps/templates/layout.html | 5 +++-- 3 files changed, 4 insertions(+), 15 deletions(-) create mode 100644 cps/static/js/libs/jquery.visible.min.js diff --git a/cps/static/js/caliBlur.js b/cps/static/js/caliBlur.js index fdbf3d7a..fb4c930b 100644 --- a/cps/static/js/caliBlur.js +++ b/cps/static/js/caliBlur.js @@ -1,16 +1,3 @@ - - /*** - * Copyright 2012, Digital Fusion - * Licensed under the MIT license. - * http://teamdf.com/jquery-plugins/license/ - * - * @author Sam Sehnert - * @desc A small plugin that checks whether elements are within - * the user visible viewport of a web browser. - * can accounts for vertical position, horizontal, or both - */ -!function(t){var i=t(window);t.fn.visible=function(t,e,o){if(!(this.length<1)){var r=this.length>1?this.eq(0):this,n=r.get(0),f=i.width(),h=i.height(),o=o?o:"both",l=e===!0?n.offsetWidth*n.offsetHeight:!0;if("function"==typeof n.getBoundingClientRect){var g=n.getBoundingClientRect(),u=g.top>=0&&g.top0&&g.bottom<=h,c=g.left>=0&&g.left0&&g.right<=f,v=t?u||s:u&&s,b=t?c||a:c&&a;if("both"===o)return l&&v&&b;if("vertical"===o)return l&&v;if("horizontal"===o)return l&&b}else{var d=i.scrollTop(),p=d+h,w=i.scrollLeft(),m=w+f,y=r.offset(),z=y.top,B=z+r.height(),C=y.left,R=C+r.width(),j=t===!0?B:z,q=t===!0?z:B,H=t===!0?R:C,L=t===!0?C:R;if("both"===o)return!!l&&p>=q&&j>=d&&m>=L&&H>=w;if("vertical"===o)return!!l&&p>=q&&j>=d;if("horizontal"===o)return!!l&&m>=L&&H>=w}}}}(jQuery); - // Move advanced search to side-menu $( 'a[href*="advanced"]' ).parent().insertAfter( '#nav_new' ); $( 'body' ).addClass('blur'); diff --git a/cps/static/js/libs/jquery.visible.min.js b/cps/static/js/libs/jquery.visible.min.js new file mode 100644 index 00000000..417039c3 --- /dev/null +++ b/cps/static/js/libs/jquery.visible.min.js @@ -0,0 +1 @@ +!function(t){var i=t(window);t.fn.visible=function(t,e,o){if(!(this.length<1)){var r=this.length>1?this.eq(0):this,n=r.get(0),f=i.width(),h=i.height(),o=o?o:"both",l=e===!0?n.offsetWidth*n.offsetHeight:!0;if("function"==typeof n.getBoundingClientRect){var g=n.getBoundingClientRect(),u=g.top>=0&&g.top0&&g.bottom<=h,c=g.left>=0&&g.left0&&g.right<=f,v=t?u||s:u&&s,b=t?c||a:c&&a;if("both"===o)return l&&v&&b;if("vertical"===o)return l&&v;if("horizontal"===o)return l&&b}else{var d=i.scrollTop(),p=d+h,w=i.scrollLeft(),m=w+f,y=r.offset(),z=y.top,B=z+r.height(),C=y.left,R=C+r.width(),j=t===!0?B:z,q=t===!0?z:B,H=t===!0?R:C,L=t===!0?C:R;if("both"===o)return!!l&&p>=q&&j>=d&&m>=L&&H>=w;if("vertical"===o)return!!l&&p>=q&&j>=d;if("horizontal"===o)return!!l&&m>=L&&H>=w}}}}(jQuery); diff --git a/cps/templates/layout.html b/cps/templates/layout.html index 2d9486a5..7609c2b9 100644 --- a/cps/templates/layout.html +++ b/cps/templates/layout.html @@ -241,8 +241,9 @@ {% if g.user.get_theme == 1 %} - + + + {% endif %}