Sha256: a9b44a50beedf042aa1f965fea8a60b1f2036e158937fe47bfa4e33ecb551beb

Contents?: true

Size: 267 Bytes

Versions: 34

Compression:

Stored size: 267 Bytes

Contents

(function() {
  function dontSubmitOnEnter(event){
    event.which = event.which || event.keyCode;

    if($(event.target).is('textarea'))
      return;

    if(event.which == 13)
      preventDefault(event);
  }
  $(document).on('keydown', dontSubmitOnEnter);
})();

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
quby-5.6.6 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.6.5 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.6.3 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.6.2 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.6.1 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.6.0 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.5.0 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.4.0 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.3.1 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.3.0 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.2.0 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.1.3 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.1.2 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.1.1 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.1.0 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.0.5 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.0.4 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.0.3 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.0.2 app/assets/javascripts/quby/answers/dont_submit_on_enter.js
quby-5.0.1 app/assets/javascripts/quby/answers/dont_submit_on_enter.js