From d0cd82393285cd18eb712ff1ec7ba7afdb6f4439 Mon Sep 17 00:00:00 2001 From: Ryan Katkov Date: Thu, 5 Sep 2013 12:01:33 -0700 Subject: [PATCH] Point to the first object of $element's array --- angular-contenteditable.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/angular-contenteditable.js b/angular-contenteditable.js index 881533a..808ee64 100644 --- a/angular-contenteditable.js +++ b/angular-contenteditable.js @@ -38,8 +38,8 @@ angular.module('contenteditable', []) // the cursor disappears if the contents is empty // so we need to refocus $timeout(function(){ - $element.blur() - $element.focus() + $element[0].blur() + $element[0].focus() }) } }) @@ -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) {