summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/snippet
diff options
context:
space:
mode:
authorConnor Shea <connor.james.shea@gmail.com>2016-06-24 12:26:11 -0600
committerSean McGivern <sean@gitlab.com>2016-08-18 21:48:10 +0100
commit0baaf490e289adb36ef7145a57f75cdab05eb01c (patch)
tree9e322e443cc729a3c5d7f31877216d8cb74fc605 /app/assets/javascripts/snippet
parentd97c83096a70ed102f993d4c484aff9c786ca831 (diff)
downloadgitlab-ce-0baaf490e289adb36ef7145a57f75cdab05eb01c.tar.gz
Only load Ace on Snippets and file edit pages.
Diffstat (limited to 'app/assets/javascripts/snippet')
-rw-r--r--app/assets/javascripts/snippet/snippet_bundle.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/app/assets/javascripts/snippet/snippet_bundle.js b/app/assets/javascripts/snippet/snippet_bundle.js
new file mode 100644
index 00000000000..093f266059d
--- /dev/null
+++ b/app/assets/javascripts/snippet/snippet_bundle.js
@@ -0,0 +1,12 @@
+/*= require_tree . */
+
+(function() {
+ $(function() {
+ editor = ace.edit("editor")
+
+ $(".snippet-form-holder form").on('submit', function() {
+ $(".snippet-file-content").val(editor.getValue());
+ });
+ });
+
+}).call(this);