Sha256: 85aac42e3cbec2331c52d750f12e93b2e0713ec1386085b189ca3c9db0c31be5

Contents?: true

Size: 686 Bytes

Versions: 3

Compression:

Stored size: 686 Bytes

Contents

const _  = require('lodash')
const is = require('is')

$(function(){
  $('form.no-enter-submit').bind("keypress", function(e) {
    if (e.keyCode == 13) {
      e.preventDefault();
      return false;
    }
  });

  $('form.disable-on-submit').on('submit', function(e){
    $(this).find(".btn").addClass('disabled')
  })
})

// Submit forms when you command + enter on a textarea
// $(function(){
// 	// submit form on command + enter if in a textarea
// 	$(document).on('keydown', 'body', function(e) {
// 		if (!(e.keyCode == 13 && e.metaKey)) return;
//
// 		var $target = $(e.target);
// 		if ($target.is('textarea')) {
// 			$target.closest('form').submit();
// 		}
// 	});
// });

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mvpkit-1.1.2 project/app/webpack/javascripts/lib/forms.js
mvpkit-1.1.1 project/app/webpack/javascripts/lib/forms.js
mvpkit-1.1.0 project/app/webpack/javascripts/lib/forms.js