             $el.off()
 
     templateFn = ($el, $attrs) ->
-        collapsed = $storage.get(collapsedHash) or false
+        collapsed = $storage.get(collapsedHash($attrs.type)) or false
 
         return template({
             requiredEditionPerm: $attrs.requiredEditionPerm


CustomAttributesValuesDirective = ($templates, $storage) ->
    template = $templates.get("custom-attributes/custom-attributes-values.html", true)
    collapsedHash = generateHash(["custom-attributes-collapsed"])

    link = ($scope, $el, $attrs, $ctrls) ->
        $ctrl = $ctrls[0]

            $ctrl.loadCustomAttributesValues()

        $el.on "click", ".custom-fields-header a", ->
            hash = collapsedHash($attrs.type)
            collapsed = not($storage.get(hash) or false)
            $storage.set(hash, collapsed)
            if collapsed
                $el.find(".custom-fields-header a").removeClass("open")
                $el.find(".custom-fields-body").removeClass("open")
