Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit f555d0c

Browse files
committed
The following changes address #1 of bug #5686
1. make image meta data strings not wrap 2. add ellipsis to image meta data when clipping 3. add title attribute to allow viewing the full path and meta data when text is clipped.
1 parent fec46ea commit f555d0c

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

src/editor/ImageViewer.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ define(function (require, exports, module) {
6464
currentPath = $("#img-path").text();
6565

6666
if (currentPath === oldRelPath) {
67-
$("#img-path").text(ProjectManager.makeProjectRelativeIfPossible(newName));
67+
var newRelName = ProjectManager.makeProjectRelativeIfPossible(newName);
68+
$("#img-path").text(newRelName);
69+
$("#img-path").attr("title", newRelName);
6870
}
6971
}
7072

@@ -95,6 +97,7 @@ define(function (require, exports, module) {
9597
var relPath = ProjectManager.makeProjectRelativeIfPossible(fullPath);
9698

9799
$("#img-path").text(relPath);
100+
$("#img-path").attr("title", relPath);
98101
$("#img-preview").on("load", function () {
99102
// add dimensions and size
100103
_naturalWidth = this.naturalWidth;
@@ -107,10 +110,15 @@ define(function (require, exports, module) {
107110
if (metadata && metadata.size) {
108111
sizeString = " — " + StringUtils.prettyPrintBytes(metadata.size, 2);
109112
}
110-
$("#img-data").html(dimensionString + sizeString);
113+
var dimensionAndSize = dimensionString + sizeString;
114+
$("#img-data").html(dimensionAndSize);
115+
$("#img-data").attr("title", dimensionAndSize
116+
.replace("×", "x")
117+
.replace("—", "-"));
111118
},
112119
function (error) {
113120
$("#img-data").html(dimensionString);
121+
$("#img-data").attr("title", dimensionString).replace("×", "x");
114122
}
115123
);
116124
$("#image-holder").show();

src/styles/brackets.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ a, img {
282282
#img-path {
283283
text-align: left;
284284
.user-select(text);
285+
white-space: nowrap;
286+
text-overflow: ellipsis;
287+
overflow: hidden;
285288
}
286289

287290
#img-data::selection,

0 commit comments

Comments
 (0)