Change ad_banner preview from using title to id
This commit is contained in:
1 parent
72921d6dfd
commit
7f285f4719
5 files changed
+23
-23
No files matched your search
@@ -11,7 +11,7 @@
|
||||
<div class="adbanner-list">
|
||||
<div class="adbanner-action">
|
||||
<%= link_to t("admin.ad.new_image"),new_admin_ad_banner_ad_image_path(ad_banner_tab) ,:class => "btn btn-primary"%>
|
||||
<%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(ad_banner_tab.title) , :class=>'preview_trigger btn btn-success'%>
|
||||
<%= link_to t("modal.preview"), admin_realtime_preview_ad_banner_path(ad_banner_tab) , :class=>'preview_trigger btn btn-success'%>
|
||||
</div>
|
||||
<ul class="clear">
|
||||
<%= render :partial => "ad_image_update", :collection => ad_banner_tab.ad_images,:as => :ad_image,:locals=>{:ad_banner => ad_banner_tab} %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<% if ad_banner -%>
|
||||
|
||||
<div class="modal hide fade in banner-preview" id='slideshow-<%=ad_banner.title.dehumanize%>'>
|
||||
<div class="modal hide fade in banner-preview" id="slideshow-<%=ad_banner.title.dehumanize%>">
|
||||
<div class="modal-header">
|
||||
<a class="close" data-dismiss="modal">×</a>
|
||||
<h3><%= t("modal.preview") %></h3>
|
||||
@@ -8,28 +8,30 @@
|
||||
<div class="modal-body">
|
||||
<p class="ad_banner_slideshow">
|
||||
<% preview_block_ad_images_helper(ad_banner).each do |ad_image| -%>
|
||||
<%= image_tag ad_image.file,:alt => (ad_image.title[locale] || ' '),:time_to_next => ad_banner.transition_sec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || ad_banner.context || ' ')) %>
|
||||
<%= image_tag ad_image.file,:alt => (ad_image.title[locale] || " "),:time_to_next => ad_banner.transition_sec,:link_open=> ad_image.link_open, :link_url =>((ad_image.out_link || ad_banner.context || " ")) %>
|
||||
<% end -%>
|
||||
</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<a href="#" class="btn" data-dismiss="modal"><%= t("modal.close") %></a>
|
||||
</div>
|
||||
<div>
|
||||
<script type="text/javascript" src="/static/kernel.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#slideshow-<%=ad_banner.title.dehumanize%>").on("show", function () {
|
||||
console.info("<%= ad_banner.ad_fx.nil?? "fade": ad_banner.ad_fx %>"+" <%= ad_banner.transition_msec %>");
|
||||
$("#slideshow-<%=ad_banner.title.dehumanize%>").find(".ad_banner_slideshow").cycle({delay: -1000, fx: "<%= ad_banner.ad_fx.nil?? "fade": ad_banner.ad_fx %>", timeoutFn: getTimeout });
|
||||
});
|
||||
$(".modal").on("hidden", function () {
|
||||
$("#show_preview").remove();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% end -%>
|
||||
|
||||
<script type='text/javascript' src='/static/kernel.js'></script>
|
||||
<script type='text/javascript'>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('#slideshow-<%=ad_banner.title.dehumanize%>').on('show', function () {
|
||||
$('#slideshow-banner_1').find(".ad_banner_slideshow").cycle({delay: -1000, fx: '<%= ad_banner.ad_fx.nil?? 'fade': ad_banner.ad_fx %>', timeoutFn: getTimeout });
|
||||
});
|
||||
$(".modal").on('hidden', function () {
|
||||
$("#show_preview").remove();
|
||||
});
|
||||
//$('#slideshow-<%=ad_banner.title.dehumanize%>').show();
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<% end -%>
|
||||
Reference in new issue
Block a user