Allow form validation messages to be close in case the eclipse anything on the form. Fixes #2859

This commit is contained in:
Khushboo Vashi
2017-11-28 14:10:12 +00:00
committed by Dave Page
parent 9ae4a03784
commit 5bfa450a5f
5 changed files with 34 additions and 7 deletions

View File

@@ -265,10 +265,16 @@ define(
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>\
</div>\
<div class="alert-text">' + msg + '</div>\
<div class="close-error-bar">\
<a class="close-error">x</a>\
</div>\
</div>\
</div>';
if(!_.isUndefined(that.statusBar)) {
that.statusBar.html(alertMessage).css("visibility", "visible");
that.statusBar.find("a.close-error").bind("click", function(e) {
this.empty().css("visibility", "hidden");
}.bind(that.statusBar));
}
callback(true);

View File

@@ -96,6 +96,9 @@ function(_, Backbone, pgAdmin, pgBrowser) {
+ " </div>"
+ " <div class='alert-text'>"
+ " </div>"
+ " <div class='close-error-bar'>"
+ " <a class='close-error'>x</a>"
+ " </div>"
+ " </div>"
+ " </div>"
+ " </div>"
@@ -128,6 +131,7 @@ function(_, Backbone, pgAdmin, pgBrowser) {
"click button.wizard-maximize-event" : "onMaximize",
"click button.wizard-finish" : "finishWizard",
"click button.wizard-help" : "onDialogHelp",
"click a.close-error" : "closeErrorMsg",
},
initialize: function(options) {
this.options = _.extend({}, this.options, options.options);
@@ -224,6 +228,10 @@ function(_, Backbone, pgAdmin, pgBrowser) {
this.options.disable_prev = false;
}
},
closeErrorMsg: function() {
$(this.el).find('.pg-prop-status-bar .alert-text').empty();
$(this.el).find('.pg-prop-status-bar').css("visibility", "hidden");
},
beforeNext: function(){
return this.evalASFunc(this.currPage.beforeNext);
},