From 19bd39b06641fe5b24683e626f46e889f92d3f0f Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 23 Dec 2015 16:02:18 +0000 Subject: [PATCH] More random tweaks - Make onBlur reset the EditText to show that it hasn't submitted it. - Add the user ID of the logged in user to Advanced. - Remove remnants of the Save/Cancel buttons. --- src/components/structures/UserSettings.js | 30 ++++++++----------- src/components/views/elements/EditableText.js | 7 ++++- .../views/settings/ChangePassword.js | 2 +- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/components/structures/UserSettings.js b/src/components/structures/UserSettings.js index 23b28e0a0a..b135ea747d 100644 --- a/src/components/structures/UserSettings.js +++ b/src/components/structures/UserSettings.js @@ -40,7 +40,7 @@ module.exports = React.createClass({ avatarUrl: null, threePids: [], clientVersion: version, - phase: "UserSettings.LOADING", // LOADING, DISPLAY, SAVING + phase: "UserSettings.LOADING", // LOADING, DISPLAY }; }, @@ -71,13 +71,15 @@ module.exports = React.createClass({ componentDidMount: function() { this.dispatcherRef = dis.register(this.onAction); + this._me = MatrixClientPeg.get().credentials.userId; }, componentWillUnmount: function() { dis.unregister(this.dispatcherRef); }, - onSaveClicked: function(ev) { +/* + onSaveClicked: function(ev) { // XXX unused var self = this; var savePromises = []; @@ -116,7 +118,7 @@ module.exports = React.createClass({ description: error.toString() }); }); - }, + }, */ onAction: function(payload) { if (payload.action === "notifier_enabled") { @@ -189,14 +191,12 @@ module.exports = React.createClass({ }, render: function() { - var Loader = sdk.getComponent("elements.Spinner"); - var saving; switch (this.state.phase) { case "UserSettings.LOADING": - return - case "UserSettings.SAVING": - saving = - // intentional fall through + var Loader = sdk.getComponent("elements.Spinner"); + return ( + + ); case "UserSettings.DISPLAY": break; // quit the switch to return the common state default: @@ -209,7 +209,7 @@ module.exports = React.createClass({ return (
- +

Profile

@@ -290,14 +290,10 @@ module.exports = React.createClass({
- Version {this.state.clientVersion} + Logged in as {this._me}
-
- -
-
{ saving }
-
- Save and close +
+ Version {this.state.clientVersion}
diff --git a/src/components/views/elements/EditableText.js b/src/components/views/elements/EditableText.js index 0ed443fbae..ee88f1a853 100644 --- a/src/components/views/elements/EditableText.js +++ b/src/components/views/elements/EditableText.js @@ -113,6 +113,10 @@ module.exports = React.createClass({ } }, + onBlur: function() { + this.cancelEdit(); + }, + render: function() { var editable_el; @@ -125,7 +129,8 @@ module.exports = React.createClass({ } else if (this.state.phase == this.Phases.Edit) { editable_el = (
- +
); } diff --git a/src/components/views/settings/ChangePassword.js b/src/components/views/settings/ChangePassword.js index 2f097387e9..a77b20d3d8 100644 --- a/src/components/views/settings/ChangePassword.js +++ b/src/components/views/settings/ChangePassword.js @@ -117,7 +117,7 @@ module.exports = React.createClass({
- +