Here is the updated fiddle with the changes below. Is this what you are looking for?
// Transition to the new view.
t1.selectAll("text").call(text).style("fill-opacity", 0);
t2.selectAll("text").call(text).style("fill-opacity", 1);
t2.selectAll(".overlaidText").call(middletext).style("fill-opacity", 1); // added
t1.selectAll("rect").call(rect);
t2.selectAll("rect").call(rect);