From 86a1eaadf188b0879ae41a5fa125649ad51f0118 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 28 Jun 2016 11:30:55 -0700 Subject: Enforce 30 character limit on wallet name. --- ui/app/components/editable-label.js | 1 + 1 file changed, 1 insertion(+) (limited to 'ui') diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index 3d7ca17d4..6b3e8cb28 100644 --- a/ui/app/components/editable-label.js +++ b/ui/app/components/editable-label.js @@ -18,6 +18,7 @@ EditableLabel.prototype.render = function () { return h('div.editable-label', [ h('input.sizing-input', { defaultValue: props.textValue, + maxLength: "30", onKeyPress: (event) => { this.saveIfEnter(event) }, -- cgit v1.2.3 From a69882df720afd47fda4f238a77d97c81aaa0cdf Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 28 Jun 2016 11:34:30 -0700 Subject: Additional length check just in case. --- ui/app/components/editable-label.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index 6b3e8cb28..34fd7e3e0 100644 --- a/ui/app/components/editable-label.js +++ b/ui/app/components/editable-label.js @@ -45,6 +45,7 @@ EditableLabel.prototype.saveIfEnter = function (event) { EditableLabel.prototype.saveText = function () { var container = findDOMNode(this) var text = container.querySelector('.editable-label input').value - this.props.saveText(text) - this.setState({ isEditingLabel: false, textLabel: text }) + var truncatedText = text.substring(0,30) + this.props.saveText(truncatedText) + this.setState({ isEditingLabel: false, textLabel: truncatedText }) } -- cgit v1.2.3 From abcf7621847220f0709eb37cca0fd93cd0632bd5 Mon Sep 17 00:00:00 2001 From: Kevin Serrano Date: Tue, 28 Jun 2016 12:49:17 -0700 Subject: Code style fix. --- ui/app/components/editable-label.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui') diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index 34fd7e3e0..05ffd4c92 100644 --- a/ui/app/components/editable-label.js +++ b/ui/app/components/editable-label.js @@ -18,7 +18,7 @@ EditableLabel.prototype.render = function () { return h('div.editable-label', [ h('input.sizing-input', { defaultValue: props.textValue, - maxLength: "30", + maxLength: '30', onKeyPress: (event) => { this.saveIfEnter(event) }, @@ -45,7 +45,7 @@ EditableLabel.prototype.saveIfEnter = function (event) { EditableLabel.prototype.saveText = function () { var container = findDOMNode(this) var text = container.querySelector('.editable-label input').value - var truncatedText = text.substring(0,30) + var truncatedText = text.substring(0, 30) this.props.saveText(truncatedText) this.setState({ isEditingLabel: false, textLabel: truncatedText }) } -- cgit v1.2.3