From a4e415f1e359870896b2332d5d1bc33c8d32af27 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Tue, 27 Mar 2018 19:46:34 +0200 Subject: [PATCH] Assets: Trim the first part of the asset type Usually "image" or "application". Also special treatment for .blend files e.g. application/x-blender becomes blend logo --- src/templates/nodes/custom/_scripts.pug | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/templates/nodes/custom/_scripts.pug b/src/templates/nodes/custom/_scripts.pug index 16f91268..05fbbc76 100644 --- a/src/templates/nodes/custom/_scripts.pug +++ b/src/templates/nodes/custom/_scripts.pug @@ -138,3 +138,12 @@ script(type="text/javascript"). } {% endif %} + + var $content_type = $(".js-type"); + var type_value = $content_type.text(); + var type_value_trimmed = type_value.substring(type_value.indexOf("/") + 1); + $content_type.text(type_value_trimmed); + + if (type_value_trimmed == 'x-blender' || type_value_trimmed == 'blend'){ + $content_type.html(''); + };