comparison war/scripts/blockUI/FullscreenWindow.js @ 3:cf06b77a8bbd

Committed branch of the e4D repos sti-gwt branch 16384. git-svn-id: http://dev.dariah.eu/svn/repos/eu.dariah.de/ap1/sti-gwt-dariah-geobrowser@36 f2b5be40-def6-11e0-8a09-b3c1cc336c6b
author StefanFunk <StefanFunk@f2b5be40-def6-11e0-8a09-b3c1cc336c6b>
date Tue, 17 Jul 2012 13:34:40 +0000
parents
children
comparison
equal deleted inserted replaced
2:2897af43ccc6 3:cf06b77a8bbd
1 var fullscreen = new function(){
2
3 var loader = new Image();
4 loader.src = 'images/ajax-loader.gif';
5
6 this.fullscreens = [];
7 this.zIndex = 5;
8 this.margin = 20;
9
10 this.loaderContent = function(){
11 var content = $("<div/>");
12 content.css('position','absolute');
13 content.append("<p id='statusText' style='text-align: center;color:white;'></p>");
14 content.append("<img src='images/ajax-loader.gif'/>");
15 return content;
16 }
17
18
19 this.addFullscreen = function(content){
20 var blockDiv = $("<div/>").appendTo('body');
21 blockDiv.addClass("blockDiv");
22 blockDiv.css('width',$(document).width()+'px');
23 blockDiv.css('height',$(document).height()+'px');
24 blockDiv.css('z-index',++this.zIndex);
25 var overlay = $("<div/>").appendTo(blockDiv);
26 overlay.addClass("blockDivOverlay");
27 overlay.css('width',$(document).width()+'px');
28 overlay.css('height',$(document).height()+'px');
29 $(content).appendTo(blockDiv);
30 this.fullscreens.push({
31 content: content,
32 overlay: overlay,
33 blockDiv: blockDiv
34 });
35 this.centerDiv(content);
36 }
37
38 this.centerDiv = function(div){
39 var left = Math.floor($(document).width()/2-div.width()/2);
40 var top = Math.floor($(document).height()/2-div.height()/2);
41 div.css('top', top+'px');
42 div.css('left', left+'px');
43 }
44
45 this.removeFullscreen = function(){
46 $(this.fullscreens[this.fullscreens.length-1].blockDiv).remove();
47 this.fullscreens.pop();
48 }
49
50 this.resize = function(){
51 for( var i in this.fullscreens ){
52 this.fullscreens[i].blockDiv.css('width',$(document).width()+'px');
53 this.fullscreens[i].blockDiv.css('height',$(document).height()+'px');
54 this.fullscreens[i].overlay.css('width',$(document).width()+'px');
55 this.fullscreens[i].overlay.css('height',$(document).height()+'px');
56 this.centerDiv(this.fullscreens[i].content);
57 }
58 }
59
60 }