70 lines
1.7 KiB
JavaScript
Executable File
70 lines
1.7 KiB
JavaScript
Executable File
$(document).ready(function() {
|
|
// Color
|
|
$(".pick-a-color").spectrum(
|
|
{
|
|
type: "text",
|
|
showAlpha: false
|
|
}
|
|
);
|
|
$(".pick-a-color").attr("autocomplete","off");
|
|
|
|
// method confirm
|
|
var doit = true;
|
|
$("a[data-method]").on('click',function(){
|
|
if($(this).data('confirm')){
|
|
doit = confirm($(this).data('confirm'));
|
|
if(!doit) return false;
|
|
}
|
|
});
|
|
$("button[data-method]").on('click',function(){
|
|
if($(this).data('confirm')){
|
|
doit = confirm($(this).data('confirm'));
|
|
if(!doit) return false;
|
|
}
|
|
});
|
|
|
|
// Modal
|
|
$(".btn-modal").click(function() {
|
|
$("#"+$(this).data("modalid")+" .modal-title").text($(this).data("modaltitle"));
|
|
$("#"+$(this).data("modalid")+" iframe").attr("src",$(this).data("modalurl"));
|
|
$("#"+$(this).data("modalid")).modal("show");
|
|
});
|
|
|
|
// Resize
|
|
resize();
|
|
|
|
|
|
// Focus
|
|
$("#page").focus();
|
|
});
|
|
|
|
$( window ).resize(function() {
|
|
resize();
|
|
});
|
|
|
|
|
|
function resize() {
|
|
console.log("resize");
|
|
|
|
if($("#header").is(":visible")){
|
|
$(".navbar-logo").hide();
|
|
$("#menulink").hide();
|
|
$("#header").hide();
|
|
}
|
|
else {
|
|
$(".navbar-logo").show();
|
|
$("#menulink").show();
|
|
$("#header").show();
|
|
}
|
|
|
|
var footerheight=$("footer").height();
|
|
if(footerheight) footerheight=footerheight+10;
|
|
else footerheight=0;
|
|
console.log(footerheight);
|
|
|
|
$("main").css("height",$(window).height()-$(".header").height()-footerheight);
|
|
$("#page").css("height",$(window).height()-$(".header").height()-footerheight);
|
|
$("#sidebar").css("min-height",$("body").height()-$(".header").height());
|
|
}
|
|
|