Oracle (ex_ioracle) wrote in changelog,
Oracle
ex_ioracle
changelog

[livejournal] r17604: LJSUP-6062: It's a bad idea to use width...

Committer: skomarov
LJSUP-6062: It's a bad idea to use width for images on page /misc/lastquestion.bml
U   trunk/htdocs/stc/ie.css
U   trunk/htdocs/stc/widgets/recentcomments.css
Modified: trunk/htdocs/stc/ie.css
===================================================================
--- trunk/htdocs/stc/ie.css	2010-10-26 06:44:03 UTC (rev 17603)
+++ trunk/htdocs/stc/ie.css	2010-10-26 06:44:42 UTC (rev 17604)
@@ -240,6 +240,24 @@
 	height: 96px;
 	}
 
+/* Max width & max height
+-----------------------------------------------*/
+*HTML .lj_qotd_entry_userpic .userpic-img,
+*HTML .appwidget-recentcomments .userpic-img {
+	zoom:expression(
+			function(t){
+				t.runtimeStyle.zoom = 1;
+				var maxW = parseInt(t.currentStyle['max-width'], 10);
+				var maxH = parseInt(t.currentStyle['max-height'], 10);
+				if (t.scrollWidth > maxW && t.scrollWidth >= t.scrollHeight) {
+					t.style.width = maxW;
+				} else if (t.scrollHeight > maxH) {
+					t.style.height = maxH;
+				}
+			}(this)
+		);
+	}
+
 /* Photos 2 homepage widget
 -----------------------------------------------*/
 .appwidget-photos2homepage .w-body .pic-list,
@@ -266,6 +284,7 @@
 	width: 140px;
 	height: 105px;
 	}
+
 /* S1 comments */
 .talk-comment-head {
 	zoom: 1;

Modified: trunk/htdocs/stc/widgets/recentcomments.css
===================================================================
--- trunk/htdocs/stc/widgets/recentcomments.css	2010-10-26 06:44:03 UTC (rev 17603)
+++ trunk/htdocs/stc/widgets/recentcomments.css	2010-10-26 06:44:42 UTC (rev 17604)
@@ -1,16 +1,17 @@
-/* recent comments */
-
+/* Recent comments widget
+-----------------------------------------------*/
 .appwidget-recentcomments .userpic-img {
-    width: 60px;
-    float: left;
-    margin-right: 8px;
-    border: none;
-}
-.appwidget-recentcomments p.pkg {
-    border-bottom: 1px solid #ddd;
-    padding: 0 0 10px 0;
-}
-.appwidget-recentcomments p.pkg.last {
-    border-bottom: none;
-    padding-bottom: 0;
-}
+	float: left;
+	max-width: 60px;
+	max-height: 60px;
+	margin-right: 8px;
+	border: none;
+	}
+.appwidget-recentcomments P.pkg {
+	border-bottom: 1px solid #ddd;
+	padding: 0 0 10px 0;
+	}
+.appwidget-recentcomments P.pkg.last {
+	border-bottom: none;
+	padding-bottom: 0;
+	}

Tags: css, ioracle, 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