1
0
mirror of http://git.whoc.org.uk/git/password-manager.git synced 2024-11-14 18:49:03 +01:00

Improved tag handling.

This commit is contained in:
Giulio Cesare Solaroli 2014-07-30 16:14:44 +02:00
parent 86634cc4af
commit 9d4c8087f6
4 changed files with 359 additions and 5 deletions

View File

@ -519,7 +519,8 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.User, Object, {
function (someGroups) { function (someGroups) {
return MochiKit.Iter.reduce(function(aCollector, aGroup) { return MochiKit.Iter.reduce(function(aCollector, aGroup) {
if (aGroup[0] != Clipperz.PM.DataModel.Record.archivedTag) { if (aGroup[0] != Clipperz.PM.DataModel.Record.archivedTag) {
aCollector[aGroup[0]] = MochiKit.Iter.list(aGroup[1]).length; var currentValue = aCollector[aGroup[0]] ? aCollector[aGroup[0]] : 0;
aCollector[aGroup[0]] = MochiKit.Iter.list(aGroup[1]).length + currentValue;
} }
return aCollector; return aCollector;
}, someGroups, {}); }, someGroups, {});

View File

@ -49,7 +49,6 @@ Clipperz.PM.UI.Components.Selections = React.createClass({
var tags; var tags;
tagInfo = this.props['tags'] ? this.props['tags'] : {}; tagInfo = this.props['tags'] ? this.props['tags'] : {};
// tagInfo = {"tag1":1, "tag2":2, "tag3":1, "tag4":2, "tag5":1, "tag6":2, "tag7":1, "tag8":3, "tag9":1, "tag10":11, "tag11":1, "tag12":8, "tag13":1, "tag14":3, "tag15":1, "tag16":1};
tags = MochiKit.Base.keys(tagInfo).sort(Clipperz.Base.caseInsensitiveCompare); tags = MochiKit.Base.keys(tagInfo).sort(Clipperz.Base.caseInsensitiveCompare);
return React.DOM.div({'key':'selections', 'id':'selections'}, [ return React.DOM.div({'key':'selections', 'id':'selections'}, [

View File

@ -34,8 +34,8 @@ Clipperz.PM.UI.Components.TagIndexItem = React.createClass({
}, },
handleClick: function (anEvent) { handleClick: function (anEvent) {
//console.log("TAG INDEX ITEM - handle click TAG", anEvent.target.dataset.tag); //console.log("TAG INDEX ITEM - handle click TAG", anEvent.currentTarget.dataset.tag);
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'tagSelected', anEvent.target.dataset.tag); MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'tagSelected', anEvent.currentTarget.dataset.tag);
}, },
render: function () { render: function () {

File diff suppressed because one or more lines are too long