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});
|
||||
},
|
||||
|
||||
'archive': function () {
|
||||
return this.addTag(Clipperz.PM.DataModel.Record.archivedTag);
|
||||
'toggleArchive': function () {
|
||||
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 () {
|
||||
|
@ -38,7 +38,7 @@ Clipperz.PM.UI.Components.Cards.CommandToolbar = React.createClass({
|
||||
getInitialState: function() {
|
||||
return {'showCommandMenu': false };
|
||||
},
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
commands: function () {
|
||||
@ -48,8 +48,8 @@ Clipperz.PM.UI.Components.Cards.CommandToolbar = React.createClass({
|
||||
'broadcastEvent': 'deleteCard'
|
||||
},
|
||||
'archive': {
|
||||
'label': "archive",
|
||||
'broadcastEvent': 'archiveCard'
|
||||
'label': this.props['_isArchived'] ? "restore" : "archive",
|
||||
'broadcastEvent': 'toggleArchiveCard'
|
||||
},
|
||||
// 'share': {
|
||||
// 'label': "share",
|
||||
|
@ -65,7 +65,7 @@ Clipperz.PM.UI.MainController = function() {
|
||||
'saveCardEdits', 'cancelCardEdits',
|
||||
'cardSelected',
|
||||
'addCardClick',
|
||||
'deleteCard', 'archiveCard', 'cloneCard', 'editCard',
|
||||
'deleteCard', 'toggleArchiveCard', 'cloneCard', 'editCard',
|
||||
'addTag', 'removeTag',
|
||||
'showArchivedCards', 'hideArchivedCards',
|
||||
'goBackToMainPage',
|
||||
@ -1056,10 +1056,10 @@ console.log("SET USER", aUser);
|
||||
], {trace:false});
|
||||
},
|
||||
|
||||
archiveCard_handler: function (anEvent) {
|
||||
toggleArchiveCard_handler: function (anEvent) {
|
||||
return Clipperz.Async.callbacks("MainController.archiveCard_handler", [
|
||||
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, 'refreshUI', anEvent['reference'])
|
||||
], {trace:false});
|
||||
|
Loading…
Reference in New Issue
Block a user