Skip to content

Commit

Permalink
fix(form): prompt template function
Browse files Browse the repository at this point in the history
Add the className.label as an argument on the prompt
template function so it uses the user defined class
not the default setting.
  • Loading branch information
Sean committed Jul 11, 2019
1 parent cc19442 commit cc97a30
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/definitions/behaviors/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -733,23 +733,23 @@ $.fn.form = function(parameters) {
case 'date':
values[name] = settings.formatter.date(date);
break;

case 'datetime':
values[name] = settings.formatter.datetime(date);
break;

case 'time':
values[name] = settings.formatter.time(date);
break;

case 'month':
values[name] = settings.formatter.month(date);
break;

case 'year':
values[name] = settings.formatter.year(date);
break;

default:
module.debug('Wrong calendar mode', $calendar, type);
values[name] = '';
Expand Down Expand Up @@ -860,7 +860,7 @@ $.fn.form = function(parameters) {
}
if(settings.inline) {
if(!promptExists) {
$prompt = settings.templates.prompt(errors);
$prompt = settings.templates.prompt(errors, className.label);
$prompt
.appendTo($fieldGroup)
;
Expand Down Expand Up @@ -1506,7 +1506,7 @@ $.fn.form.settings = {

className : {
error : 'error',
label : 'ui prompt label',
label : 'ui basic red pointing prompt label',
pressed : 'down',
success : 'success'
},
Expand All @@ -1533,9 +1533,9 @@ $.fn.form.settings = {
},

// template that produces label
prompt: function(errors) {
prompt: function(errors, labelClasses) {
return $('<div/>')
.addClass('ui basic red pointing prompt label')
.addClass(labelClasses)
.html(errors[0])
;
}
Expand Down

0 comments on commit cc97a30

Please sign in to comment.