Skip to content

Commit

Permalink
Position drop fix
Browse files Browse the repository at this point in the history
The variable that was finding the element for the new position was actually finding the new position for every rack on the screen and it was defaulting to the first rack on the screen's position.  Changed the selector to find the correct one. close opendcim#710
  • Loading branch information
wilpig committed Jan 14, 2016
1 parent 64dc54b commit b35cad5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ function initdrag(){
// U above device + height of device in U + X rows for the header
var diff=Math.round(ui.position.top/21) + Math.ceil(this.offsetHeight/21) + getElementIndex(topu[0]);
var newposition=parseInt($(this.parentElement.parentElement.parentElement.parentElement).find('tr:nth-child('+diff+') td:first-child').text());
var newu=$('tr#pos' + newposition);
var newu=topu.parents('.cabinet').find('tr#pos' + newposition);
var device=this;
device.style.left=ui.position.left+'px';
device.style.top=ui.position.top+'px';
Expand Down

0 comments on commit b35cad5

Please sign in to comment.