Skip to content

Commit

Permalink
MDL-47494 ddwtos: ddwtos fix problems in Firefox. #383
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin Chambers authored and timhunt committed Jul 5, 2011
1 parent 5a28b55 commit 287273c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions question/type/ddwtos/script.js
Expand Up @@ -142,7 +142,6 @@ var ddwtos_currentzindex = 10;
}

show_element(this.getEl());

if (target.player) { // there's a player already there
var oldplayer = target.player;
oldplayer.startDrag(0,0);
Expand All @@ -152,6 +151,7 @@ var ddwtos_currentzindex = 10;
YAHOO.util.DragDropMgr.moveToEl(dragged, target.getEl());
this.slot = target;
target.player = this;

YAHOO.util.Dom.setXY(target.player.getEl(), YAHOO.util.Dom.getXY(target.getEl()));
YAHOO.util.Dom.addClass(this.getEl(), 'placed');
if (YAHOO.util.Dom.hasClass(target.getEl(), 'readonly')) {
Expand Down Expand Up @@ -217,7 +217,7 @@ var ddwtos_currentzindex = 10;
var height = region.bottom - region.top;
var width = region.right - region.left;

// -2 is becuase get_region includes the border, but style.width/height does not.
// -2 is because get_region includes the border, but style.width/height does not.
newNode.style.height = (height - 2) + "px";
newNode.style.width = (width - 2) + "px";

Expand Down Expand Up @@ -302,6 +302,9 @@ var ddwtos_currentzindex = 10;
for (var i = 0; i < slots.length; i++) {
var slot = slots[i];

height = YAHOO.util.Dom.getStyle(players[0], 'height');
YAHOO.util.Dom.setStyle(slot.id, 'height', height);

var hiddenElement = document.getElementById(slot.id + '_hidden');
if (!hiddenElement) {
continue;
Expand Down
1 change: 1 addition & 0 deletions question/type/ddwtos/styles.css
Expand Up @@ -31,6 +31,7 @@
}
.que.ddwtos .player.placed { /* Lets the focus rectangle be visible in IE. */
background: transparent;
border: 0;
}

.que.ddwtos .readonly {
Expand Down

0 comments on commit 287273c

Please sign in to comment.