r45471 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45470‎ | r45471 | r45472 >
Date:00:08, 7 January 2009
Author:dale
Status:deferred
Tags:
Comment:
minor missing width bug fix
Modified paths:
  • /trunk/extensions/MetavidWiki/skins/mv_embed/libRemoteMediaSearch/mv_remote_media_search.js (modified) (history)

Diff [purge]

Index: trunk/extensions/MetavidWiki/skins/mv_embed/libRemoteMediaSearch/mv_remote_media_search.js
@@ -455,6 +455,12 @@
456456 //get the HQ image url:
457457 rObj.pSobj.getImageObj( rObj, size, function( imObj ){
458458 rObj['url'] = imObj.url;
 459+
 460+ //update the rObj
 461+ rObj['org_width'] = imObj.org_width;
 462+ rObj['width'] = imObj.width;
 463+ rObj['height'] = imObj.height;
 464+
459465 //see if we need to animate some transition
460466 var newSize = false;
461467 if( size.width != imObj.width ){
@@ -462,10 +468,7 @@
463469 newSize={
464470 'width':imObj.width + 'px',
465471 'height':imObj.height + 'px'
466 - }
467 - //update the rObj (hopefully this happens before people select their crop)
468 - rObj['width'] = imObj.width;
469 - rObj['height'] = imObj.height;
 472+ }
470473 //set the target id to the new size:
471474 $j('#'+target_img_id).animate( newSize );
472475 }else{
@@ -1246,8 +1249,10 @@
12471250 do_api_req( reqObj, this.cp.api_url , function(data){
12481251 var imObj = {};
12491252 for(var page_id in data.query.pages){
1250 - var iminfo = data.query.pages[ page_id ].imageinfo[0];
1251 - //check if thumb size > than image size and is jpeg or png (it will not scale well above its max res)
 1253+ var iminfo = data.query.pages[ page_id ].imageinfo[0];
 1254+ //store the orginal width:
 1255+ imObj['org_width']=iminfo.width;
 1256+ //check if thumb size > than image size and is jpeg or png (it will not scale well above its max res)
12521257 if( ( iminfo.mime=='image/jpeg' || iminfo=='image/png' ) &&
12531258 iminfo.thumbwidth > iminfo.width ){
12541259 imObj['url'] = iminfo.url;

Status & tagging log