Commit 6d8bdfd4 authored by Andreas Kunz's avatar Andreas Kunz

SAPUI5: remove "completed todos" count

As per request in https://github.com/tastejs/todomvc/issues/1234
parent 08da3733
...@@ -138,10 +138,7 @@ ...@@ -138,10 +138,7 @@
clearCompleted = new sap.ui.commons.Button({ clearCompleted = new sap.ui.commons.Button({
id: 'clear-completed', id: 'clear-completed',
lite: true, lite: true,
text: { text: 'Clear Completed',
path: '/todos/',
formatter: todo.formatters.completedTodoCountFormatter
},
visible: { visible: {
path: '/todos/', path: '/todos/',
formatter: todo.formatters.hasCompletedTodosFormatter formatter: todo.formatters.hasCompletedTodosFormatter
......
...@@ -25,18 +25,6 @@ ...@@ -25,18 +25,6 @@
return 'false'; return 'false';
}, },
// Counts the number of closed todos
completedTodoCountFormatter: function (aTodos) {
var numberOfCompletedItems = 0;
aTodos.forEach(function (todo) {
if (todo.done === true) {
numberOfCompletedItems++;
}
});
return 'Clear completed (' + numberOfCompletedItems + ')';
},
// Returns whether a completed todo is available // Returns whether a completed todo is available
hasCompletedTodosFormatter: function (aTodos) { hasCompletedTodosFormatter: function (aTodos) {
return aTodos.some(function (element, index, array) { return aTodos.some(function (element, index, array) {
......
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