Last active
September 24, 2016 03:53
-
-
Save danemacaulay/8f265420dcc82d6b5aa3a396bc09d7cf 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
(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