Sort templates by usage in the PCS

This commit is contained in:
yflory
2018-04-13 18:52:55 +02:00
parent 52d6c9d468
commit ec0fc85b9f
5 changed files with 30 additions and 7 deletions

View File

@@ -660,6 +660,15 @@ define([
});
cb(res);
};
Store.incrementTemplateUse = function (href) {
store.userObject.getPadAttribute(href, 'used', function (err, data) {
// This is a not critical function, abort in case of error to make sure we won't
// create any issue with the user object or the async store
if (err) { return; }
var used = typeof data === "number" ? ++data : 1;
store.userObject.setPadAttribute(href, 'used', used);
});
};
// Pads
Store.moveToTrash = function (data, cb) {