mirror of
https://github.com/grafana/grafana.git
synced 2025-02-14 09:33:34 -06:00
fix: dashboard save modals had double submit on enter after my refactoring this morning
This commit is contained in:
parent
82d4d54dc5
commit
f18ebea03e
@ -142,7 +142,6 @@ func GetDashboard(query *m.GetDashboardQuery) error {
|
||||
|
||||
dashboard.Data.Set("id", dashboard.Id)
|
||||
query.Result = &dashboard
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
@ -15,19 +15,19 @@ const template = `
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="modal-content">
|
||||
<form name="ctrl.saveForm" ng-submit="ctrl.save()" class="modal-content" novalidate>
|
||||
<div class="p-t-2">
|
||||
<div class="gf-form">
|
||||
<label class="gf-form-label">New name</label>
|
||||
<input type="text" class="gf-form-input" ng-model="ctrl.clone.title" give-focus="true" ng-keydown="ctrl.keyDown($event)">
|
||||
<input type="text" class="gf-form-input" ng-model="ctrl.clone.title" give-focus="true" required>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="gf-form-button-row text-center">
|
||||
<a class="btn btn-success" ng-click="ctrl.save();">Save</a>
|
||||
<button type="submit" class="btn btn-success" ng-disabled="ctrl.saveForm.$invalid">Save</button>
|
||||
<a class="btn-text" ng-click="ctrl.dismiss();">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
`;
|
||||
|
||||
|
@ -29,7 +29,6 @@ const template = `
|
||||
ng-model="ctrl.message"
|
||||
ng-model-options="{allowInvalid: true}"
|
||||
ng-maxlength="this.max"
|
||||
ng-keydown="ctrl.keyDown($event)"
|
||||
autocomplete="off"
|
||||
required />
|
||||
<small class="gf-form-hint-text muted" ng-cloak>
|
||||
@ -73,12 +72,6 @@ export class SaveDashboardModalCtrl {
|
||||
|
||||
return this.dashboardSrv.save(saveModel, options).then(this.dismiss);
|
||||
}
|
||||
|
||||
keyDown(evt) {
|
||||
if (evt.keyCode === 13) {
|
||||
this.save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function saveDashboardModalDirective() {
|
||||
|
Loading…
Reference in New Issue
Block a user