From 81fa78777b7f1b09fcf540b442f2020f67248dd8 Mon Sep 17 00:00:00 2001 From: Alejandro Alonso Date: Thu, 29 Oct 2015 08:18:09 +0100 Subject: [PATCH] Fixing custom field edition --- app/coffee/modules/common/custom-field-values.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/coffee/modules/common/custom-field-values.coffee b/app/coffee/modules/common/custom-field-values.coffee index 7af3f42d..f699422f 100644 --- a/app/coffee/modules/common/custom-field-values.coffee +++ b/app/coffee/modules/common/custom-field-values.coffee @@ -206,8 +206,8 @@ CustomAttributeValueDirective = ($template, $selectedText, $compile, $translate, $ctrl.updateAttributeValue(attributeValue).then -> render(attributeValue, false) - setFocusOnInputField = -> - $el.find("input[name='value'], textarea[name='value']").focus() + setFocusAndSelectOnInputField = -> + $el.find("input[name='value'], textarea[name='value']").focus().select() # Bootstrap attributeValue = $scope.$eval($attrs.tgCustomAttributeValue) @@ -218,12 +218,12 @@ CustomAttributeValueDirective = ($template, $selectedText, $compile, $translate, return if not isEditable() return if $selectedText.get().length render(attributeValue, true) - setFocusOnInputField() + setFocusAndSelectOnInputField() $el.on "click", "a.icon-edit", (event) -> event.preventDefault() render(attributeValue, true) - setFocusOnInputField() + setFocusAndSelectOnInputField() ## Actions (on edit mode) $el.on "keyup", "input[name=value], textarea[name='value']", (event) ->