Commit 5ace27f1 authored by Arthur Verschaeve's avatar Arthur Verschaeve

Merge pull request #1327 from akudev/master

SAPUI5: remove "completed todos" count
parents 7cac72db 6d8bdfd4
...@@ -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