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();
}
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()

View File

@ -1,14 +1,11 @@
<script type="text/javascript">
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)
}
</script>
<% 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"}]) %>
<div class="widget-gallery gallery widget5 no-print" onload="GalleryTheaterWidget($(this));$(window).resize(function(){set_gallery_height($(this))});">
<div class="widget-gallery gallery widget5 no-print">
<h3 class="widget-title">
<span>{{widget-title}}</span>
</h3>
<% 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"}]) %>
<div id="gallery-theater-stage">
<div class="show-gallery-2 gallery" style="margin-top: 2.4em;">
<div class="gallery-loader">