PageSourceSearch

https://skoolooks.com/data/skin/skoolooks/common/skls/wrapModalPopup.js

js skoolooks.com collected 2026-10-07 04:31:58 UTC 1,862 bytes, 72 lines download raw bytes

1var wrapModalPopup = function(targ, parentTarg, callback){
2	if($(".wrapModalPopup").length === 0){
3		$("body").append('<div class="wrapModalPopup"><div class="wrapModalMask"/><div class="wrapModalContainer"/></div>');
4	}
5
6	var $modal = $(".wrapModalPopup");
7	var $modalContainer = $(".wrapModalContainer");
8	// var $elem = targ.split(" ");
9	var $elem = targ;
10
11	var winHeight = $(window).outerHeight();
12
13	if($modal.is(":visible") === false){
14		$("body").css("overflow","hidden");
15	}
16
17	$modal.attr("data-parent-elem", parentTarg).fadeIn(200);
18
19	// load
20	// $modalContainer.load(targ, function(){
21		$elem = $modalContainer.find($elem);
22
23		$elem.addClass("wrapModalContents");
24		$elem.fadeIn(200, function(){
25			$elem.attr("tabindex",0).focus();
26			$modal.scrollTop(0);
27		});
28
29		var elemWidth = $elem.outerWidth();
30		var elemHeight = $elem.outerHeight();
31
32		if(winHeight <= elemHeight) marginY = 20;
33		else marginY = winHeight / 2 - elemHeight / 2;
34
35		$modalContainer.css({
36			"margin" : marginY + "px auto"
37		});
38
39		$modal.scrollTop(0);
40
41		// callback
42		if(callback && typeof(callback) == "function") callback();
43
44		// window resize event listener
45		$(window).off("resize.wrapModalResize");
46		$(window).on("resize.wrapModalResize",function(){
47			var winHeight = $(window).outerHeight();
48
49			if(winHeight <= elemHeight) marginY = 20;
50			else marginY = winHeight / 2 - elemHeight / 2;
51
52			$modalContainer.css({
53				"margin" : marginY + "px auto"
54			});
55		});
56	// });
57};
58
59wrapModalPopup.prototype.close = function(callback){
60	var $modal = $(".wrapModalPopup");
61	var $parentTarg = $($modal.attr("data-parent-elem"));
62
63	$modal.fadeOut(200, function(){
64		$parentTarg.focus();
65		$modal.find(".wrapModalContents").removeClass("wrapModalContents").hide();
66
67		$("body").removeAttr("style");
68
69		// callback
70		if(callback && typeof(callback) == "function") callback();
71	});
72};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.