From 688f119942e7fa4dfc669927320c66f99e78a6ce Mon Sep 17 00:00:00 2001 From: Robert Linder Date: Sun, 6 Feb 2022 21:01:34 +0100 Subject: [PATCH] Hide the attribution separator from ATs (#7969) Co-Authored-By: nkreer <15277434+nkreer@users.noreply.github.com> Co-authored-by: nkreer <15277434+nkreer@users.noreply.github.com> --- .../suites/control/Control.AttributionSpec.js | 30 +++++++++---------- src/control/Control.Attribution.js | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/spec/suites/control/Control.AttributionSpec.js b/spec/suites/control/Control.AttributionSpec.js index 919354f0b..f9cb7c270 100644 --- a/spec/suites/control/Control.AttributionSpec.js +++ b/spec/suites/control/Control.AttributionSpec.js @@ -24,19 +24,19 @@ describe("Control.Attribution", function () { describe('#addAttribution', function () { it('adds one attribution correctly', function () { control.addAttribution('foo'); - expect(container.innerHTML).to.eql('prefix | foo'); + expect(container.innerHTML).to.eql('prefix foo'); }); it('adds no duplicate attributions', function () { control.addAttribution('foo'); control.addAttribution('foo'); - expect(container.innerHTML).to.eql('prefix | foo'); + expect(container.innerHTML).to.eql('prefix foo'); }); it('adds several attributions listed with comma', function () { control.addAttribution('foo'); control.addAttribution('bar'); - expect(container.innerHTML).to.eql('prefix | foo, bar'); + expect(container.innerHTML).to.eql('prefix foo, bar'); }); }); @@ -45,7 +45,7 @@ describe("Control.Attribution", function () { control.addAttribution('foo'); control.addAttribution('bar'); control.removeAttribution('foo'); - expect(container.innerHTML).to.eql('prefix | bar'); + expect(container.innerHTML).to.eql('prefix bar'); }); it('does nothing if removing attribution that was not present', function () { control.addAttribution('foo'); @@ -54,7 +54,7 @@ describe("Control.Attribution", function () { control.removeAttribution('baz'); control.removeAttribution('baz'); control.removeAttribution(''); - expect(container.innerHTML).to.eql('prefix | foo'); + expect(container.innerHTML).to.eql('prefix foo'); }); }); @@ -83,16 +83,16 @@ describe("Control.Attribution", function () { expect(container.innerHTML).to.eql('prefix'); map.addLayer(fooLayer); - expect(container.innerHTML).to.eql('prefix | foo'); + expect(container.innerHTML).to.eql('prefix foo'); map.addLayer(barLayer); - expect(container.innerHTML).to.eql('prefix | foo, bar'); + expect(container.innerHTML).to.eql('prefix foo, bar'); map.addLayer(bazLayer); - expect(container.innerHTML).to.eql('prefix | foo, bar, baz'); + expect(container.innerHTML).to.eql('prefix foo, bar, baz'); map.removeLayer(fooLayer); - expect(container.innerHTML).to.eql('prefix | bar, baz'); + expect(container.innerHTML).to.eql('prefix bar, baz'); map.removeLayer(barLayer); - expect(container.innerHTML).to.eql('prefix | baz'); + expect(container.innerHTML).to.eql('prefix baz'); map.removeLayer(bazLayer); expect(container.innerHTML).to.eql('prefix'); }); @@ -107,16 +107,16 @@ describe("Control.Attribution", function () { expect(container.innerHTML).to.eql('prefix'); map.addLayer(fooLayer); - expect(container.innerHTML).to.eql('prefix | foo'); + expect(container.innerHTML).to.eql('prefix foo'); map.addLayer(fo2Layer); - expect(container.innerHTML).to.eql('prefix | foo'); + expect(container.innerHTML).to.eql('prefix foo'); map.addLayer(fo3Layer); - expect(container.innerHTML).to.eql('prefix | foo'); + expect(container.innerHTML).to.eql('prefix foo'); map.removeLayer(fooLayer); - expect(container.innerHTML).to.eql('prefix | foo'); + expect(container.innerHTML).to.eql('prefix foo'); map.removeLayer(fo2Layer); - expect(container.innerHTML).to.eql('prefix | foo'); + expect(container.innerHTML).to.eql('prefix foo'); map.removeLayer(fo3Layer); expect(container.innerHTML).to.eql('prefix'); }); diff --git a/src/control/Control.Attribution.js b/src/control/Control.Attribution.js index 6177c48e6..1898fd85a 100644 --- a/src/control/Control.Attribution.js +++ b/src/control/Control.Attribution.js @@ -119,7 +119,7 @@ export var Attribution = Control.extend({ prefixAndAttribs.push(attribs.join(', ')); } - this._container.innerHTML = prefixAndAttribs.join(' | '); + this._container.innerHTML = prefixAndAttribs.join(' '); } });