fix conflict

This commit is contained in:
chiu 2020-04-11 17:28:58 +08:00
parent 6851cc868b
commit e25594cc98
1 changed files with 20 additions and 18 deletions

View File

@ -9,24 +9,26 @@
<%= render :partial=> "approval_modal" %>
<script type="text/javascript">
var modal = $("#approvalModal");
$(document).on("click", ".approval_button",function(){
var url = $(this).attr("href");
if(window.location.protocol === "https:"){
url = url.replace("http:","https:");
}
modal.find("iframe").attr("src", url);
modal.find("#object_id").val($(this).data("id"));
modal.modal("show");
return false;
})
$(function{
var modal = $("#approvalModal");
$(document).on("click", ".approval_button",function(){
var url = $(this).attr("href");
if(window.location.protocol === "https:"){
url = url.replace("http:","https:");
}
modal.find("iframe").attr("src", url);
modal.find("#object_id").val($(this).data("id"));
modal.modal("show");
return false;
})
var params = getUrlVars();
console.log(params["url"])
if(typeof params["url"] != "undefined"){
modal.find("iframe").attr("src", params["url"]);
modal.find("#object_id").val(params["id"]);
modal.modal("show");
}
var params = getUrlVars();
console.log(params["url"])
if(typeof params["url"] != "undefined"){
modal.find("iframe").attr("src", params["url"]);
modal.find("#object_id").val(params["id"]);
modal.modal("show");
}
})
</script>
<% end %>