Widget:KeywordSearch: Difference between revisions

Jump to navigation Jump to search
Matt Pijoan (talk | contribs)
No edit summary
Matt Pijoan (talk | contribs)
No edit summary
 
(One intermediate revision by the same user not shown)
Line 19: Line 19:
<script type="text/javascript">
<script type="text/javascript">
$(document).ready(function(){CoK();});
$(document).ready(function(){CoK();});
console.log($("#examSpace").children());
 
function CoK() {
function CoK() {
         var stuffs ="<div id='formSpace'></div><div class='WBRButton' id='orOp'><br />OR</div><div class='WBRButton' id='andOp'><br />AND</div><div class='WBRButton' id='showQueries'><br />SHOW</div>";
         var stuffs ="<div id='formSpace'></div><div class='WBRButton' id='orOp'><br />OR</div><div class='WBRButton' id='andOp'><br />AND</div><div class='WBRButton' id='showQueries'><br />SHOW</div>";
Line 37: Line 37:
});
});
function clearEmptyDivs(){
function clearEmptyDivs(){
$.each($(":br"), function(){
console.log($(this).parent());
}
$.each($(".query"), function(){
$.each($(".query"), function(){
if($(this).children().length === 0){
if($(this).children().length === 0){
$("#examSpace").children().nextUntil(':not(br)').remove();
$(this).remove();
$(this).remove();
}
}

Latest revision as of 15:59, 23 October 2013