From 45a5c8a5ab03b695f6147a9860e04278a55e094f Mon Sep 17 00:00:00 2001 From: dongsheng Date: Thu, 23 Oct 2008 07:10:50 +0000 Subject: [PATCH] "MDL-13766, add thumbnail_width option for listing" --- repository/javascript.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/repository/javascript.php b/repository/javascript.php index 36d653ce0b..aa6d285c84 100644 --- a/repository/javascript.php +++ b/repository/javascript.php @@ -84,10 +84,10 @@ function repository_get_client($context) { .fp-paging{margin:1em .5em; clear:both;text-align:center;line-height: 2.5em;} .fp-paging a{padding: .5em;border: 1px solid #CCC} .fp-popup{text-align:center} -.fp-grid{width:80px; float:left;text-align:center;} -.fp-grid div{width: 80px; overflow: hidden} +.fp-grid{float:left;text-align:center;} +.fp-grid div{overflow: hidden} .fp-grid p{margin:0;padding:0;background: #FFFFCC} -.fp-grid .label{height:48px} +.fp-grid .label{height:48px;text-align:center} .fp-grid span{background: #EEF9EB;color:gray} EOD; @@ -489,7 +489,14 @@ _client.viewthumb = function(ds) { var count = 0; for(k in list) { var el = document.createElement('div'); + var title = document.createElement('div'); el.className='fp-grid'; + if(list[k].thumbnail_width){ + el.style.width = list[k].thumbnail_width+'px'; + title.style.width = (list[k].thumbnail_width-20)+'px'; + } else { + el.style.width = title.style.width = '80px'; + } var frame = document.createElement('DIV'); frame.style.textAlign='center'; var img = document.createElement('img'); @@ -499,7 +506,6 @@ _client.viewthumb = function(ds) { link.id = 'img-id-'+String(count); link.appendChild(img); frame.appendChild(link); - var title = document.createElement('div'); if(list[k].children) { title.innerHTML = ''+list[k].title+''; } else { -- 2.39.5