Desktop markdown wiki app. Built with node, Electron Framework and AngularJS.

ng-enter.js 450B

123456789101112131415
  1. angular.module('codexApp')
  2. .directive('ngEnter', function() {
  3. return function(scope, element, attrs) {
  4. element.bind("keydown keypress", function(event) {
  5. if(event.which === 13) {
  6. scope.$apply(function(){
  7. scope.$eval(attrs.ngEnter);
  8. });
  9. event.preventDefault();
  10. }
  11. });
  12. };
  13. });