diff options
author | Robert Speicher <rspeicher@gmail.com> | 2016-02-01 16:55:00 -0500 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2016-02-01 17:00:03 -0500 |
commit | 933834c4a60610710fc949daa2e15531c2c45780 (patch) | |
tree | 7b312b52c0cca80a881241866c3e43119ca235f9 /spec/javascripts | |
parent | ea11f0218a0cb8c23091965989a5b0875fd1daae (diff) | |
download | gitlab-ce-933834c4a60610710fc949daa2e15531c2c45780.tar.gz |
Allow manual resize of js-autosize textareasrs-relax-autosize
First, the autosize library was being too controlling and removed the
`resize` property from any elements to which it was attached, removing
the drag handle.
Second, we detect when the user manually resizes an autosize textarea,
and then remove the autosize behavior from it and increase its
max-height.
This should allow for the best of both worlds.
Closes #12832
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/behaviors/autosize_spec.js.coffee | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/javascripts/behaviors/autosize_spec.js.coffee b/spec/javascripts/behaviors/autosize_spec.js.coffee new file mode 100644 index 00000000000..7fc1d19c35f --- /dev/null +++ b/spec/javascripts/behaviors/autosize_spec.js.coffee @@ -0,0 +1,11 @@ +#= require behaviors/autosize + +describe 'Autosize behavior', -> + beforeEach -> + fixture.set('<textarea class="js-autosize" style="resize: vertical"></textarea>') + + it 'does not overwrite the resize property', -> + load() + expect($('textarea')).toHaveCss(resize: 'vertical') + + load = -> $(document).trigger('page:load') |