From 3e579ee1d483e3a5b26b980762c7ccbd9e33850a Mon Sep 17 00:00:00 2001 From: marktaiwan Date: Fri, 6 Mar 2015 20:59:47 +0800 Subject: [PATCH] Bugfix: reset multifile container width #371 --- js/inline-expanding.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/js/inline-expanding.js b/js/inline-expanding.js index 8405ee6a..78e5dc68 100644 --- a/js/inline-expanding.js +++ b/js/inline-expanding.js @@ -113,6 +113,10 @@ $(document).ready(function(){ if (e.which == 2 || e.ctrlKey) // open in new tab return true; if (!$(this).data('expanded')) { + + if (~this.parentNode.className.indexOf('multifile')) + $(this).data('width') = this.parentNode.style.width; + this.parentNode.removeAttribute('style'); $(this).data('expanded', 'true'); @@ -144,7 +148,7 @@ $(document).ready(function(){ } if (~this.parentNode.className.indexOf('multifile')) - this.parentNode.style.width = (parseInt($(this).data('width'))+40)+'px'; + this.parentNode.style.width = $(this).data('width'); thumb.style.opacity = ''; thumb.style.display = '';