From 1c83ca056c4875738a2203250edee12440269904 Mon Sep 17 00:00:00 2001 From: ali asaria Date: Mon, 18 Aug 2014 14:05:14 -0400 Subject: [PATCH] fix bug that was preventing predictable column change --- client/script.js | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/client/script.js b/client/script.js index c6744ab..7785e01 100644 --- a/client/script.js +++ b/client/script.js @@ -424,11 +424,23 @@ function onColumnChange( id, text ) { var names = Array(); - //Get the names of all the columns right from the DOM (ignore what was sent in function) + //console.log(id + " " + text ); + + //Get the names of all the columns right from the DOM $('.col').each(function() { - names.push( - $(this).text() - ); + + //get ID of current column we are traversing over + var thisID = $(this).children("h2").attr('id'); + + if (id == thisID) + { + names.push( text ); + } + else + { + names.push( $(this).text() ); + } + }); updateColumns(names);