Focus title input when adding new record

This commit is contained in:
Martin Kleinschrodt 2013-11-15 22:40:35 +01:00
parent 3153910151
commit d00282b5df
2 changed files with 5 additions and 1 deletions

View File

@ -128,6 +128,7 @@
};
this.collection.add(record);
this.openRecord(record);
this.$.recordView.focusTitle();
}
});
</script>

View File

@ -90,7 +90,7 @@
</style>
<div class="header">
<button on-click="{{ back }}">&lt;</button>
<input value="{{ record.name }}" placeholder="Enter Title..." />
<input id="titleInput" value="{{ record.name }}" placeholder="Enter Title..." />
</div>
<template repeat="{{ field, i in record.fields }}">
<div class="field">
@ -111,6 +111,9 @@
value: ""
};
this.record.fields.push(field);
},
focusTitle: function() {
this.$.titleInput.focus();
}
});
</script>