Fixing hash generation
parent
9f6f080a39
commit
4d2fe26be9
|
@ -72,7 +72,8 @@ class CustomAttributesValuesController extends taiga.Controller
|
||||||
|
|
||||||
CustomAttributesValuesDirective = ($templates, $storage) ->
|
CustomAttributesValuesDirective = ($templates, $storage) ->
|
||||||
template = $templates.get("custom-attributes/custom-attributes-values.html", true)
|
template = $templates.get("custom-attributes/custom-attributes-values.html", true)
|
||||||
collapsedHash = generateHash(["custom-attributes-collapsed"])
|
collapsedHash = (type) ->
|
||||||
|
return generateHash(["custom-attributes-collapsed", type])
|
||||||
|
|
||||||
link = ($scope, $el, $attrs, $ctrls) ->
|
link = ($scope, $el, $attrs, $ctrls) ->
|
||||||
$ctrl = $ctrls[0]
|
$ctrl = $ctrls[0]
|
||||||
|
@ -83,8 +84,9 @@ CustomAttributesValuesDirective = ($templates, $storage) ->
|
||||||
$ctrl.loadCustomAttributesValues()
|
$ctrl.loadCustomAttributesValues()
|
||||||
|
|
||||||
$el.on "click", ".custom-fields-header a", ->
|
$el.on "click", ".custom-fields-header a", ->
|
||||||
collapsed = not($storage.get(collapsedHash) or false)
|
hash = collapsedHash($attrs.type)
|
||||||
$storage.set(collapsedHash, collapsed)
|
collapsed = not($storage.get(hash) or false)
|
||||||
|
$storage.set(hash, collapsed)
|
||||||
if collapsed
|
if collapsed
|
||||||
$el.find(".custom-fields-header a").removeClass("open")
|
$el.find(".custom-fields-header a").removeClass("open")
|
||||||
$el.find(".custom-fields-body").removeClass("open")
|
$el.find(".custom-fields-body").removeClass("open")
|
||||||
|
@ -96,7 +98,7 @@ CustomAttributesValuesDirective = ($templates, $storage) ->
|
||||||
$el.off()
|
$el.off()
|
||||||
|
|
||||||
templateFn = ($el, $attrs) ->
|
templateFn = ($el, $attrs) ->
|
||||||
collapsed = $storage.get(collapsedHash) or false
|
collapsed = $storage.get(collapsedHash($attrs.type)) or false
|
||||||
|
|
||||||
return template({
|
return template({
|
||||||
requiredEditionPerm: $attrs.requiredEditionPerm
|
requiredEditionPerm: $attrs.requiredEditionPerm
|
||||||
|
|
Loading…
Reference in New Issue