mirror of
http://git.whoc.org.uk/git/password-manager.git
synced 2025-10-30 02:47:36 +01:00
Improved feedback when cancelling/saving changes
This commit is contained in:
@@ -31,7 +31,8 @@ Clipperz.PM.UI.Components.Cards.Detail = React.createClass({
|
||||
result = this.props['selectedCard'];
|
||||
if (result) {
|
||||
result['style'] = this.props['style'];
|
||||
result['ask'] = this.props['ask'];
|
||||
result['ask'] = (this.props['style'] == 'narrow') ? this.props['ask'] : null;
|
||||
result['showGlobalMask'] = this.props['showGlobalMask'];
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -51,23 +51,7 @@ Clipperz.PM.UI.Components.Cards.Edit = React.createClass({
|
||||
fields: function () {
|
||||
return this.props['fields'];
|
||||
},
|
||||
/*
|
||||
sortedFields: function () {
|
||||
var result;
|
||||
var from = this.state['fromFieldPosition'];
|
||||
var to = this.state['toFieldPosition'];
|
||||
|
||||
// console.log("FIELDS", this.fields());
|
||||
if ((from != -1) && (to != -1) && (from != to)) {
|
||||
result = MochiKit.Base.clone(this.fields());
|
||||
result.splice(to, 0, result.splice(from, 1)[0]);
|
||||
} else {
|
||||
result = this.fields();
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
*/
|
||||
//============================================================================
|
||||
|
||||
positionOfField: function (aFieldReference) {
|
||||
@@ -90,16 +74,6 @@ Clipperz.PM.UI.Components.Cards.Edit = React.createClass({
|
||||
'toFieldPosition': -1,
|
||||
'dropPosition': -1
|
||||
}));
|
||||
|
||||
// this.setState({
|
||||
// 'draggedFieldReference': fieldReference,
|
||||
// 'fromFieldPosition': fieldPosition
|
||||
/// 'toFieldPosition': 0
|
||||
// });
|
||||
|
||||
// anEvent.dataTransfer.effectAllowed = 'move';
|
||||
// anEvent.dataTransfer.setData('text/html', this.innerHTML);
|
||||
// anEvent.dropEffect
|
||||
},
|
||||
/*
|
||||
drag: function (anEvent) {
|
||||
@@ -237,7 +211,6 @@ console.log("DROP"); //, anEvent);
|
||||
return function (anEvent) {
|
||||
method(anEvent.target.value);
|
||||
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'refreshCardEditDetail', reference);
|
||||
// MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'refreshCardEditToolbar', reference);
|
||||
};
|
||||
},
|
||||
|
||||
@@ -383,9 +356,9 @@ console.log("DROP"); //, anEvent);
|
||||
'edit': true
|
||||
}
|
||||
|
||||
//console.log("RENDER CARD EDIT");
|
||||
//console.log("RENDER CARD EDIT", this.props['showGlobalMask']);
|
||||
return React.DOM.div({'className':'editWrapper'}, [
|
||||
React.DOM.div({'className':'mask'}),
|
||||
this.props['showGlobalMask'] ? null : React.DOM.div({'className':'mask'}),
|
||||
React.DOM.div({'className':React.addons.classSet(classes)},[
|
||||
Clipperz.PM.UI.Components.Cards.EditToolbar(this.props),
|
||||
React.DOM.div({'className':'content'}, [
|
||||
|
||||
@@ -53,7 +53,11 @@ Clipperz.Base.extend(Clipperz.PM.UI.Components.Overlay, Object, {
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
'show': function (aMessage) {
|
||||
'show': function (aMessage, showMask) {
|
||||
if (showMask === true) {
|
||||
this.showMask();
|
||||
}
|
||||
|
||||
this.resetStatus();
|
||||
this.setMessage(aMessage);
|
||||
MochiKit.DOM.removeElementClass(this.element(), 'ios-overlay-hide');
|
||||
@@ -61,6 +65,7 @@ Clipperz.Base.extend(Clipperz.PM.UI.Components.Overlay, Object, {
|
||||
},
|
||||
|
||||
'done': function (aMessage, aDelayBeforeHiding) {
|
||||
this.hideMask();
|
||||
this.completed(this.showDoneIcon, aMessage, aDelayBeforeHiding);
|
||||
},
|
||||
|
||||
@@ -70,6 +75,20 @@ Clipperz.Base.extend(Clipperz.PM.UI.Components.Overlay, Object, {
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
'maskElement': function () {
|
||||
return this.getElement('mask');
|
||||
},
|
||||
|
||||
'showMask': function () {
|
||||
MochiKit.DOM.removeElementClass(this.maskElement(), 'hidden');
|
||||
},
|
||||
|
||||
'hideMask': function () {
|
||||
MochiKit.DOM.addElementClass(this.maskElement(), 'hidden');
|
||||
},
|
||||
|
||||
//-------------------------------------------------------------------------
|
||||
|
||||
'resetStatus': function () {
|
||||
MochiKit.Style.showElement(this.element());
|
||||
MochiKit.Style.showElement(this.getElement('spinner'));
|
||||
|
||||
@@ -54,7 +54,7 @@ Clipperz.PM.UI.Components.Pages.MainPage = React.createClass({
|
||||
};
|
||||
classes[this.props['style']] = true;
|
||||
|
||||
//console.log("MAIN PAGE", this.props['ask']);
|
||||
//console.log("MAIN PAGE", this.props['showGlobalMask']);
|
||||
return React.DOM.div({'className':React.addons.classSet(classes)}, [
|
||||
this.props['style'] != 'extra-wide' ? Clipperz.PM.UI.Components.Panels.SelectionPanel(this.props) : null,
|
||||
Clipperz.PM.UI.Components.Panels.MainPanel(this.props),
|
||||
|
||||
@@ -93,30 +93,6 @@ Clipperz.PM.UI.Components.Panels.MainPanel = React.createClass({
|
||||
},
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
/*
|
||||
viewComponentProps: function () {
|
||||
var result;
|
||||
|
||||
result = this.props['selectedCard'];
|
||||
if (result) {
|
||||
result['style'] = this.props['style'];
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
renderCardDetail: function () {
|
||||
var result;
|
||||
//console.log("PROPS", this.props);
|
||||
if (this.props['mode'] == 'edit') {
|
||||
result = Clipperz.PM.UI.Components.Cards.Edit(this.viewComponentProps());
|
||||
} else {
|
||||
result = Clipperz.PM.UI.Components.Cards.View(this.viewComponentProps());
|
||||
}
|
||||
|
||||
return result;
|
||||
},
|
||||
*/
|
||||
|
||||
renderCardDetail: function () {
|
||||
return Clipperz.PM.UI.Components.Cards.Detail(this.props);
|
||||
@@ -190,7 +166,7 @@ Clipperz.PM.UI.Components.Panels.MainPanel = React.createClass({
|
||||
},
|
||||
|
||||
render: function () {
|
||||
//console.log("MainPanel.cards", this.props['ask']);
|
||||
//console.log("MainPanel.render", this.props['showGlobalMask']);
|
||||
var classes = {
|
||||
'panel': true,
|
||||
'left': this.props['selectionPanelStatus'] == 'OPEN',
|
||||
|
||||
Reference in New Issue
Block a user