1
0
Fork 0
forked from lthn/blockchain

tr details tooltip

This commit is contained in:
wildkif 2019-02-22 11:18:50 +02:00
parent 35720b2d42
commit a4076d8d64
9 changed files with 31 additions and 18 deletions

View file

@ -310,6 +310,7 @@ input[type='checkbox'].style-checkbox {
.table-tooltip {
font-size: 1.3rem;
padding: 1rem 2rem;
white-space: pre-wrap;
@include themify($themes) {
background: themed(tooltipBackgroundColor);

View file

@ -353,16 +353,19 @@ var TooltipDirective = /** @class */ (function () {
this.el = el;
this.renderer = renderer;
this.route = route;
this.cursor = 'pointer';
this.timeout = 0;
this.delay = 0;
this.showWhenNoOverflow = true;
}
TooltipDirective.prototype.onMouseEnter = function () {
if (!this.tooltip) {
this.show();
}
else {
this.cancelHide();
if (this.showWhenNoOverflow || (!this.showWhenNoOverflow && this.el.nativeElement.offsetWidth < this.el.nativeElement.scrollWidth)) {
this.cursor = 'pointer';
if (!this.tooltip) {
this.show();
}
else {
this.cancelHide();
}
}
};
TooltipDirective.prototype.onMouseLeave = function () {
@ -491,6 +494,10 @@ var TooltipDirective = /** @class */ (function () {
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
__metadata("design:type", Object)
], TooltipDirective.prototype, "delay", void 0);
__decorate([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
__metadata("design:type", Object)
], TooltipDirective.prototype, "showWhenNoOverflow", void 0);
__decorate([
Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["HostListener"])('mouseenter'),
__metadata("design:type", Function),
@ -523,7 +530,7 @@ var TooltipDirective = /** @class */ (function () {
/*! no static exports found */
/***/ (function(module, exports) {
module.exports = "<div class=\"table\">\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[0] + 'px'\">{{ 'HISTORY.DETAILS.ID' | translate }}</span>\r\n <span class=\"cell key-value\" [style.flex-basis]=\"sizes[1] + 'px'\" (contextmenu)=\"variablesService.onContextMenuOnlyCopy($event, transaction.tx_hash)\" (click)=\"openInBrowser(transaction.tx_hash)\">{{transaction.tx_hash}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[2] + 'px'\">{{ 'HISTORY.DETAILS.SIZE' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[3] + 'px'\">{{ 'HISTORY.DETAILS.SIZE_VALUE' | translate : {value: transaction.tx_blob_size} }}</span>\r\n </div>\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[0] + 'px'\">{{ 'HISTORY.DETAILS.HEIGHT' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[1] + 'px'\">{{transaction.height}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[2] + 'px'\">{{ 'HISTORY.DETAILS.CONFIRMATION' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[3] + 'px'\">{{transaction.height === 0 ? 0 : variablesService.height_app - transaction.height}}</span>\r\n </div>\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[0] + 'px'\">{{ 'HISTORY.DETAILS.INPUTS' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[1] + 'px'\">{{inputs.join(', ')}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[2] + 'px'\">{{ 'HISTORY.DETAILS.OUTPUTS' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[3] + 'px'\">{{outputs.join(', ')}}</span>\r\n </div>\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[0] + 'px'\">{{ 'HISTORY.DETAILS.COMMENT' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[1] + sizes[2] + sizes[3] + 'px'\">{{transaction.comment}}</span>\r\n </div>\r\n</div>\r\n"
module.exports = "<div class=\"table\">\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[0] + 'px'\">{{ 'HISTORY.DETAILS.ID' | translate }}</span>\r\n <span class=\"cell key-value\" [style.flex-basis]=\"sizes[1] + 'px'\" (contextmenu)=\"variablesService.onContextMenuOnlyCopy($event, transaction.tx_hash)\" (click)=\"openInBrowser(transaction.tx_hash)\">{{transaction.tx_hash}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[2] + 'px'\">{{ 'HISTORY.DETAILS.SIZE' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[3] + 'px'\">{{ 'HISTORY.DETAILS.SIZE_VALUE' | translate : {value: transaction.tx_blob_size} }}</span>\r\n </div>\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[0] + 'px'\">{{ 'HISTORY.DETAILS.HEIGHT' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[1] + 'px'\">{{transaction.height}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[2] + 'px'\">{{ 'HISTORY.DETAILS.CONFIRMATION' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[3] + 'px'\">{{transaction.height === 0 ? 0 : variablesService.height_app - transaction.height}}</span>\r\n </div>\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[0] + 'px'\">{{ 'HISTORY.DETAILS.INPUTS' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[1] + 'px'\" tooltip=\"{{inputs.join('\\n')}}\" placement=\"top\" tooltipClass=\"table-tooltip\" [delay]=\"500\" [showWhenNoOverflow]=\"false\">{{inputs.join(', ')}}</span>\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[2] + 'px'\">{{ 'HISTORY.DETAILS.OUTPUTS' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[3] + 'px'\" tooltip=\"{{outputs.join('\\n')}}\" placement=\"top\" tooltipClass=\"table-tooltip\" [delay]=\"500\" [showWhenNoOverflow]=\"false\">{{outputs.join(', ')}}</span>\r\n </div>\r\n <div class=\"row\">\r\n <span class=\"cell label\" [style.flex-basis]=\"sizes[0] + 'px'\">{{ 'HISTORY.DETAILS.COMMENT' | translate }}</span>\r\n <span class=\"cell value\" [style.flex-basis]=\"sizes[1] + sizes[2] + sizes[3] + 'px'\">{{transaction.comment}}</span>\r\n </div>\r\n</div>\r\n"
/***/ }),

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -7,13 +7,14 @@ import {ActivatedRoute} from '@angular/router';
export class TooltipDirective implements OnDestroy {
@HostBinding('style.cursor') cursor = 'pointer';
@HostBinding('style.cursor') cursor;
@Input('tooltip') tooltipInner: any;
@Input() placement: string;
@Input() tooltipClass: string;
@Input() timeout = 0;
@Input() delay = 0;
@Input() showWhenNoOverflow = true;
tooltip: HTMLElement;
removeTooltipTimeout;
@ -23,10 +24,13 @@ export class TooltipDirective implements OnDestroy {
}
@HostListener('mouseenter') onMouseEnter() {
if (!this.tooltip) {
this.show();
} else {
this.cancelHide();
if (this.showWhenNoOverflow || (!this.showWhenNoOverflow && this.el.nativeElement.offsetWidth < this.el.nativeElement.scrollWidth)) {
this.cursor = 'pointer';
if (!this.tooltip) {
this.show();
} else {
this.cancelHide();
}
}
}

View file

@ -13,9 +13,9 @@
</div>
<div class="row">
<span class="cell label" [style.flex-basis]="sizes[0] + 'px'">{{ 'HISTORY.DETAILS.INPUTS' | translate }}</span>
<span class="cell value" [style.flex-basis]="sizes[1] + 'px'">{{inputs.join(', ')}}</span>
<span class="cell value" [style.flex-basis]="sizes[1] + 'px'" tooltip="{{inputs.join('\n')}}" placement="top" tooltipClass="table-tooltip" [delay]="500" [showWhenNoOverflow]="false">{{inputs.join(', ')}}</span>
<span class="cell label" [style.flex-basis]="sizes[2] + 'px'">{{ 'HISTORY.DETAILS.OUTPUTS' | translate }}</span>
<span class="cell value" [style.flex-basis]="sizes[3] + 'px'">{{outputs.join(', ')}}</span>
<span class="cell value" [style.flex-basis]="sizes[3] + 'px'" tooltip="{{outputs.join('\n')}}" placement="top" tooltipClass="table-tooltip" [delay]="500" [showWhenNoOverflow]="false">{{outputs.join(', ')}}</span>
</div>
<div class="row">
<span class="cell label" [style.flex-basis]="sizes[0] + 'px'">{{ 'HISTORY.DETAILS.COMMENT' | translate }}</span>

View file

@ -16,7 +16,7 @@ export class TransactionDetailsComponent implements OnInit, OnDestroy {
inputs: Array<string> = [];
outputs: Array<string> = [];
constructor(private variablesService: VariablesService, private backendService: BackendService, private intToMoneyPipe: IntToMoneyPipe) {}
constructor(public variablesService: VariablesService, private backendService: BackendService, private intToMoneyPipe: IntToMoneyPipe) {}
ngOnInit() {
for (const input in this.transaction.td['spn']) {

View file

@ -310,6 +310,7 @@ input[type='checkbox'].style-checkbox {
.table-tooltip {
font-size: 1.3rem;
padding: 1rem 2rem;
white-space: pre-wrap;
@include themify($themes) {
background: themed(tooltipBackgroundColor);