From 4cad16bd13e505968ae74fc40e7cdf257684de19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Sat, 10 Apr 2021 21:16:46 +0800 Subject: [PATCH] fix error --- app/assets/javascripts/theater-widget.js | 11 ++++++++++- modules/gallery/_gallery_widget5.html.erb | 19 ++++++++----------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/app/assets/javascripts/theater-widget.js b/app/assets/javascripts/theater-widget.js index 72207da..a3653d3 100644 --- a/app/assets/javascripts/theater-widget.js +++ b/app/assets/javascripts/theater-widget.js @@ -516,8 +516,17 @@ var GalleryTheaterWidget = function(widget){ initialize(); } if (typeof bind_gallery_widget_slide == 'undefined'){ + function set_gallery_height(widget){ + var h = widget.find('.gallery-thumb-container').height()+widget.find('.gallery-image.gal-active').height()+widget.find('.gallery-actions').height()+widget.find('.theaterButton').height()+20 + widget.find('.show-gallery-2.gallery').css('height',h) + } var bind_gallery_widget_slide = function(){ - $('.widget-gallery.widget5').trigger('onload') + $('.widget-gallery.widget5').each(function(){ + GalleryTheaterWidget($(this)); + $(window).resize(function(){ + set_gallery_height($(this)) + }); + }) } $(document).ready(function(){ bind_gallery_widget_slide() diff --git a/modules/gallery/_gallery_widget5.html.erb b/modules/gallery/_gallery_widget5.html.erb index 6b46308..70896f8 100644 --- a/modules/gallery/_gallery_widget5.html.erb +++ b/modules/gallery/_gallery_widget5.html.erb @@ -1,14 +1,11 @@ - -<% OrbitHelper.render_css_in_head(["theater.css"]) %> -<%= javascript_include_tag "jquery.touchSwipe.min" %> -<%= javascript_include_tag "theater-widget" %> -<% OrbitHelper.render_meta_tags([{"name" => "mobile-web-app-capable","content" => "yes"},{"name" => "apple-mobile-web-app-status-bar-style","content" => "black-translucent"}]) %> -