mirror of
http://git.whoc.org.uk/git/password-manager.git
synced 2025-01-10 11:10:03 +01:00
Added the option to "restore" and archived card
This commit is contained in:
parent
c1041f75ca
commit
a891853d32
@ -250,8 +250,15 @@ Clipperz.Base.extend(Clipperz.PM.DataModel.Record, Clipperz.PM.DataModel.Encrypt
|
|||||||
], {trace:false});
|
], {trace:false});
|
||||||
},
|
},
|
||||||
|
|
||||||
'archive': function () {
|
'toggleArchive': function () {
|
||||||
return this.addTag(Clipperz.PM.DataModel.Record.archivedTag);
|
return Clipperz.Async.callbacks("Record.toggleArchive", [
|
||||||
|
MochiKit.Base.method(this, 'isArchived'),
|
||||||
|
Clipperz.Async.deferredIf("Record is archived", [
|
||||||
|
MochiKit.Base.method(this, 'removeTag', Clipperz.PM.DataModel.Record.archivedTag)
|
||||||
|
], [
|
||||||
|
MochiKit.Base.method(this, 'addTag', Clipperz.PM.DataModel.Record.archivedTag)
|
||||||
|
]),
|
||||||
|
], {trace:false});
|
||||||
},
|
},
|
||||||
|
|
||||||
'isArchived': function () {
|
'isArchived': function () {
|
||||||
|
@ -48,8 +48,8 @@ Clipperz.PM.UI.Components.Cards.CommandToolbar = React.createClass({
|
|||||||
'broadcastEvent': 'deleteCard'
|
'broadcastEvent': 'deleteCard'
|
||||||
},
|
},
|
||||||
'archive': {
|
'archive': {
|
||||||
'label': "archive",
|
'label': this.props['_isArchived'] ? "restore" : "archive",
|
||||||
'broadcastEvent': 'archiveCard'
|
'broadcastEvent': 'toggleArchiveCard'
|
||||||
},
|
},
|
||||||
// 'share': {
|
// 'share': {
|
||||||
// 'label': "share",
|
// 'label': "share",
|
||||||
|
@ -65,7 +65,7 @@ Clipperz.PM.UI.MainController = function() {
|
|||||||
'saveCardEdits', 'cancelCardEdits',
|
'saveCardEdits', 'cancelCardEdits',
|
||||||
'cardSelected',
|
'cardSelected',
|
||||||
'addCardClick',
|
'addCardClick',
|
||||||
'deleteCard', 'archiveCard', 'cloneCard', 'editCard',
|
'deleteCard', 'toggleArchiveCard', 'cloneCard', 'editCard',
|
||||||
'addTag', 'removeTag',
|
'addTag', 'removeTag',
|
||||||
'showArchivedCards', 'hideArchivedCards',
|
'showArchivedCards', 'hideArchivedCards',
|
||||||
'goBackToMainPage',
|
'goBackToMainPage',
|
||||||
@ -1056,10 +1056,10 @@ console.log("SET USER", aUser);
|
|||||||
], {trace:false});
|
], {trace:false});
|
||||||
},
|
},
|
||||||
|
|
||||||
archiveCard_handler: function (anEvent) {
|
toggleArchiveCard_handler: function (anEvent) {
|
||||||
return Clipperz.Async.callbacks("MainController.archiveCard_handler", [
|
return Clipperz.Async.callbacks("MainController.archiveCard_handler", [
|
||||||
MochiKit.Base.method(this.user(), 'getRecord', anEvent['reference']),
|
MochiKit.Base.method(this.user(), 'getRecord', anEvent['reference']),
|
||||||
MochiKit.Base.methodcaller('archive'),
|
MochiKit.Base.methodcaller('toggleArchive'),
|
||||||
MochiKit.Base.method(this.user(), 'saveChanges'),
|
MochiKit.Base.method(this.user(), 'saveChanges'),
|
||||||
MochiKit.Base.method(this, 'refreshUI', anEvent['reference'])
|
MochiKit.Base.method(this, 'refreshUI', anEvent['reference'])
|
||||||
], {trace:false});
|
], {trace:false});
|
||||||
|
Loading…
Reference in New Issue
Block a user