This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
2012-04-17 03:34:25 +00:00
|
|
|
//Preview need a link in form as Ex and a corresponding PUT action in controller
|
|
|
|
//Ex preview trigger:
|
|
|
|
// <%= link_to "NewPreview", realtime_preview_admin_ad_banner_path(ad_banner_tab) , :class=>'preview_trigger'%>
|
|
|
|
|
|
|
|
$(document).ready(function() {
|
|
|
|
$("a.preview_trigger").click(function(){
|
2012-04-17 08:03:48 +00:00
|
|
|
$(this).after("<span id='show_preview'></span>");
|
2012-04-17 03:34:25 +00:00
|
|
|
$.ajax({
|
2012-04-18 07:26:59 +00:00
|
|
|
type:"put",
|
2012-04-17 03:34:25 +00:00
|
|
|
url:$(this).attr("href"),
|
|
|
|
data:$(this).parents("form").serialize()
|
|
|
|
}).done(function(){ $("#"+start_modal_with_id).modal('show');});
|
|
|
|
return false;}
|
|
|
|
);
|
|
|
|
});
|