fix #307
parent
f6ef790a98
commit
2cb5857370
|
@ -157,6 +157,19 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, tgLoade
|
|||
$httpProvider.responseInterceptors.push('authHttpIntercept')
|
||||
$httpProvider.interceptors.push('loaderInterceptor');
|
||||
|
||||
window.checksley.updateValidators({
|
||||
linewidth: (val, width) ->
|
||||
lines = taiga.nl2br(val).split("<br />")
|
||||
|
||||
valid = _.every lines, (line) ->
|
||||
line.length < width
|
||||
|
||||
return valid
|
||||
})
|
||||
|
||||
window.checksley.updateMessages("default", {
|
||||
linewidth: "The subject must have a maximum size of %s"
|
||||
})
|
||||
|
||||
init = ($log, $i18n, $config, $rootscope) ->
|
||||
$i18n.initialize($config.get("defaultLanguage"))
|
||||
|
|
|
@ -225,7 +225,9 @@ CreateBulkUserstoriesDirective = ($repo, $rs, $rootscope, lightboxService) ->
|
|||
$el.on "click", ".button-green", (event) ->
|
||||
event.preventDefault()
|
||||
|
||||
form = $el.find("form").checksley()
|
||||
form = $el.find("form").checksley({
|
||||
onlyOneErrorElement: true
|
||||
})
|
||||
if not form.validate()
|
||||
return
|
||||
|
||||
|
|
|
@ -3,6 +3,6 @@ a.close(href="", title="close")
|
|||
form
|
||||
h2.title(tg-i18n="common.new-bulk")
|
||||
fieldset
|
||||
textarea(tg-i18n="placeholder:common.one-item-line", ng-model="new.bulk", data-required="true")
|
||||
textarea(tg-i18n="placeholder:common.one-item-line", ng-model="new.bulk", data-required="true", data-linewidth="200")
|
||||
a.button.button-green(href="", tg-i18n="title:common.save")
|
||||
span(tg-i18n="common.save")
|
||||
|
|
Loading…
Reference in New Issue