Merge additions to common from Sailfish UI

This commit is contained in:
Thomas Perl 2014-01-31 16:16:49 +01:00
parent 2f291673ab
commit c1f8db5500
2 changed files with 15 additions and 0 deletions

View file

@ -31,3 +31,14 @@ function updateModelFrom(model, data) {
model.remove(model.count-1);
}
}
function updateModelWith(model, key, value, update) {
for (var row=0; row<model.count; row++) {
var current = model.get(row);
if (current[key] == value) {
for (var key in update) {
model.setProperty(row, key, update[key]);
}
}
}
}