Skip to content

Commit

Permalink
Fix incorrect dropdown menu location for the archive button (lobsters…
Browse files Browse the repository at this point in the history
  • Loading branch information
GetToSet authored Aug 24, 2022
1 parent 3e74f10 commit 7a69fb8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
9 changes: 1 addition & 8 deletions app/assets/javascripts/application.js.erb
Original file line number Diff line number Diff line change
Expand Up @@ -155,13 +155,7 @@ class _LobstersFunction {

const flaggingDropDown = document.createElement('div');
flaggingDropDown.setAttribute('id', 'flag_dropdown');
const flagWrapper = document.createElement('span');
flagWrapper.setAttribute('id', 'flag_wrapper')
flagWrapper.style.position = 'relative';
flagWrapper.style.maxWidth = '1 px';
flagWrapper.style.maxHeight = '1 px';
flagWrapper.appendChild(flaggingDropDown);
voterEl.after(flagWrapper);
voterEl.after(flaggingDropDown);

Object.keys(reasons).map(function(k, v) {
let a = document.createElement('a')
Expand Down Expand Up @@ -258,7 +252,6 @@ class _LobstersFunction {
removeFlagModal() {
document.getElementById("flag_dropdown").remove();
document.getElementById("modal_backdrop").remove();
document.querySelector('#flag_wrapper').remove();
}

postComment(form) {
Expand Down
5 changes: 4 additions & 1 deletion app/assets/stylesheets/application.css.erb
Original file line number Diff line number Diff line change
Expand Up @@ -1016,10 +1016,13 @@ div.comment_text code {
line-height: 1.2em;
}

.dropdown_parent {
position: relative;
}

#flag_dropdown, .archive-dropdown {
position: absolute;
left: -1.5rem;
left: -0.125rem;
width: 100px;
border: 1px solid var(--color-box-border);
border-bottom: 0;
Expand Down
7 changes: 5 additions & 2 deletions app/views/stories/_listdetail.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,10 @@ class="story <%= story.vote && story.vote[:vote] == 1 ? "upvoted" : "" %>
| <a class="flagger">unflag (<%=
Vote::STORY_REASONS[story.vote[:reason]].to_s.downcase %>)</a>
<% elsif @user && @user.can_flag?(story) %>
| <a class="flagger">flag</a>
|
<span class="dropdown_parent">
<a class="flagger">flag</a>
</span>
<% end %>
<% if story.is_hidden_by_cur_user %>
| <%= link_to "unhide", story_unhide_path(story.short_id),
Expand All @@ -154,7 +157,7 @@ class="story <%= story.vote && story.vote[:vote] == 1 ? "upvoted" : "" %>
<% end %>
<% if story.url.present? %>
|
<span>
<span class="dropdown_parent">
<input id="archive_<%= story.short_id %>" class="archive_button" type="checkbox">
<label for="archive_<%= story.short_id %>">archive</label>
<label for="archive_<%= story.short_id %>" class="archive_dismiss"></label>
Expand Down

0 comments on commit 7a69fb8

Please sign in to comment.