Added html autocomplete="off" feature to input fields.

This commit is contained in:
Martin Edenhofer 2012-08-11 10:26:49 +02:00
parent 84e98e4b2c
commit 8b858dad99
3 changed files with 31 additions and 25 deletions

View file

@ -76,6 +76,12 @@ class App.Controller extends Spine.Controller
else
attribute.autocapitalize = 'autocapitalize="off"'
# set autocomplete option
if attribute.autocomplete is undefined
attribute.autocomplete = ''
else
attribute.autocomplete = 'autocomplete="' + attribute.autocomplete + '"'
# set value
if data.params
if attribute.name of data.params

View file

@ -14,7 +14,7 @@ class App.User extends App.Model
{ name: 'street', display: 'Street', tag: 'input', type: 'text', limit: 100, null: true, class: 'xlarge', signup: false, quick: true, info: true },
{ name: 'zip', display: 'Zip', tag: 'input', type: 'text', limit: 100, null: true, class: 'xlarge', signup: false, quick: true, info: true },
{ name: 'city', display: 'City', tag: 'input', type: 'text', limit: 100, null: true, class: 'xlarge', signup: false, quick: true, info: true },
{ name: 'password', display: 'Password', tag: 'input', type: 'password', limit: 50, null: true, class: 'xlarge', signup: true, quick: false, },
{ name: 'password', display: 'Password', tag: 'input', type: 'password', limit: 50, null: true, autocomplete: 'off', class: 'xlarge', signup: true, quick: false, },
{ name: 'organization_id', display: 'Organization', tag: 'select', multiple: false, nulloption: true, null: true, relation: 'Organization', class: 'xlarge' },
{ name: 'note', display: 'Note', tag: 'textarea', note: 'Notes are visible to agents only, never to customers.', limit: 250, null: true, class: 'xlarge', quick: true, info: true },
{ name: 'role_ids', display: 'Roles', tag: 'checkbox', multiple: true, null: false, relation: 'Role', class: 'xlarge' },

View file

@ -1 +1 @@
<input id="<%= @attribute.id %>" type="<%= @attribute.type %>" name="<%= @attribute.name %>" value="<%= @attribute.value %>" class="<%= @attribute.class %>" <%= @attribute.required %> <%= @attribute.autofocus %> <%- @attribute.autocapitalize %>/>
<input id="<%= @attribute.id %>" type="<%= @attribute.type %>" name="<%= @attribute.name %>" value="<%= @attribute.value %>" class="<%= @attribute.class %>" <%= @attribute.required %> <%= @attribute.autofocus %> <%- @attribute.autocapitalize %> <%- @attribute.autocomplete %>/>