-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xywh width height button #193
Conversation
… between width and height
…utton Conflicts: omero_figure/static/figure/figure.js omero_figure/static/figure/templates.js
Looks good and is working well.
Actually it would also be nicer to add the other styles 'color: green' etc to the css .aspect_ratio_selected class instead of in-line styles. Also, as mentioned before, you need to use |
You need to remove the compiled figure.js and templates.js files. I thought the 'merge' had removed them but it seems not. |
src/js/views/right_panel_view.js
Outdated
}, 50); | ||
// keep locked status of the aspect ratio button the same, | ||
// when the focus shifts because of a blur event | ||
if (aspectRatioStatus === true) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't need === true
here. Just if (aspectRatioStatus)
src/js/views/right_panel_view.js
Outdated
} | ||
if (!$(".set_aspect_ratio", this.$el).hasClass("active")) { | ||
$(".aspect_ratio_selected", this.$el).removeClass("glyphicon-ok-sign"); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you style the . aspect_ratio_selected
to only be visible when the parent is .active
(see other comment) then you can get rid of all this extra logic.
</div> | ||
<div class="form-group" style="margin-bottom: -15px;"> | ||
</div> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only diff here is adding whitespace. Would be nice to clean that up (as you mentioned).
@will-moore I have pushed two commits. Please check and let me know if it looks fine. |
@bramalingam If I check the 'link', change the Width then move focus away (E.g. click on X input) then the panel is re-rendered, the 'link' button is maintained as '.active' but we've lost the green check. Also, as mentioned before (twice), you need to use m.save(newValues) instead of m.set(newValues) to enable the figure "Save" button. |
@bramalingam: ready for review? |
Yes it is, guess @will-moore has already reviewed the changes but yeah I can re-list on for review tomorrow. |
@will-moore could you check the last commits? |
<span class="glyphicon glyphicon-ok-sign aspect_ratio_selected" style="left:187px; top:-51px; font-size:10px; color:green"></span> | ||
</button> | ||
<button type="button" class="btn btn-link setAspectRatio" | ||
style="position:absolute; left:195px; top:25px; padding:3px; width:23px; height:24px; outline:none !important";title="Maintain aspect ratio"><span class="glyphicon glyphicon-link"></span><span class="glyphicon glyphicon-ok-sign okSign" style="left:-28px; top:-7px; font-size:10px; color:green"></span></button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The button tooltip isn't working because you've got ;title
there (remove the ;)
Working nicely now - Just a tiny typo fix for |
@will-moore happy now with the last commit |
Yes, looks good now thanks. |
This PR adds an extra button to control the aspect ratio of the panels, when the user edits the width/height of the image.
To Test:
Test if toggling the glyphicon-link button changes status of glyphicon-ok-sign to show/hide.
When the glyphicon-ok-sign is hidden, edit width or height of the image. This will just change the width or height of the image (alone).
When the glyphicon-ok-sign is shown, edit width or height of the image. Please check the width/height ratio (aspect ratio) of the panel before editing. Post editing the aspect ratio should be maintained.
Check if the tooltip on the button makes sense.
And as always code review would be useful as well.
The branch includes the code-layout branch as well, and the PR could technically be considered as an independent review of the code-layout PR(#178) from @will-moore
@will-moore @jburel @aleksandra-tarkowska
Conversation trace from closed PR: #187