adbanner-test/app/views/ad_banners/custom_widget_data.html.erb

28 lines
1.2 KiB
Plaintext
Raw Normal View History

<div class="hide" id="banner_data">
<div class="control-group input-content">
<label class="control-label muted" for="autoplay_video"><%=t("ad_banner.autoplay_video")%> :</label>
<div class="controls">
<%= hidden_field_tag("#{@field_name}[custom_data_field][autoplay_video]","0") %>
<%= check_box_tag("#{@field_name}[custom_data_field][autoplay_video]", "1" ,(@custom_data_field["autoplay_video"] == "1" rescue false), :id=>"autoplay_video" )%>
</div>
</div>
<div class="control-group input-content">
<label class="control-label muted" for="hide_video_tools"><%=t("ad_banner.hide_video_tools")%> :</label>
<div class="controls">
<%= hidden_field_tag("#{@field_name}[custom_data_field][hide_video_tools]","0") %>
<%= check_box_tag("#{@field_name}[custom_data_field][hide_video_tools]", "1" ,(@custom_data_field["hide_video_tools"] == "1" rescue false), :id=>"hide_video_tools" )%>
</div>
</div>
</div>
<script>
if($('#page_layout').val().indexOf("_video") != -1){
$("#banner_data").removeClass("hide");
}
$('#page_layout').on("change",function(){
if($(this).val().indexOf("_video") != -1){
$("#banner_data").removeClass("hide");
}else{
$("#banner_data").addClass("hide");
}
})
</script>