diff --git a/app/components/form-key-value/component.js b/app/components/form-key-value/component.js index 0ad68b94e..32b4c7ebd 100644 --- a/app/components/form-key-value/component.js +++ b/app/components/form-key-value/component.js @@ -63,6 +63,7 @@ export default Ember.Component.extend({ valuePlaceholder: 'Value', allowEmptyValue: false, addInitialEmptyRow: false, + allowMultilineValue: true, ary: null, asMap: null, diff --git a/app/components/form-key-value/template.hbs b/app/components/form-key-value/template.hbs index ce40c5000..07fc8cd56 100644 --- a/app/components/form-key-value/template.hbs +++ b/app/components/form-key-value/template.hbs @@ -10,19 +10,23 @@ {{#each ary as |row|}} - + {{input-paste pasted="pastedLabels" class="form-control input-sm key" type="text" value=row.key placeholder=keyPlaceholder}} - +

=

- - {{input class="form-control input-sm value" type="text" value=row.value placeholder=valuePlaceholder}} + + {{#if allowMultilineValue}} + {{textarea-autogrow class="form-control input-sm value" value=row.value placeholder=valuePlaceholder}} + {{else}} + {{input class="form-control input-sm value" type="text" value=row.value placeholder=valuePlaceholder}} + {{/if}} - + diff --git a/app/components/textarea-autogrow/component.js b/app/components/textarea-autogrow/component.js index c9f871644..2bbfcbd5b 100644 --- a/app/components/textarea-autogrow/component.js +++ b/app/components/textarea-autogrow/component.js @@ -2,14 +2,15 @@ import Ember from 'ember'; import { isGecko } from 'ui/utils/platform'; export default Ember.TextArea.extend({ - tagName: 'textarea', text: null, - classNames: [], - paddingAndBorder: null, - minHeight: 43, + minHeight: 0, maxHeight: 200, + tagName: 'textarea', + classNames: ['no-resize'], + didInsertElement() { + this.set('minHeight', ( this.get('isSmall') ? 31 : 43)); this.autoSize(); this.$().on('paste', () => { @@ -21,6 +22,10 @@ export default Ember.TextArea.extend({ this.autoSize(); }, + isSmall: function() { + return this.$().hasClass('input-sm'); + }.property(), + autoSize() { let el = this.element; let $el = $(el); @@ -29,7 +34,7 @@ export default Ember.TextArea.extend({ $el.css('height', '1px'); let border = parseInt($el.css('borderTopWidth'),10)||0 + parseInt($el.css('borderBottomWidth'),10)||0; - let magic = ( isGecko ? 1 : 2); // Sigh, but it's wrong without magic fudge + let magic = (this.get('isSmall') ? -2 : 0) + ( isGecko ? 1 : 2); // Sigh, but it's wrong without magic fudge let neu = Math.max(this.get('minHeight'), Math.min(el.scrollHeight + border + magic, this.get('maxHeight'))); $el.css('overflowY', (el.scrollHeight > neu ? 'auto' : 'hidden')); diff --git a/app/styles/layout/_layout.scss b/app/styles/layout/_layout.scss index 1f107c1d5..bace2ba55 100644 --- a/app/styles/layout/_layout.scss +++ b/app/styles/layout/_layout.scss @@ -29,10 +29,22 @@ B { background-color : $midGray; } - .inline-block { display : inline-block; } + +.valign-top { + vertical-align: top; +} + +.valign-middle { + vertical-align: middle; +} + +.valign-bottom { + vertical-align: bottom; +} + /********** * Articles (above the page info/warnings) **********/