Browse Source

Improve help popup button to work in disabled fieldsets

pull/5432/head
Igor Kulikov 5 years ago
parent
commit
fabfcc9096
  1. 55
      ui-ngx/src/app/shared/components/help-popup.component.html
  2. 7
      ui-ngx/src/app/shared/components/help-popup.component.scss

55
ui-ngx/src/app/shared/components/help-popup.component.html

@ -15,28 +15,33 @@
limitations under the License.
-->
<button #toggleHelpButton
*ngIf="!textMode"
mat-icon-button
color="primary"
class="tb-help-popup-button tb-mat-32"
type="button"
(click)="toggleHelp()"
matTooltip="{{'help.show-help' | translate}}"
matTooltipPosition="above">
<mat-icon class="material-icons">{{popoverVisible ? 'help' : 'help_outline'}}</mat-icon>
<mat-spinner *ngIf="popoverVisible && !popoverReady" class="tb-help-popup-button-loading" mode="indeterminate" diameter="20" strokeWidth="2"></mat-spinner>
</button>
<button #toggleHelpTextButton
*ngIf="textMode"
mat-button
color="primary"
class="tb-help-popup-text-button"
[ngClass]="{'mat-stroked-button': popoverVisible && popoverReady}"
(click)="toggleHelp()">
<ng-container *ngIf="triggerSafeHtml">
<span [style]="triggerStyle" [innerHTML]="triggerSafeHtml"></span>
</ng-container>
<mat-icon *ngIf="!popoverVisible || popoverReady" class="tb-mat-16">open_in_new</mat-icon>
<mat-spinner *ngIf="popoverVisible && !popoverReady" mode="indeterminate" diameter="16" strokeWidth="2"></mat-spinner>
</button>
<fieldset class="tb-help-popup-button-container">
<div #toggleHelpButton
[fxShow]="!textMode"
matTooltip="{{'help.show-help' | translate}}"
matTooltipPosition="above"
style="border-radius: 50%"
(click)="toggleHelp()">
<button mat-icon-button
color="primary"
class="tb-help-popup-button tb-mat-32"
type="button">
<mat-icon class="material-icons">{{popoverVisible ? 'help' : 'help_outline'}}</mat-icon>
<mat-spinner *ngIf="popoverVisible && !popoverReady" class="tb-help-popup-button-loading" mode="indeterminate" diameter="20" strokeWidth="2"></mat-spinner>
</button>
</div>
<div #toggleHelpTextButton
[fxShow]="textMode"
(click)="toggleHelp()">
<button mat-button
color="primary"
class="tb-help-popup-text-button"
[ngClass]="{'mat-stroked-button': popoverVisible && popoverReady}">
<ng-container *ngIf="triggerSafeHtml">
<span [style]="triggerStyle" [innerHTML]="triggerSafeHtml"></span>
</ng-container>
<mat-icon *ngIf="!popoverVisible || popoverReady" class="tb-mat-16">open_in_new</mat-icon>
<mat-spinner *ngIf="popoverVisible && !popoverReady" mode="indeterminate" diameter="16" strokeWidth="2"></mat-spinner>
</button>
</div>
</fieldset>

7
ui-ngx/src/app/shared/components/help-popup.component.scss

@ -13,6 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
.tb-help-popup-button-container {
width: initial;
display: inline-block;
vertical-align: middle;
}
.tb-help-popup-button {
position: relative;
.mat-progress-spinner {

Loading…
Cancel
Save