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

fix #5686 - [preview image] Some display issues for image info in preview image. #5877

Merged
merged 5 commits into from
Nov 8, 2013

Conversation

couzteau
Copy link
Member

@couzteau couzteau commented Nov 6, 2013

The following changes address #1 of bug #5686: When resizing the width of the window smaller, the top two lines of text will wrap. I don't think we should wrap these two lines of image info, just let them being clipped if they don't fit inside the window width.

This pull requests makes the following changes

  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. 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.
@@ -64,7 +64,9 @@ define(function (require, exports, module) {
currentPath = $("#img-path").text();

if (currentPath === oldRelPath) {
$("#img-path").text(ProjectManager.makeProjectRelativeIfPossible(newName));
var newRelName = ProjectManager.makeProjectRelativeIfPossible(newName);
$("#img-path").text(newRelName);
Copy link
Contributor

Choose a reason for hiding this comment

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

You need to use html and not text since file path can have some encoded characters for high-ascii and double-byte characters.

Copy link
Member Author

Choose a reason for hiding this comment

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

I can change it, but my intent was to add a tooltip. Since code was using text before I did not change it.

@RaymondLim
Copy link
Contributor

Done with initial review.

@couzteau
Copy link
Member Author

couzteau commented Nov 6, 2013

Done with changes per review feedback by @RaymondLim .

},
function (error) {
$("#img-data").html(dimensionString);
$("#img-data").html(dimensionString)
.attr("title", dimensionString).replace("×", "x");
Copy link
Contributor

Choose a reason for hiding this comment

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

You have one close paren in the wrong place. You meant to call replace for dimensionString, not chaining replace call to attr call. ie. .attr("title", dimensionString.replace("×", "x"));

Copy link
Member Author

Choose a reason for hiding this comment

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

yikes. Good catch.

Copy link
Member Author

Choose a reason for hiding this comment

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

pushed fix

@couzteau
Copy link
Member Author

couzteau commented Nov 8, 2013

Ping @RaymondLim ! Any other changes?

@RaymondLim
Copy link
Contributor

Sorry to say that I suggested the wrong thing -- changing from .text to .html. That breaks all the file path with some characters like <&. You need to use .text again.

@couzteau
Copy link
Member Author

couzteau commented Nov 8, 2013

Oh - ok.

@couzteau
Copy link
Member Author

couzteau commented Nov 8, 2013

I changed the path assignments back to use text rather than html

@couzteau
Copy link
Member Author

couzteau commented Nov 8, 2013

I'll also merge master in a sec.

Conflicts:
	src/editor/ImageViewer.js
@RaymondLim
Copy link
Contributor

Merging.

RaymondLim added a commit that referenced this pull request Nov 8, 2013
fix #5686 - [preview image] Some display issues for image info in preview image.
@RaymondLim RaymondLim merged commit e04f94f into master Nov 8, 2013
@RaymondLim RaymondLim deleted the couzteau/fix-5686 branch November 8, 2013 21:40
@couzteau couzteau restored the couzteau/fix-5686 branch November 12, 2013 17:56
@couzteau couzteau deleted the couzteau/fix-5686 branch November 15, 2013 21:53
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants