1
0
mirror of https://github.com/moparisthebest/mail synced 2024-12-24 08:18:48 -05:00

Merge pull request #72 from whiteout-io/dev/WO-344

Dev/wo 344
This commit is contained in:
Tankred Hase 2014-06-17 15:33:44 +02:00
commit 3017c9fb93
2 changed files with 14 additions and 13 deletions

View File

@ -483,7 +483,11 @@ define(function(require) {
return { return {
//scope: true, // optionally create a child scope //scope: true, // optionally create a child scope
link: function(scope, element, attrs) { link: function(scope, element, attrs) {
element.on('click', function() { element.on('click', function(e) {
if(e.target.nodeName === 'INPUT') {
return;
}
var fieldName = attrs.field; var fieldName = attrs.field;
var field = scope[fieldName]; var field = scope[fieldName];
@ -509,11 +513,6 @@ define(function(require) {
var field = scope[fieldName]; var field = scope[fieldName];
var index = parseInt(attrs.id.replace(fieldName, ''), 10); var index = parseInt(attrs.id.replace(fieldName, ''), 10);
element.on('click', function(e) {
// focus on this one and dont bubble to field click handler
e.stopPropagation();
});
element.on('blur', function() { element.on('blur', function() {
if (!checkForEmptyInput(field)) { if (!checkForEmptyInput(field)) {
// create new field input // create new field input
@ -532,12 +531,14 @@ define(function(require) {
// catch space, comma, semicolon // catch space, comma, semicolon
e.preventDefault(); e.preventDefault();
// add next field only if current input is not empty
if(field[index].address) {
// create new field input // create new field input
addInput(field, scope); addInput(field, scope);
// find next input and focus // find next input and focus
var nextId = fieldName + (index + 1); var nextId = fieldName + (index + 1);
document.getElementById(nextId).focus(); document.getElementById(nextId).focus();
}
} else if ((code === 8 || code === 46) && !field[index].address && field.length > 1) { } else if ((code === 8 || code === 46) && !field[index].address && field.length > 1) {
// backspace, delete on empty input // backspace, delete on empty input
// remove input // remove input

View File

@ -14,7 +14,7 @@
<p field="to"> <p field="to">
<label>To:</label> <label>To:</label>
<span ng-repeat="recipient in to track by $index"> <span ng-repeat="recipient in to track by $index">
<input id="to{{$index}}" value="{{recipient.address}}" ng-model="recipient.address" ng-trim="false" class="label" ng-class="{'label-blank': !recipient.address || recipient.secure === undefined, 'label-primary': recipient.secure === false}" auto-size="recipient.address" spellcheck="false" ng-change="onAddressUpdate(to, $index)" address-input="to" tabindex="1" ng-mouseover="getKeyId(recipient)" focus-me="state.lightbox === 'write' && writerTitle !== 'Reply'"> <input id="to{{$index}}" value="{{recipient.address}}" ng-model="recipient.address" ng-trim="false" class="label" ng-class="{'label-blank': !recipient.address || recipient.secure === undefined, 'label-primary': recipient.secure === false}" auto-size="recipient.address" spellcheck="false" ng-change="onAddressUpdate(to, $index)" address-input="to" tabindex="1" ng-mouseover="getKeyId(recipient)" focus-me="$index === 0 && state.lightbox === 'write' && writerTitle !== 'Reply'">
</span> </span>
</p> </p>
<p field="cc" ng-show="showCC === true"> <p field="cc" ng-show="showCC === true">