Edit basic custom field style and visual behavior

stable
Xavier Julián 2015-02-20 08:57:49 +01:00 committed by David Barragán Merino
parent 74331bbbc0
commit e1c0e2e7af
2 changed files with 9 additions and 6 deletions

View File

@ -145,6 +145,7 @@ CustomAttributeValueDirective = ($template, $selectedText) ->
saveAttributeValue = ->
attributeValue.value = $el.find("input").val()
$el.find('.custom-field-single').removeClass('editable')
$scope.$apply ->
$ctrl.updateAttributeValue(attributeValue).then ->
@ -167,6 +168,7 @@ CustomAttributeValueDirective = ($template, $selectedText) ->
event.preventDefault()
render(attributeValue, true)
$el.find("input[name='description']").focus().select()
$el.find('.custom-field-single').addClass('editable')
## Actions (on edit mode)
submit = debounce 2000, (event) =>

View File

@ -23,19 +23,20 @@
@include slide(1000px, hidden, $min: 0);
}
.custom-field-single {
align-content: center;
align-items: center;
border-bottom: 1px solid $whitish;
display: flex;
padding: 1rem;
&:last-child {
border-bottom: 0;
}
&:hover {
.custom-field-options {
opacity: 1;
}
}
&.editable {
.custom-field-options {
align-items: center;
display: flex;
}
}
.custom-field-options {
opacity: 0;
transition: opacity .2s linear;
@ -63,7 +64,7 @@
}
.custom-field-value {
flex: 1;
padding-right: 2rem;
padding: 0 1rem 0 2rem;
}
form {
label {