diff options
author | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-13 10:14:18 +0000 |
---|---|---|
committer | Gábor Hojtsy <gabor@hojtsy.hu> | 2007-12-13 10:14:18 +0000 |
commit | b0007cdd0925e8ce8e805414e1a132fd828ef1b9 (patch) | |
tree | fbb0724837e8466df5faa6ce7c3f52086112dcda | |
parent | c6d841c0963ff151232c2ae23b997a5b36c680eb (diff) | |
download | brdo-b0007cdd0925e8ce8e805414e1a132fd828ef1b9.tar.gz brdo-b0007cdd0925e8ce8e805414e1a132fd828ef1b9.tar.bz2 |
#197641 by quicksketch and myself: fix drag and drop RTL issues (connector line facing and drag directions)
-rw-r--r-- | misc/tabledrag.js | 9 | ||||
-rw-r--r-- | modules/system/system-rtl.css | 3 | ||||
-rw-r--r-- | modules/system/system.css | 4 |
3 files changed, 10 insertions, 6 deletions
diff --git a/misc/tabledrag.js b/misc/tabledrag.js index 0a6041c43..295dd820a 100644 --- a/misc/tabledrag.js +++ b/misc/tabledrag.js @@ -47,6 +47,7 @@ Drupal.tableDrag = function(table, tableSettings) { this.oldY = 0; // Used to determine up or down direction from last mouse move. this.changed = false; // Whether anything in the entire table has changed. this.maxDepth = 0; // Maximum amount of allowed parenting. + this.rtl = $('body').css('direction') == 'rtl' ? -1 : 1; // Direction of the page language. // Configure the scroll settings. this.scrollSettings = { amount: 4, interval: 50, trigger: 70 }; @@ -255,7 +256,7 @@ Drupal.tableDrag.prototype.makeDraggable = function(item) { case 37: // Left arrow. case 63234: // Safari left arrow. keyChange = true; - self.rowObject.indent(-1); + self.rowObject.indent(-1 * self.rtl); break; case 38: // Up arrow. case 63232: // Safari up arrow. @@ -282,7 +283,7 @@ Drupal.tableDrag.prototype.makeDraggable = function(item) { case 39: // Right arrow. case 63235: // Safari right arrow. keyChange = true; - self.rowObject.indent(1); + self.rowObject.indent(1 * self.rtl); break; case 40: // Down arrow. case 63233: // Safari down arrow. @@ -379,7 +380,7 @@ Drupal.tableDrag.prototype.dragRow = function(event, self) { self.oldX = x; var xDiff = self.currentMouseCoords.x - self.dragObject.indentMousePos.x; // Set the number of indentations the mouse has been moved left or right. - var indentDiff = parseInt(xDiff / self.indentAmount); + var indentDiff = parseInt(xDiff / self.indentAmount * self.rtl); // Limit the indentation to no less than the left edge of the table and no // more than the total amount of indentation in the table. indentDiff = indentDiff > 0 ? Math.min(indentDiff, self.indentCount - self.rowObject.indents + 1) : Math.max(indentDiff, -self.rowObject.indents); @@ -389,7 +390,7 @@ Drupal.tableDrag.prototype.dragRow = function(event, self) { var indentChange = self.rowObject.indent(indentDiff); // Update table and mouse indentations. - self.dragObject.indentMousePos.x += self.indentAmount * indentChange; + self.dragObject.indentMousePos.x += self.indentAmount * indentChange * self.rtl; self.indentCount = Math.max(self.indentCount, self.rowObject.indents); } } diff --git a/modules/system/system-rtl.css b/modules/system/system-rtl.css index 6a523f47f..baa14e8a6 100644 --- a/modules/system/system-rtl.css +++ b/modules/system/system-rtl.css @@ -102,3 +102,6 @@ div.indentation { padding: 0.42em 0.6em 0.42em 0; float: right; } +div.tree-child, div.tree-child-last { + background-position: -65px center; +} diff --git a/modules/system/system.css b/modules/system/system.css index 564f6f797..30e17aff7 100644 --- a/modules/system/system.css +++ b/modules/system/system.css @@ -52,10 +52,10 @@ div.indentation { float: left; /* LTR */ } div.tree-child { - background: url(../../misc/tree.png) no-repeat 11px center; + background: url(../../misc/tree.png) no-repeat 11px center; /* LTR */ } div.tree-child-last { - background: url(../../misc/tree-bottom.png) no-repeat 11px center; + background: url(../../misc/tree-bottom.png) no-repeat 11px center; /* LTR */ } div.tree-child-horizontal { background: url(../../misc/tree.png) no-repeat -11px center; |