I fully agree.

What does the gaLegend provide? What's its responsibility? It sounds to me that the service opens a popup containing the metadata of a given swisstopo layer. Given that definition, I don't think the service should deal with browser events.

Also, shouldn't the service name be more explicit? gaLayerMetadataPopup maybe. And can't the service just be a function instead of an object with a get method?