fix error

This commit is contained in:
邱博亞 2021-04-10 21:16:46 +08:00
parent b5040c0d7c
commit 4cad16bd13
2 changed files with 18 additions and 12 deletions

View File

@ -516,8 +516,17 @@ var GalleryTheaterWidget = function(widget){
initialize(); initialize();
} }
if (typeof bind_gallery_widget_slide == 'undefined'){ 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(){ 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(){ $(document).ready(function(){
bind_gallery_widget_slide() bind_gallery_widget_slide()

View File

@ -1,14 +1,11 @@
<script type="text/javascript"> <div class="widget-gallery gallery widget5 no-print">
function set_gallery_height(widget){ <h3 class="widget-title">
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 <span>{{widget-title}}</span>
widget.find('.show-gallery-2.gallery').css('height',h) </h3>
} <% OrbitHelper.render_css_in_head(["theater.css"]) %>
</script> <%= javascript_include_tag "jquery.touchSwipe.min" %>
<% OrbitHelper.render_css_in_head(["theater.css"]) %> <%= javascript_include_tag "theater-widget" %>
<%= javascript_include_tag "jquery.touchSwipe.min" %> <% OrbitHelper.render_meta_tags([{"name" => "mobile-web-app-capable","content" => "yes"},{"name" => "apple-mobile-web-app-status-bar-style","content" => "black-translucent"}]) %>
<%= 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"}]) %>
<div class="widget-gallery gallery widget5 no-print" onload="GalleryTheaterWidget($(this));$(window).resize(function(){set_gallery_height($(this))});">
<div id="gallery-theater-stage"> <div id="gallery-theater-stage">
<div class="show-gallery-2 gallery" style="margin-top: 2.4em;"> <div class="show-gallery-2 gallery" style="margin-top: 2.4em;">
<div class="gallery-loader"> <div class="gallery-loader">