Skip to content

Commit

Permalink
Fix missing remove icons
Browse files Browse the repository at this point in the history
- these icons appear on the edit a page page and should be on the left of things that can be added or removed from a page
- can't be fixed by the previous change as this isn't a glyphicon, for some reason, is part of a dependency so can't directly modify the now not-compiling-in-dart-sass image page
- easiest thing is to switch to a glyphicon instead
- adding some custom styles to position it properly, have to make it this specific as there's an override to float all glyphicons in this element to the right, where there's already an icon
- also adding a JS class for the JavaScript hook
  • Loading branch information
andysellick committed Aug 9, 2024
1 parent dd7ee28 commit 74b2ea6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/assets/javascripts/views/related-content-tagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
var $templateTag = $fieldset.find('.related-item-template > li').first()
var $fieldErrors = $fieldset.find('.related-item-error-message')

$fieldset.on('click', '.select2-search-choice-close', removeItem)
$fieldset.on('click', '.js-remove-related', removeItem)
$basePathInput.on('keypress', lookUpBasePathOnEnterPress)
$lookupButton.on('click', lookUpBasePath)

Expand Down
15 changes: 15 additions & 0 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -92,3 +92,18 @@
src: url("bootstrap/glyphicons-halflings-regular.eot");
src: url("bootstrap/glyphicons-halflings-regular.eot?#iefix") format("embedded-opentype"),url("bootstrap/glyphicons-halflings-regular.woff2") format("woff2"),url("bootstrap/glyphicons-halflings-regular.woff") format("woff"),url("bootstrap/glyphicons-halflings-regular.ttf") format("truetype"),url("bootstrap/glyphicons-halflings-regular.svg#glyphicons_halflingsregular") format("svg")
}

.sortable-list .glyphicon.remove-icon {
float: left;
margin-left: -20px;
margin-right: 10px;
}

// overrides for select2 as it doesn't compile properly in dart-sass, uses image-url
.select2-container .select2-choice .select2-arrow {
background: url("select2.png") no-repeat 0 1px;
}

.select2-search-choice-close {
background: url("select2.png") right top no-repeat;
}
2 changes: 1 addition & 1 deletion app/views/taggings/_tagging_entry.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<%= tagging_update.title_for_related_link(base_path) %> (<%= base_path %>)
</a>
<a href="#" class="select2-search-choice-close" tabindex="-1"></a>
<a href="#" class="js-remove-related glyphicon glyphicon-remove remove-icon" tabindex="-1" title="Remove <%= base_path %>"></a>
<span class="glyphicon glyphicon-resize-vertical" aria-hidden="true"></span>
Expand Down

0 comments on commit 74b2ea6

Please sign in to comment.