mirror of
https://github.com/grafana/grafana.git
synced 2024-11-30 04:34:23 -06:00
style(modal): use standard valid styles
This commit is contained in:
parent
6435fa6b99
commit
fa19e0d9c6
@ -76,7 +76,6 @@ export class AlertSrv {
|
||||
scope.title = payload.title;
|
||||
scope.text = payload.text;
|
||||
scope.text2 = payload.text2;
|
||||
scope.confirmText = payload.confirmText;
|
||||
scope.confirmTextRequired = payload.confirmText !== undefined && payload.confirmText !== "";
|
||||
|
||||
scope.onConfirm = function() {
|
||||
@ -87,13 +86,9 @@ export class AlertSrv {
|
||||
};
|
||||
|
||||
scope.updateConfirmText = function(value) {
|
||||
scope.confirmInput = value;
|
||||
scope.confirmTextValid = scope.confirmText === scope.confirmInput;
|
||||
scope.confirmInputStyle = scope.confirmTextValid ? "confirm-model-valid-input" : "confirm-model-invalid-input";
|
||||
scope.confirmTextValid = payload.confirmText.toLowerCase() === value.toLowerCase();
|
||||
};
|
||||
|
||||
scope.updateConfirmText("");
|
||||
|
||||
scope.icon = payload.icon || "fa-check";
|
||||
scope.yesText = payload.yesText || "Yes";
|
||||
scope.noText = payload.noText || "Cancel";
|
||||
|
@ -24,12 +24,12 @@
|
||||
|
||||
<div class="modal-content-confirm-text" ng-if="confirmTextRequired">
|
||||
<span><i class="fa fa-warning"></i> Please type in the name of the dashboard to confirm.</span>
|
||||
<input type="text" class="gf-form-input width-16 {{confirmInputStyle}}" style="display: inline-block;" ng-model="confirmInput" ng-change="updateConfirmText(confirmInput)">
|
||||
<input type="text" class="gf-form-input width-16" style="display: inline-block;" ng-model="confirmInput" ng-change="updateConfirmText(confirmInput)">
|
||||
</div>
|
||||
|
||||
<div class="confirm-modal-buttons">
|
||||
<button type="button" class="btn btn-inverse" ng-click="dismiss()">{{noText}}</button>
|
||||
<button type="button" class="btn btn-danger" ng-click="onConfirm();" ng-disabled="!confirmTextValid">{{yesText}}</button>
|
||||
<button type="button" class="btn btn-danger" ng-click="onConfirm();" ng-class="{'btn-inverse': !confirmTextValid, 'btn-primary': confirmTextValid}">{{yesText}}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -116,10 +116,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
.confirm-model-invalid-input {
|
||||
border: thin solid $input-invalid-border-color;
|
||||
}
|
||||
|
||||
.modal-content-confirm-text {
|
||||
margin-bottom: 2rem;
|
||||
span {
|
||||
|
Loading…
Reference in New Issue
Block a user