From de420de02125ae7e0a1431d36433c2054ff4a8b6 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 6 Jul 2017 10:40:21 +0200 Subject: [PATCH] Fix the folder's path in the search results page --- www/drive/file.less | 5 +++++ www/drive/main.js | 17 ++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/www/drive/file.less b/www/drive/file.less index 9bb4eccf4..c9e36e7b2 100644 --- a/www/drive/file.less +++ b/www/drive/file.less @@ -416,6 +416,11 @@ span { } .path { font-style: italic; + direction: rtl; + .element { + display: inline-block; + margin-right: 5px; + } } .title { font-weight: bold; diff --git a/www/drive/main.js b/www/drive/main.js index d31c701a6..050e9ab8d 100644 --- a/www/drive/main.js +++ b/www/drive/main.js @@ -1250,12 +1250,11 @@ define([ }; // Create the title block with the "parent folder" button - var createTitle = function (path, noStyle) { + var createTitle = function ($container, path, noStyle) { if (!path || path.length === 0) { return; } var isTrash = filesOp.isPathIn(path, [TRASH]); - var $title = $driveToolbar.find('.path'); - if (APP.mobile()) { - return $title; + if (APP.mobile() && !noStyle) { // noStyle means title in search result + return $container; } var el = path[0] === SEARCH ? undefined : filesOp.find(path); path = path[0] === SEARCH ? path.slice(0,1) : path; @@ -1281,12 +1280,11 @@ define([ if (idx === 0) { name = getPrettyName(p); } else { var $span2 = $('', {'class': 'element separator'}).text(' / '); - $title.prepend($span2); + $container.prepend($span2); } - $span.text(name).prependTo($title); + $span.text(name).prependTo($container); }); - return $title; }; var createInfoBox = function (path) { @@ -1764,7 +1762,8 @@ define([ path.pop(); path.push(r.data.title); } - var $path = $('', {'class': 'col1 path'}).html(createTitle(path, true).html()); + var $path = $('', {'class': 'col1 path'}); + createTitle($path, path, true); var parentPath = path.slice(); var $a; if (parentPath) { @@ -1859,7 +1858,7 @@ define([ // NewButton can be undefined if we're in read only mode createNewButton(isInRoot, $toolbar.find('.leftside')); - createTitle(path).appendTo($toolbar.find('.path')); + createTitle($toolbar.find('.path'), path); if (APP.mobile()) { var $context = $('