Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Commit

Permalink
Format index meter when loaded from AJAX call
Browse files Browse the repository at this point in the history
Fixes #1086
  • Loading branch information
Edmundo Alvarez committed Jan 27, 2015
1 parent 2b5a6cc commit 3ca15af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions app/assets/javascripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,11 @@ $(document).ready(function() {
$.get(appPrefixed("/a/system/indices/index_info/" + index + "/partial"), function(data) {
var holderElem = $(".index-info-holder", linkElem.closest(".index-description"));
holderElem.html(data);
// Format numbers that were just loaded into the html document
$(".number-format", holderElem).each(function() {
$(this).text(numeral($(this).text()).format($(this).attr("data-format")));
});

holderElem.toggle();

var icon = linkElem.children().first();
Expand Down
2 changes: 1 addition & 1 deletion app/views/system/indices/index.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ <h3>
}
} else {
Contains messages up to @DateHelper.readablePeriodFromNow(index.getRange.getStarts)
@if(index.getName.equals(deflectorTarget) && index.getInfo != null) {
@if(index.getName.equals(deflectorTarget) && index.getInfo != null) {
(@Tools.byteToHuman(index.getInfo.getStoreSizeBytes) /
<span class="number-format" data-format="0,0">@index.getInfo.getDocuments.count</span> messages)
}
Expand Down

0 comments on commit 3ca15af

Please sign in to comment.