You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

96 lines
2.3 KiB
JavaScript

$(document).ready(function(){
// index page
var modal = document.getElementById("myModal"); //$("#myModal");
var btn = document.getElementById("button");
var btn_bar = document.getElementById("button-right");
var tos_iframe = document.getElementById("tosview");
// Get the <span> element that closes the modal
var span = document.getElementsByClassName("close")[0];
// When the user clicks the button, open the modal
$( ".button-tos" ).click(function() {
var text = $(this).text().toLowerCase() + '.html';
console.log(text);
$('iframe#tosview').attr('src', text);
modal.style.display = "block";
});
// When the user clicks right menu, open the modal
$( ".button-right" ).click(function() {
var text = $(this).text().toLowerCase() + '.html';
console.log(text);
$('iframe#treatyview').attr('src', text);
modal.style.display = "block";
});
//right bar list
btn_bar.onclick = function() {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
span.onclick = function() {
modal.style.display = "none";
tos_iframe.src = tos_iframe.src;
}
// index page
var t_modal = document.getElementById("t_myModal");
var t_btn = document.getElementById("t_button");
var t_btn_bar = document.getElementById("t_button-right");
var treaty_iframe = document.getElementById("treatyview");
// Get the <span> element that closes the modal
var t_span = document.getElementsByClassName("t_close")[0];
// When the user clicks the button, open the modal
t_btn.onclick = function() {
t_modal.style.display = "block";
}
//right bar list
t_btn_bar.onclick = function() {
modal.style.display = "block";
}
// When the user clicks on <span> (x), close the modal
t_span.onclick = function() {
t_modal.style.display = "none";
treaty_iframe.src = treaty_iframe.src;
}
});
$(function(){
var overlay_modal = $('<div id="overlay-modal"></div>');
overlay_modal.show();
overlay_modal.appendTo(document.body);
$('html, body').css('position', 'fixed');
$('.myModal').show();
$('.close').click(function(){
$('.myModal').hide();
overlay_modal.appendTo(document.body).remove();
$('html, body').css("position", "relative");
return false;
});
});