diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/utill/selectOnFocus.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/utill/selectOnFocus.directive.js index e89ab5f70c..57e44391d5 100644 --- a/src/Umbraco.Web.UI.Client/src/common/directives/utill/selectOnFocus.directive.js +++ b/src/Umbraco.Web.UI.Client/src/common/directives/utill/selectOnFocus.directive.js @@ -3,19 +3,16 @@ angular.module("umbraco.directives") return function (scope, el, attrs) { $(el).bind("click", function () { var editmode = $(el).data("editmode"); - if (editmode) - { - //Do nothing in this case - } - else { - //initial click + //If editmode is true a click is handled like a normal click + if (!editmode) { + //Initial click, select entire text this.select(); //Set the edit mode so subsequent clicks work normally $(el).data("editmode", true) } }). bind("blur", function () { - //reset on blur + //Reset on focus lost $(el).data("editmode", false); }); };