Merge pull request #13444 from themoffster/fullscreen-classname
Ensure FullScreen button has classname set on render.
This commit is contained in:
@@ -165,6 +165,7 @@ class FullScreen extends Control {
|
|||||||
|
|
||||||
const tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';
|
const tipLabel = options.tipLabel ? options.tipLabel : 'Toggle full-screen';
|
||||||
this.button_.setAttribute('type', 'button');
|
this.button_.setAttribute('type', 'button');
|
||||||
|
this.setClassName_(this.button_, this.isInFullscreen_);
|
||||||
this.button_.title = tipLabel;
|
this.button_.title = tipLabel;
|
||||||
this.button_.appendChild(this.labelNode_);
|
this.button_.appendChild(this.labelNode_);
|
||||||
|
|
||||||
|
|||||||
@@ -7,4 +7,23 @@ describe('ol.control.FullScreen', function () {
|
|||||||
expect(instance).to.be.an(FullScreen);
|
expect(instance).to.be.an(FullScreen);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('the fullscreen button', function () {
|
||||||
|
describe('when inactiveClassName is not set', function () {
|
||||||
|
it('is created with the default inactive classname set on the button', function () {
|
||||||
|
const instance = new FullScreen();
|
||||||
|
const button = instance.button_;
|
||||||
|
expect(button.className).to.equal('ol-full-screen-false');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
describe('when inactiveClassName is set', function () {
|
||||||
|
it('is created with the desired inactive classnames set on the button', function () {
|
||||||
|
const instance = new FullScreen({
|
||||||
|
inactiveClassName: 'foo bar',
|
||||||
|
});
|
||||||
|
const button = instance.button_;
|
||||||
|
expect(button.className).to.equal('foo bar');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user