summaryrefslogtreecommitdiff
path: root/spec/javascripts
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-02-01 16:55:00 -0500
committerRobert Speicher <rspeicher@gmail.com>2016-02-01 17:00:03 -0500
commit933834c4a60610710fc949daa2e15531c2c45780 (patch)
tree7b312b52c0cca80a881241866c3e43119ca235f9 /spec/javascripts
parentea11f0218a0cb8c23091965989a5b0875fd1daae (diff)
downloadgitlab-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.coffee11
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')