From e3f1f101e244bde2e59c3ea2109f447634c6c607 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Wed, 20 Sep 2017 16:06:42 +0200 Subject: [PATCH] Assets: No need to calculate preview aspect ratio anymore No longer used since we went full width --- src/templates/nodes/custom/_scripts.pug | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/templates/nodes/custom/_scripts.pug b/src/templates/nodes/custom/_scripts.pug index 7c72d4d4..437ed567 100644 --- a/src/templates/nodes/custom/_scripts.pug +++ b/src/templates/nodes/custom/_scripts.pug @@ -141,21 +141,6 @@ script(type="text/javascript"). navigateTree(); }); - // Auto-scale the image preview to the right aspect ratio - var node_preview = document.getElementById("node-preview-thumbnail"); - - if (node_preview) { - node_preview.addEventListener('load', function() { - var preview_aspect = this.naturalWidth / this.naturalHeight - - if (preview_aspect > 1.0){ - $('.node-preview, .node-preview-thumbnail').css({'max-height': 'auto', 'width': '100%'}); - $('.node-preview img').css({'max-height': '100%'}); - } - - }); - } - $('#node-overlay').click(function(){ $(this).removeClass('active').hide().html(); });