Merge pull request #1101 from taigaio/issue/4510/custom-field-height
Fix issue related to limit height in custom fieldsstable
commit
91aacc9850
|
@ -112,31 +112,23 @@ CustomAttributesValuesDirective = ($templates, $storage) ->
|
||||||
link = ($scope, $el, $attrs, $ctrls) ->
|
link = ($scope, $el, $attrs, $ctrls) ->
|
||||||
$ctrl = $ctrls[0]
|
$ctrl = $ctrls[0]
|
||||||
$model = $ctrls[1]
|
$model = $ctrls[1]
|
||||||
|
hash = collapsedHash($attrs.type)
|
||||||
|
$scope.collapsed = $storage.get(hash) or false
|
||||||
|
|
||||||
bindOnce $scope, $attrs.ngModel, (value) ->
|
bindOnce $scope, $attrs.ngModel, (value) ->
|
||||||
$ctrl.initialize($attrs.type, value.id)
|
$ctrl.initialize($attrs.type, value.id)
|
||||||
$ctrl.loadCustomAttributesValues()
|
$ctrl.loadCustomAttributesValues()
|
||||||
|
|
||||||
$el.on "click", ".custom-fields-header .collapse", ->
|
$scope.toggleCollapse = () ->
|
||||||
hash = collapsedHash($attrs.type)
|
$scope.collapsed = !$scope.collapsed
|
||||||
collapsed = not($storage.get(hash) or false)
|
$storage.set(hash, $scope.collapsed)
|
||||||
$storage.set(hash, collapsed)
|
|
||||||
if collapsed
|
|
||||||
$el.find(".custom-fields-header .icon").removeClass("open")
|
|
||||||
$el.find(".custom-fields-body").removeClass("open")
|
|
||||||
else
|
|
||||||
$el.find(".custom-fields-header .icon").addClass("open")
|
|
||||||
$el.find(".custom-fields-body").addClass("open")
|
|
||||||
|
|
||||||
$scope.$on "$destroy", ->
|
$scope.$on "$destroy", ->
|
||||||
$el.off()
|
$el.off()
|
||||||
|
|
||||||
templateFn = ($el, $attrs) ->
|
templateFn = ($el, $attrs) ->
|
||||||
collapsed = $storage.get(collapsedHash($attrs.type)) or false
|
|
||||||
|
|
||||||
return template({
|
return template({
|
||||||
requiredEditionPerm: $attrs.requiredEditionPerm
|
requiredEditionPerm: $attrs.requiredEditionPerm
|
||||||
collapsed: collapsed
|
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|
|
@ -1,8 +1,17 @@
|
||||||
section.duty-custom-fields(ng-show="ctrl.customAttributes.length")
|
section.duty-custom-fields(ng-show="ctrl.customAttributes.length")
|
||||||
div.custom-fields-header
|
.custom-fields-header
|
||||||
span(translate="COMMON.CUSTOM_ATTRIBUTES.CUSTOM_FIELDS")
|
span(translate="COMMON.CUSTOM_ATTRIBUTES.CUSTOM_FIELDS")
|
||||||
// Remove .open class on click on this button in both .icon and .custom-fields-body to close
|
a.collapse(
|
||||||
a.collapse(href="", class!="<% if (!collapsed) { %>open<% } %>")
|
href=""
|
||||||
|
ng-class="{'open': !collapsed}"
|
||||||
|
ng-click="toggleCollapse()"
|
||||||
|
)
|
||||||
tg-svg(svg-icon="icon-arrow-down")
|
tg-svg(svg-icon="icon-arrow-down")
|
||||||
div.custom-fields-body(class!="<% if (!collapsed) { %>open<% } %>")
|
.custom-fields-body(
|
||||||
div(ng-repeat="att in ctrl.customAttributes", tg-custom-attribute-value="ctrl.getAttributeValue(att)", required-edition-perm!="<%- requiredEditionPerm %>")
|
ng-show="!collapsed"
|
||||||
|
)
|
||||||
|
.custom-attribute(
|
||||||
|
ng-repeat="attr in ctrl.customAttributes"
|
||||||
|
tg-custom-attribute-value="ctrl.getAttributeValue(attr)"
|
||||||
|
required-edition-perm!="<%- requiredEditionPerm %>"
|
||||||
|
)
|
||||||
|
|
|
@ -13,10 +13,12 @@
|
||||||
}
|
}
|
||||||
.collapse {
|
.collapse {
|
||||||
display: block;
|
display: block;
|
||||||
|
transform: rotate(-90deg);
|
||||||
|
transition: .1s ease-out;
|
||||||
|
}
|
||||||
|
.open {
|
||||||
|
transform: rotate(0);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
.custom-fields-body {
|
|
||||||
@include slide(1000px, hidden, $min: 0);
|
|
||||||
}
|
}
|
||||||
.custom-field-single {
|
.custom-field-single {
|
||||||
border-bottom: 1px solid $whitish;
|
border-bottom: 1px solid $whitish;
|
||||||
|
|
Loading…
Reference in New Issue