Skip to content

Instantly share code, notes, and snippets.

@danemacaulay
Last active September 24, 2016 03:53
Show Gist options
  • Save danemacaulay/8f265420dcc82d6b5aa3a396bc09d7cf to your computer and use it in GitHub Desktop.
Save danemacaulay/8f265420dcc82d6b5aa3a396bc09d7cf to your computer and use it in GitHub Desktop.
(function() {
'use strict';
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
addGlobalStyle('#soar_manage_member tr.missing { background-color: #ffb3d1; }');
function isRowEmpty(row){
var checkBoxes = $('td > input', row);
var checked = checkBoxes.filter(function(){
return this.checked;
});
return checked.length===0;
}
function checkRow(event){
$(event.currentTarget).toggleClass("missing", isRowEmpty(event.currentTarget));
}
var scoutRow = $('#smngmembers > tbody > tr');
scoutRow.change(checkRow);
scoutRow.change();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment