HEX
Server: LiteSpeed
System: Linux linux31.centraldnserver.com 4.18.0-553.83.1.lve.el8.x86_64 #1 SMP Wed Nov 12 10:04:12 UTC 2025 x86_64
User: salamatk (1501)
PHP: 8.1.33
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open
Upload Files
File: /home/salamatk/takarzan.ir/wp-content/themes/xts-luman/js/scripts/clickOnScrollButton.js
/* global xts_settings */
(function($) {
	XTSThemeModule.clickOnScrollButton = function(btnClass) {
		if (typeof ($.fn.waypoint) === 'undefined') {
			return;
		}

		var $btn = $(btnClass);

		if ($btn.length <= 0) {
			return;
		}

		$btn.trigger('xtsWaypointDestroy');

		var waypoint = $btn.waypoint({
			handler: function() {
				$btn.trigger('click');
			},
			offset : function() {
				return xts_settings.pagination_infinite_offset ? parseInt(xts_settings.pagination_infinite_offset) : XTSThemeModule.$window.outerHeight();
			}
		});

		$btn.data('waypoint-inited', true).off('xtsWaypointDestroy').on('xtsWaypointDestroy', function() {
			if ($btn.data('waypoint-inited')) {
				waypoint[0].destroy();
				$btn.data('waypoint-inited', false)
			}
		});
	};
})(jQuery);