From 92f3ffe183f3c44efab68292a048ff97cf1370ab Mon Sep 17 00:00:00 2001 From: Bohung Date: Sun, 26 Jun 2022 22:24:44 +0800 Subject: [PATCH] Fix bug. --- app/controllers/ad_banners_controller.rb | 5 ++++- modules/ad_banner/_ad_banner_widget2_video.html.erb | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/controllers/ad_banners_controller.rb b/app/controllers/ad_banners_controller.rb index 2d1dfb7..75bc326 100644 --- a/app/controllers/ad_banners_controller.rb +++ b/app/controllers/ad_banners_controller.rb @@ -58,7 +58,8 @@ class AdBannersController < ApplicationController "banner-width" => adbanner.width, "base_image" => (base_image - 1), "timeout" => (adbanner.timeout * 1000), - "more" => "More" + "more" => "More", + "desc" => "" }, "images" => images } @@ -149,11 +150,13 @@ class AdBannersController < ApplicationController extra_before_html = ActionController::Base.helpers.stylesheet_link_tag("banner/jplayer.blue.monday.min.css") extra_after_html = ActionController::Base.helpers.javascript_include_tag("banner/jquery.jplayer.min.js") end + base_image = adbanner.base_image.nil? ? 1 : adbanner.base_image { "extras" => { "ad_fx" => adbanner.ad_fx, "speed" => adbanner.speed, "title" => adbanner.title, + "base_image" => (base_image - 1), "timeout" => (adbanner.timeout * 1000), "more" => "More", "desc" => adbanner.title, diff --git a/modules/ad_banner/_ad_banner_widget2_video.html.erb b/modules/ad_banner/_ad_banner_widget2_video.html.erb index 5c1483e..532db45 100644 --- a/modules/ad_banner/_ad_banner_widget2_video.html.erb +++ b/modules/ad_banner/_ad_banner_widget2_video.html.erb @@ -235,7 +235,7 @@ if (typeof onYouTubeIframeAPIReady !== 'function'){ }) } function onPlayerStateChange(event){ - var iframe = $(event.target.h), + var iframe = $(event.target.getIframe()), cyclediv = iframe.parents("div.cycle-slideshow"); var widget = cyclediv.parents('.ba-banner-widget-youtube'); if(event.data == YT.PlayerState.PLAYING || event.data == YT.PlayerState.BUFFERING){