MDL-47494 ddimageortext: NOBUG more work to make JS more reliable across browsers.

This commit is contained in:
Jamie Pratt
2011-08-18 18:44:40 +07:00
parent dbe2635db6
commit a8be2699a9
+1 -5
View File
@@ -292,16 +292,11 @@ M.qtype_ddimagetoimage={
maxwidth = Math.max(maxwidth, image.get('width'));
maxheight = Math.max(maxheight, image.get('height'));
}, this);
console.log('groupno : '+groupno);
console.log('maxwidth : '+maxwidth);
console.log('maxheight : '+maxheight);
groupimages.each(function(image) {
var margintopbottom = Math.round((10 + maxheight - image.get('height')) / 2);
var marginleftright = Math.round((10 + maxwidth - image.get('width')) / 2);
image.setStyle('padding', margintopbottom+'px '+marginleftright+'px '
+margintopbottom+'px '+marginleftright+'px');
console.log(margintopbottom+'px '+marginleftright+'px '
+margintopbottom+'px '+marginleftright+'px');
}, this);
this.doc.drop_zone_group(groupno).setStyles({'width': maxwidth + 10,
'height': maxheight + 10});
@@ -373,6 +368,7 @@ M.qtype_ddimagetoimage={
if (reduceby > 1) {
e.target.set('width', Math.floor(e.target.get('width') / reduceby));
}
e.target.detach('load', this.constrain_image_size);
},
load_drag_homes : function () {