Added a boolean var to keep track of color bar target action (export or create layer).