Commit 218c523d authored by Arthur Verschaeve's avatar Arthur Verschaeve

Merge pull request #1320 from akudev/master

SAPUI5: fix adding new tasks, remove browser-dependent autoselect
parents 90ab24a4 08da3733
......@@ -4,7 +4,7 @@
<meta charset="utf-8">
<title>SAPUI5 • TodoMVC</title>
<script
src="https://sapui5.netweaver.ondemand.com/resources/sap-ui-core.js"
src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js"
id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons"
data-sap-ui-theme="base">
......
......@@ -39,12 +39,13 @@
return;
}
this.model.setProperty('/todos/', this.model.getProperty('/todos/')
.push({
id: jQuery.sap.uid(),
done: false,
text: todo
}));
var todos = this.model.getProperty('/todos/');
todos.push({
id: jQuery.sap.uid(),
done: false,
text: todo
});
this.model.setProperty('/todos/', todos);
this.store.set(this.model.getData());
......
......@@ -44,8 +44,7 @@
// Text field for entering a new todo
newTodo = new todo.SmartTextField('new-todo', {
placeholder: 'What needs to be done?',
// Don't autofocus in case of MSIE and Opera as both hide placeholder on focus
autofocus: !sap.ui.Device.browser.internet_explorer && !$.browser.opera
autofocus: true
}).attachChange(function () {
oController.createTodo(this.getProperty('value'));
this.setValue('');
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment