Add tooltip for store deriv + show "Not set" + "show end piece of string" (#1507)

* Add tooltip for store deriv + show "Not set" + "show end piece of string"

fixes #1506

* use regex witchraft

* adjust with regex
This commit is contained in:
Andrew Camilleri 2020-04-27 12:55:46 +02:00 committed by GitHub
parent e49074d797
commit b600e5777e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 2 deletions

View file

@ -1,4 +1,5 @@
@model StoreViewModel
@using System.Text.RegularExpressions
@model StoreViewModel
@{
Layout = "../Shared/_NavLayout.cshtml";
ViewData.SetActivePageAndTitle(StoreNavPages.Index, "Profile");
@ -107,7 +108,25 @@
{
<tr class="@(@scheme.Collapsed? "collapsed": "")">
<td>@scheme.Crypto</td>
<td class="smMaxWidth text-truncate">@scheme.Value</td>
<td title="@scheme.Value" data-toggle="tooltip">
@if (string.IsNullOrEmpty(scheme.Value))
{
<span class="smMaxWidth">Not set</span>
}
else
{
<div class="d-inline-flex justify-content-between smMaxWidth">
<span class="text-truncate ">
@scheme.Value
</span>
@if (scheme.Value.Length > 20)
{
var match =Regex.Match(scheme.Value, @"((?:-\[(?:[^\]])+\])+|\S{6})$");
@match.Value;
}
</div>
}
</td>
<td style="text-align:center;">
@if(scheme.Enabled)
{

View file

@ -49,6 +49,8 @@
});
});
$('[data-toggle="tooltip"]').tooltip();
function handleInputGroupClearButtonDisplay(element) {
var inputs = $(element).parents(".input-group").find("input");