Skip to content

Commit

Permalink
Issue #3573: Fix draggable nested items in RTL being dragged in the o…
Browse files Browse the repository at this point in the history
…pposite direction.

By @klonos and @herbdool.
  • Loading branch information
klonos authored and quicksketch committed Apr 9, 2019
1 parent 0ee36a3 commit ca24f47
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/misc/tabledrag.js
Expand Up @@ -546,12 +546,12 @@ Backdrop.tableDrag.prototype.dragRow = function (event, self) {
if (self.indentEnabled) {
var xDiff = self.currentPointerCoords.x - self.dragObject.indentPointerPos.x;
// Set the number of indentations the pointer has been moved left or right.
var indentDiff = Math.round(xDiff / self.indentAmount * self.rtl);
var indentDiff = Math.round(xDiff / self.indentAmount);
// Indent the row with our estimated diff, which may be further
// restricted according to the rows around this row.
var indentChange = self.rowObject.indent(indentDiff);
// Update table and pointer indentations.
self.dragObject.indentPointerPos.x += self.indentAmount * indentChange * self.rtl;
self.dragObject.indentPointerPos.x += self.indentAmount * indentChange;
self.indentCount = Math.max(self.indentCount, self.rowObject.indents);
}

Expand Down

1 comment on commit ca24f47

@backdrop-ci
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.