Permalink
Browse files

fixed backport of counter fixture (refs #11334)

  • Loading branch information...
1 parent 10e093e commit e6bfe2592db95a768157d0849f74b160d7e78382 Tom Gross committed Nov 1, 2011
Showing with 9 additions and 5 deletions.
  1. +9 −5 Products/Archetypes/skins/archetypes/widgets/textarea.pt
@@ -18,7 +18,7 @@
templateId='widgets/textarea', macro='textarea-field-view');"
tal:attributes="class kss_class;
id string:parent-fieldname-$fieldName">
- <span metal:define-slot="inside"
+ <span metal:define-slot="inside"
tal:replace="accessor">textarea</span>
</span>
</metal:view_macro>
@@ -32,7 +32,8 @@
content_length python:len(content);
append_only widget/append_only|nothing;
maxlength widget/maxlength|nothing;
- keypress string:textCounter(this, this.form.textCounter_${fieldName}, ${maxlength});">
+ tcname string:textCounter_${fieldName};
+ keypress string:textCounter(this, '${tcname}', ${maxlength});">
<textarea
class="blurrable firstToFocus"
@@ -41,7 +42,7 @@
cols widget/cols;
rows widget/rows;
onkeydown python:test(maxlength, keypress, None);
- onkeyup python:test(maxlength, keypress, None);"
+ onkeyup python:test(maxlength, keypress, None);"
tal:define="content python:not append_only and content or '';"
tal:content="content">content</textarea>
@@ -54,9 +55,12 @@
size="4"
value=""
i18n:name="count"
- tal:define="remaining python:(int(maxlength) - content_length) + content.count('\n')"
- tal:attributes="name string:textCounter_${fieldName};
+ tal:define="remaining python:(int(maxlength) - content_length) + content.count('\n');
+ inputsize string:4"
+ tal:attributes="name tcname;
value remaining;
+ maxlength inputsize;
+ size inputsize;
id string:maxlength_${fieldName};" />
characters remaining
</div>

0 comments on commit e6bfe25

Please sign in to comment.