The click event is attached to the default blizzard bar, so if you use some custom ui it will have it's own bar (new/different frame) so that's why it doesn't work.