can3p (can3p) wrote in changelog,
can3p
can3p
changelog

[livejournal] r19810: LJSUP-9595: Popup with 'photobucket' mov...

Committer: dpetrov
LJSUP-9595: Popup with 'photobucket' moves
U   trunk/htdocs/js/entry.js
Modified: trunk/htdocs/js/entry.js
===================================================================
--- trunk/htdocs/js/entry.js	2011-08-23 07:24:22 UTC (rev 19809)
+++ trunk/htdocs/js/entry.js	2011-08-23 07:31:20 UTC (rev 19810)
@@ -1249,30 +1249,32 @@
 };
 
 InOb.fullCenter = function (){
-	var windims = DOM.getClientDimensions();
+	var windims = DOM.getClientDimensions(),
+		h2 = Math.floor((windims.y - 220)/2), //half of real height, we do not want to round numbers again
+		w2 = Math.floor((windims.x - 55)/2)
 
-	DOM.setHeight(currentPopup, windims.y - 220);
-	DOM.setWidth(currentPopup, windims.x - 55);
-	DOM.setTop(currentPopup, (210 / 2));
-	DOM.setLeft(currentPopup, (40 / 2));
+	DOM.setHeight(currentPopup, h2 * 2);
+	DOM.setWidth(currentPopup, w2 * 2);
 
-	scroll(0, 0);
+	currentPopup.style.top = '50%';
+	currentPopup.style.marginTop = '-' + h2 + 'px';
+
+	currentPopup.style.left = '50%';
+	currentPopup.style.marginLeft = '-' + w2 + 'px';
 };
 
 InOb.tallCenter = function (){
-	var windims = DOM.getClientDimensions();
-
 	DOM.setHeight(currentPopup, 500);
 	DOM.setWidth(currentPopup, 420);
-	DOM.setTop(currentPopup, (windims.y - 300) / 2);
-	DOM.setLeft(currentPopup, (windims.x - 715) / 2);
 
-	scroll(0, 0);
+	currentPopup.style.top = '50%';
+	currentPopup.style.marginTop = '-250px';
+
+	currentPopup.style.left = '50%';
+	currentPopup.style.marginLeft = '-210px';
 };
 
 InOb.smallCenter = function (){
-	var windims = DOM.getClientDimensions();
-
 	DOM.setHeight(currentPopup, 300);
 	DOM.setWidth(currentPopup, 700);
 
@@ -1367,4 +1369,4 @@
 InOb.setTitle = function (title){
 	var wintitle = currentPopupWindow.document.getElementById('wintitle');
 	wintitle.innerHTML = title;
-};
\ No newline at end of file
+};

Tags: can3p, js, livejournal
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments