diff options
author | Kevin Serrano <kevgagser@gmail.com> | 2016-06-29 04:08:43 +0800 |
---|---|---|
committer | Kevin Serrano <kevgagser@gmail.com> | 2016-06-29 04:08:43 +0800 |
commit | 4be704097fa8892928f10020f3c0803451cfc31d (patch) | |
tree | da997391fd2c11576ea1a1d8726455e18fc6bef7 /ui/app/components | |
parent | f9540cf48c9f7e42c41e9e1648bb57ee2b5d441f (diff) | |
parent | 2fd03a60fb8c536dbe56c86e1836935616ea14d8 (diff) | |
download | tangerine-wallet-browser-4be704097fa8892928f10020f3c0803451cfc31d.tar tangerine-wallet-browser-4be704097fa8892928f10020f3c0803451cfc31d.tar.gz tangerine-wallet-browser-4be704097fa8892928f10020f3c0803451cfc31d.tar.bz2 tangerine-wallet-browser-4be704097fa8892928f10020f3c0803451cfc31d.tar.lz tangerine-wallet-browser-4be704097fa8892928f10020f3c0803451cfc31d.tar.xz tangerine-wallet-browser-4be704097fa8892928f10020f3c0803451cfc31d.tar.zst tangerine-wallet-browser-4be704097fa8892928f10020f3c0803451cfc31d.zip |
Merge branch 'master' into title-truncate
Diffstat (limited to 'ui/app/components')
-rw-r--r-- | ui/app/components/editable-label.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/app/components/editable-label.js b/ui/app/components/editable-label.js index 3d7ca17d4..05ffd4c92 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) }, @@ -44,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 }) } |