diff --git a/src/components/views/settings/Notifications.js b/src/components/views/settings/Notifications.js
index 73a7693d..79ce4f46 100644
--- a/src/components/views/settings/Notifications.js
+++ b/src/components/views/settings/Notifications.js
@@ -160,18 +160,31 @@ module.exports = React.createClass({
var self = this;
this.newKeywords = undefined;
- var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
- Modal.createDialog(QuestionDialog, {
- title: "Keywords",
- description: this.keywordsDialogDiv,
- focus: false,
- onFinished: function onFinished(should_leave) {
+ // Compute the keywords list to display
+ var keywords = [];
+ for (var i in this.state.vectorContentRules.rules) {
+ var rule = this.state.vectorContentRules.rules[i];
+ keywords.push(rule.pattern);
+ }
+ if (keywords.length) {
+ keywords = keywords.join(", ");
+ }
+ else {
+ keywords = "";
+ }
- if (should_leave && self.newKeywords) {
+ var TextInputDialog = sdk.getComponent("dialogs.TextInputDialog");
+ Modal.createDialog(TextInputDialog, {
+ title: "Keywords",
+ description: "Enter keywords separated by a comma:",
+ value: keywords,
+ onFinished: function onFinished(should_leave, newValue) {
+
+ if (should_leave && newValue !== keywords) {
var cli = MatrixClientPeg.get();
var removeDeferreds = [];
- var newKeywords = self.newKeywords.split(',');
+ var newKeywords = newValue.split(',');
for (var i in newKeywords) {
newKeywords[i] = newKeywords[i].trim();
}
@@ -536,38 +549,6 @@ module.exports = React.createClass({
);
}
- // Prepare keywords dialog here, in a render method, else React complains if
- // it is done later from onKeywordsClicked
- var keywords = [];
- for (var i in this.state.vectorContentRules.rules) {
- var rule = this.state.vectorContentRules.rules[i];
- keywords.push(rule.pattern);
- }
-
- if (keywords.length) {
- keywords = keywords.join(", ");
- }
- else {
- keywords = "";
- }
-
- var onKeywordsChange = function(e) {
- self.newKeywords = e.target.value;
-
- this.props.onFinished(false);
- };
-
- this.keywordsDialogDiv = (
-
-
-
-
-
-
-
-
- );
-
// Build the list of keywords rules that have been defined outside Vector UI
var externalKeyWords = [];
for (var i in this.state.externalContentRules) {
diff --git a/src/skins/vector/css/common.css b/src/skins/vector/css/common.css
index 50ffe7bb..d10fe804 100644
--- a/src/skins/vector/css/common.css
+++ b/src/skins/vector/css/common.css
@@ -187,8 +187,7 @@ input[type=text]:focus, textarea:focus, .mx_RoomSettings textarea:focus {
padding-right: 1em;
}
-.mx_ErrorDialogTitle,
-.mx_QuestionDialogTitle {
+.mx_Dialog_title {
min-height: 16px;
padding: 12px;
border-bottom: 1px solid #a4a4a4;
@@ -196,3 +195,14 @@ input[type=text]:focus, textarea:focus, .mx_RoomSettings textarea:focus {
font-size: 18px;
line-height: 1.4;
}
+
+.mx_TextInputDialog_label {
+ text-align: left;
+ padding-bottom: 12px;
+}
+
+.mx_TextInputDialog_input {
+ color: #747474;
+ font-weight: 300;
+ font-size: 15px;
+}
diff --git a/src/skins/vector/css/vector-web/views/settings/Notifications.css b/src/skins/vector/css/vector-web/views/settings/Notifications.css
index 0a50a691..76cae467 100644
--- a/src/skins/vector/css/vector-web/views/settings/Notifications.css
+++ b/src/skins/vector/css/vector-web/views/settings/Notifications.css
@@ -56,14 +56,3 @@ limitations under the License.
cursor: pointer;
color: #76cfa6;
}
-
-.mx_UserNotifSettings_keywordsLabel {
- text-align: left;
- padding-bottom: 12px;
-}
-
-.mx_UserNotifSettings_keywordsInput {
- color: #747474;
- font-weight: 300;
- font-size: 15px;
-}