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 @@ ...@@ -4,7 +4,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<title>SAPUI5 • TodoMVC</title> <title>SAPUI5 • TodoMVC</title>
<script <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" id="sap-ui-bootstrap"
data-sap-ui-libs="sap.ui.commons" data-sap-ui-libs="sap.ui.commons"
data-sap-ui-theme="base"> data-sap-ui-theme="base">
......
...@@ -39,12 +39,13 @@ ...@@ -39,12 +39,13 @@
return; return;
} }
this.model.setProperty('/todos/', this.model.getProperty('/todos/') var todos = this.model.getProperty('/todos/');
.push({ todos.push({
id: jQuery.sap.uid(), id: jQuery.sap.uid(),
done: false, done: false,
text: todo text: todo
})); });
this.model.setProperty('/todos/', todos);
this.store.set(this.model.getData()); this.store.set(this.model.getData());
......
...@@ -44,8 +44,7 @@ ...@@ -44,8 +44,7 @@
// Text field for entering a new todo // Text field for entering a new todo
newTodo = new todo.SmartTextField('new-todo', { newTodo = new todo.SmartTextField('new-todo', {
placeholder: 'What needs to be done?', placeholder: 'What needs to be done?',
// Don't autofocus in case of MSIE and Opera as both hide placeholder on focus autofocus: true
autofocus: !sap.ui.Device.browser.internet_explorer && !$.browser.opera
}).attachChange(function () { }).attachChange(function () {
oController.createTodo(this.getProperty('value')); oController.createTodo(this.getProperty('value'));
this.setValue(''); 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