Skip to content

Commit

Permalink
small javascript fix
Browse files Browse the repository at this point in the history
  • Loading branch information
whomingbird committed Sep 18, 2024
1 parent 4afd5c3 commit 3793590
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions app/assets/javascripts/extended_metadata_type.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,17 @@ var ExtendedMetadataType = {
noticeFlashDiv.show();
},

addNewMarker: function(id, type) {
addNewMarker: function(new_id, type) {
var isNested = (type === "ExtendedMetadata");

alert(new_id)
$j("#nested-tab, #nested-tab").parent().toggleClass("active", isNested);
$j("#nested-metadata-table").toggleClass("active in", isNested);
$j("#top-level-tab, #top-level-tab").parent().toggleClass("active", !isNested);
$j("#top-level-metadata-table").toggleClass("active in", !isNested);

var table = isNested ? $j("#nested-metadata-table") : $j("#top-level-metadata-table");
table.find("tbody tr:first td:first").append(' <sup style="color:red; font-weight:bold; font-size: 12px">new</sup>');
table.find("tbody td#" + new_id).append(' <sup style="color:red; font-weight:bold; font-size: 12px">new</sup>');
},

initializeNoticeFlash: function() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

%>
<tr class="<%= row_cls %>">
<td><%= link_to extended_metadata_type.id, extended_metadata_type_path(extended_metadata_type, format: :json) %></td>
<td id="<%= extended_metadata_type.id %>"><%= link_to extended_metadata_type.id, extended_metadata_type_path(extended_metadata_type, format: :json) %></td>
<td><%= extended_metadata_type.title %></td>
<td><%= extended_metadata_type.supported_type %></td>
<td><%= extended_metadata_type.extended_metadatas.count %></td>
Expand Down

0 comments on commit 3793590

Please sign in to comment.