[Refactor] Remove directive tg-limit-line-length
parent
3f2040dcfe
commit
9a91502687
|
@ -234,26 +234,6 @@ ProjectUrl = ($navurls) ->
|
|||
module.factory("$projectUrl", ["$tgNavUrls", ProjectUrl])
|
||||
|
||||
|
||||
#############################################################################
|
||||
## Limite line size in a text area
|
||||
#############################################################################
|
||||
|
||||
LimitLineLengthDirective = () ->
|
||||
link = ($scope, $el, $attrs) ->
|
||||
maxColsPerLine = parseInt($el.attr("cols"))
|
||||
$el.on "keyup", (event) ->
|
||||
code = event.keyCode
|
||||
lines = $el.val().split("\n")
|
||||
|
||||
_.each lines, (line, index) ->
|
||||
lines[index] = line.substring(0, maxColsPerLine - 2)
|
||||
|
||||
$el.val(lines.join("\n"))
|
||||
|
||||
return {link:link}
|
||||
|
||||
module.directive("tgLimitLineLength", LimitLineLengthDirective)
|
||||
|
||||
#############################################################################
|
||||
## Queue Q promises
|
||||
#############################################################################
|
||||
|
|
|
@ -66,6 +66,7 @@
|
|||
"MAX_CHECK": "You must select %s choices or less.",
|
||||
"RANGE_CHECK": "You must select between %s and %s choices.",
|
||||
"EQUAL_TO": "This value should be the same.",
|
||||
"LINEWIDTH": "One or some lines are too long. They should have %s characters or less.",
|
||||
"PIKADAY": "Invalid date format, use DD MMM YYYY (like 23 Mar 1984)"
|
||||
},
|
||||
"PICKERDATE": {
|
||||
|
|
|
@ -3,6 +3,17 @@ a.close(href="", title="{{'COMMON.CLOSE' | translate}}")
|
|||
form
|
||||
h2.title(translate="COMMON.NEW_BULK")
|
||||
fieldset
|
||||
textarea(cols="200", wrap="off", tg-limit-line-length, ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}", ng-model="new.bulk", data-required="true", data-linewidth="200")
|
||||
textarea(
|
||||
cols="200"
|
||||
wrap="off"
|
||||
ng-model="new.bulk"
|
||||
data-required="true"
|
||||
data-linewidth="200"
|
||||
ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}"
|
||||
)
|
||||
|
||||
button.button-green.submit-button(type="submit", title="{{'COMMON.SAVE' | translate}}", translate="COMMON.SAVE")
|
||||
button.button-green.submit-button(
|
||||
type="submit"
|
||||
title="{{'COMMON.SAVE' | translate}}"
|
||||
translate="COMMON.SAVE"
|
||||
)
|
||||
|
|
|
@ -3,6 +3,17 @@ a.close(href="", title="{{'COMMON.CLOSE' | translate}}")
|
|||
form
|
||||
h2.title(translate="COMMON.NEW_BULK")
|
||||
fieldset
|
||||
textarea(cols="200", wrap="off", tg-limit-line-length, ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}", ng-model="form.data", data-required="true")
|
||||
textarea(
|
||||
cols="200"
|
||||
wrap="off"
|
||||
ng-model="form.data"
|
||||
data-required="true"
|
||||
data-linewidth="200"
|
||||
ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}"
|
||||
)
|
||||
|
||||
button.button-green.submit-button(type="submit", title="{{'COMMON.SAVE' | translate}}", translate="COMMON.SAVE")
|
||||
button.button-green.submit-button(
|
||||
type="submit"
|
||||
title="{{'COMMON.SAVE' | translate}}"
|
||||
translate="COMMON.SAVE"
|
||||
)
|
||||
|
|
|
@ -3,6 +3,17 @@ a.close(href="", title="{{'COMMON.CLOSE' | translate}}")
|
|||
form
|
||||
h2.title(translate="COMMON.NEW_BULK")
|
||||
fieldset
|
||||
textarea(cols="200", wrap="off", tg-limit-line-length, ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}", ng-model="new.bulk", data-required="true", data-linewidth="200")
|
||||
textarea(
|
||||
cols="200"
|
||||
wrap="off"
|
||||
ng-model="new.bulk"
|
||||
data-required="true"
|
||||
data-linewidth="200"
|
||||
ng-attr-placeholder="{{'COMMON.ONE_ITEM_LINE' | translate}}"
|
||||
)
|
||||
|
||||
button.button-green.submit-button(type="submit", title="{{'COMMON.SAVE' | translate}}", translate="COMMON.SAVE")
|
||||
button.button-green.submit-button(
|
||||
type="submit",
|
||||
title="{{'COMMON.SAVE' | translate}}",
|
||||
translate="COMMON.SAVE"
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue