PluginProbe
Sight – Professional Image Gallery and Portfolio / 1.1.7
Sight – Professional Image Gallery and Portfolio v1.1.7
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8
sight / render / js / utility.js

utility.js in Sight – Professional Image Gallery and Portfolio 1.1.7, at render/js/utility.js

44 lines 803 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 // Create csco object.
2 var sight = {
3 addAction: function( x, y, z ) {
4 return;
5 }
6 };
7
8 if ( 'undefined' !== typeof wp && 'undefined' !== typeof wp.hooks ) {
9 sight.addAction = wp.hooks.addAction;
10 }
11
12 if ( 'undefined' === typeof window.load_more_query ) {
13 window.load_more_query = [];
14 }
15
16 /**
17 * Window size
18 */
19 const $ = jQuery;
20 const $window = $( window );
21 const $doc = $( document );
22 const $body = $( 'body' );
23
24 /**
25 * In Viewport checker
26 */
27 $.fn.isInViewport = function() {
28 var elementTop = $( this ).offset().top;
29 var elementBottom = elementTop + $( this ).outerHeight();
30
31 var viewportTop = $( window ).scrollTop();
32 var viewportBottom = viewportTop + $( window ).height();
33
34 return elementBottom > viewportTop && elementTop < viewportBottom;
35 };
36
37 export {
38 $,
39 $window,
40 $doc,
41 $body,
42 sight
43 };
44