From cbf28d92259b9b5d9e3136ed7dd8233f505ab2d5 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Sun, 13 Oct 2013 21:02:12 -0700 Subject: [PATCH] removes jQuery as prerequisite: - jQuery was used in two places in the code: a get() call and a click() call, both of which are unsupported by jqLite, but have workarounds. - jQuery is still used for functional testing. --- .bowerrc | 3 +++ README.md | 4 ++-- angular-contenteditable.js | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .bowerrc diff --git a/.bowerrc b/.bowerrc new file mode 100644 index 0000000..69fad35 --- /dev/null +++ b/.bowerrc @@ -0,0 +1,3 @@ +{ + "directory": "bower_components" +} diff --git a/README.md b/README.md index 5293bd5..bdd8777 100644 --- a/README.md +++ b/README.md @@ -39,6 +39,6 @@ element Y as the last element, then the behaviour of the caret is the following: ```bash npm install -grunt build -grunt karma:e2e +bower install +grunt ``` diff --git a/angular-contenteditable.js b/angular-contenteditable.js index 881533a..eeafd1c 100644 --- a/angular-contenteditable.js +++ b/angular-contenteditable.js @@ -53,7 +53,7 @@ angular.module('contenteditable', []) oldRender() } $element.html(ngModel.$viewValue || '') - el = $element.get(0) + el = $element[0] range = document.createRange() sel = window.getSelection() if (el.childNodes.length > 0) { @@ -67,7 +67,7 @@ angular.module('contenteditable', []) sel.addRange(range) } if (attrs.selectNonEditable && attrs.selectNonEditable !== "false") { - $element.click(function(e) { + $element.bind('click', function(e) { var range, sel, target target = e.toElement if (target !== this && angular.element(target).attr('contenteditable') === 'false') {