Newer jQuery syntax

pull/1/head
Joe Biellik 8 years ago
parent e87841e5a0
commit db9ec4eec9

@ -1,16 +1,16 @@
/* eslint-env browser */ /* eslint-env browser */
/* global $ autosize */ /* global $ autosize */
$(document).ready(function() { $(function() {
autosize($('textarea')); autosize($('textarea'));
$('textarea').keydown(function(e) { $('textarea').on('keydown', function(e) {
if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey && $(this).val()) { if ((e.keyCode == 10 || e.keyCode == 13) && e.ctrlKey && $(this).val()) {
$(this).closest('form').submit(); $(this).closest('form').submit();
} }
}); });
$('pre').click(function() { $('pre').on('click', function() {
var range = document.createRange(); var range = document.createRange();
range.setStart(this.firstChild, 19); range.setStart(this.firstChild, 19);
@ -20,7 +20,7 @@ $(document).ready(function() {
window.getSelection().addRange(range); window.getSelection().addRange(range);
}); });
$('select#highlight').change(function() { $('select#highlight').on('change', function() {
location.hash = $(this).val(); location.hash = $(this).val();
}); });

Loading…
Cancel
Save