From 72bc2d7271a9aebcdb0e87b4997dbeb5bb71037c Mon Sep 17 00:00:00 2001
From: Jared Hancock <jared@osticket.com>
Date: Thu, 2 Oct 2014 16:17:56 -0500
Subject: [PATCH] i18n: rtl: Fixup filedrop for rtl display

---
 css/filedrop.css     | 16 ++++++++++++++--
 css/rtl.css          |  8 +++++++-
 js/filedrop.field.js |  4 ++--
 3 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/css/filedrop.css b/css/filedrop.css
index fc2b96d91..96dca339e 100644
--- a/css/filedrop.css
+++ b/css/filedrop.css
@@ -26,15 +26,19 @@
     margin: 0;
     border-radius: 5px;
 }
+.rtl .filedrop .files .file {
+    padding-left: 10px;
+    padding-right: 20px;
+}
 .filedrop .files .file:hover {
    background-color: rgba(0, 0, 0, 0.05);
 }
 .filedrop .files .file .filesize {
-  margin-left: 1em;
+  margin: 0 1em;
   color: #999;
 }
 .filedrop .files .file .upload-rate {
-  margin-right: 10px;
+  margin: 0 10px;
   color: #aaa;
 }
 .filedrop .files .file .trash {
@@ -55,6 +59,11 @@
   float: left;
   padding-right: 10px;
 }
+.rtl .filedrop .preview {
+  padding-right: initial;
+  padding-left: 10px;
+  float: right;
+}
 .redactor_box + .filedrop .dropzone,
 .redactor_box + div > .filedrop .dropzone,
 .redactor_box + div > .filedrop .files {
@@ -113,6 +122,9 @@
   -webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
           box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .15);
 }
+.rtl .progress-bar {
+  float: right;
+}
 .progress-bar:not(.active) {
   -webkit-transition: width .6s ease;
        -o-transition: width .6s ease;
diff --git a/css/rtl.css b/css/rtl.css
index 4b470981e..0c4504d52 100644
--- a/css/rtl.css
+++ b/css/rtl.css
@@ -110,4 +110,10 @@
 .rtl .action-dropdown ul {
     text-align: right;
 }
-  text-align: left;
+.rtl .file {
+    padding-left: initial;
+    padding-right: 20px;
+    margin-right: initial;
+    margin-left: 20px;
+    background: url(../scp/images/icons/file.gif) 100% 50% no-repeat;
+}
diff --git a/js/filedrop.field.js b/js/filedrop.field.js
index 8b53508c1..d07a2a675 100644
--- a/js/filedrop.field.js
+++ b/js/filedrop.field.js
@@ -153,7 +153,7 @@
       filenode
           .append($('<div class="filetype"></div>').addClass())
           .append($('<img class="preview" />'))
-          .append($('<div class="filename"></div>')
+          .append($('<span class="filename ltr"></div>')
             .append($('<span class="filesize"></span>').text(
               this.fileSize(parseInt(file.size))
             ))
@@ -186,7 +186,7 @@
             .attr('href', 'file.php?h='+escape(file.download))
         );
       else
-        filenode.find('.filename').prepend(document.createTextNode(file.name));
+        filenode.find('.filename').prepend($('<span>').text(file.name));
       this.$element.parent().find('.files').append(filenode);
       this.uploads.push(filenode);
       return filenode;
-- 
GitLab