Skip to content

Commit

Permalink
Merge pull request #895 from ddurnev/master
Browse files Browse the repository at this point in the history
[RJA-2014][fix]: Validation error message placement fixed … 	27a6e64
  • Loading branch information
rsvato committed Mar 21, 2013
2 parents d2592fd + 27a6e64 commit 99365de
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
16 changes: 16 additions & 0 deletions ui/src/main/resources/genesis/app/app.js
Expand Up @@ -217,6 +217,15 @@ function(genesis, routermodule, jQuery, Backbone, _, backend, status, Projects,
} else {
$(".logout-link").attr("href", logoutLink.href)
}
// datetime picker settings customization:
var locale = app.currentConfiguration.locale;
$.timepicker.setDefaults({
controlType :"select",
showOn: "button", buttonText: "Select date & time",
buttonImage: "assets/img/date-picker.png", buttonImageOnly: true,
// TODO: provide timepicker localization file
timeFormat: locale == "en-US" ? "hh:mm tt" : "HH:mm"
});
}

$("#connection-error").ajaxError(function(event, jqXHR) {
Expand Down Expand Up @@ -271,4 +280,11 @@ function(genesis, routermodule, jQuery, Backbone, _, backend, status, Projects,
}
});

// fix validation error placement
$.validator.setDefaults({
errorPlacement: function(error, element) {
error.appendTo(element.parent());
}
});

});
Expand Up @@ -612,7 +612,7 @@ function (genesis, backend, poller, status, EnvHistory, variablesmodule, gtempla
} else {
view.trigger("workflow-validation-errors");
var validator = $('#workflow-parameters-form').validate();
validator.showErrors(json.variablesErrors);
validator.showErrors(json.variablesErrors);
}
}
);
Expand All @@ -631,14 +631,6 @@ function (genesis, backend, poller, status, EnvHistory, variablesmodule, gtempla
}));

if(view.scheduling) {
var locale = genesis.app.currentConfiguration.locale;
$.timepicker.setDefaults({
controlType :"select",
showOn: "button", buttonText: "Select date & time",
buttonImage: "assets/img/date-picker.png", buttonImageOnly: true,
// TODO: provide timepicker localization file
timeFormat: locale == "en-US" ? "hh:mm tt" : "HH:mm"
});
var date = new Date();
date.setHours(0);
date.setMinutes(0);
Expand Down

0 comments on commit 99365de

Please sign in to comment.