-
-
Save esseti/6609b19a9023b3899878f3860de52417 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
//this makes all the panels of the same size | |
function resize_panel(selector, what) { | |
if (what == undefined) | |
what = '.panel-body'; | |
var objs = $(selector).find(what); | |
var o_h = 0; | |
objs.each(function () { | |
if (o_h < $(this).height()) { | |
o_h = $(this).height(); | |
} | |
}); | |
objs.each(function () { | |
$(this).height(o_h); | |
}); | |
}; | |
resize_panel('.panel', '.panel-heading'); | |
resize_panel('.panel', '.panel-body'); | |
resize_panel('.panel', '.panel-footer'); | |
//this adds panel-primary (green stuff) to the panel when checkbox is selected | |
$('.purpose').click(function () { | |
var checkbox = $(this).find('input[type=checkbox]'); | |
console.log($(this)); | |
checkbox.prop("checked", !checkbox.prop("checked")); | |
if (checkbox.prop("checked")) { | |
$(this).addClass('panel-primary'); | |
} else { | |
$(this).removeClass('panel-primary'); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment