Fix class name of full-screen control
This commit is contained in:
@@ -3,6 +3,7 @@ goog.provide('ol.control.FullScreen');
|
|||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dom');
|
goog.require('goog.dom');
|
||||||
goog.require('goog.dom.TagName');
|
goog.require('goog.dom.TagName');
|
||||||
|
goog.require('goog.dom.classlist');
|
||||||
goog.require('goog.dom.fullscreen');
|
goog.require('goog.dom.fullscreen');
|
||||||
goog.require('goog.dom.fullscreen.EventType');
|
goog.require('goog.dom.fullscreen.EventType');
|
||||||
goog.require('goog.events');
|
goog.require('goog.events');
|
||||||
@@ -138,10 +139,15 @@ ol.control.FullScreen.prototype.handleFullScreen_ = function() {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
|
ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
|
||||||
|
var opened = this.cssClassName_ + '-true';
|
||||||
|
var closed = this.cssClassName_ + '-false';
|
||||||
|
var button = goog.dom.getFirstElementChild(this.element);
|
||||||
var map = this.getMap();
|
var map = this.getMap();
|
||||||
if (goog.dom.fullscreen.isFullScreen()) {
|
if (goog.dom.fullscreen.isFullScreen()) {
|
||||||
|
goog.dom.classlist.swap(button, closed, opened);
|
||||||
goog.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
|
goog.dom.replaceNode(this.labelActiveNode_, this.labelNode_);
|
||||||
} else {
|
} else {
|
||||||
|
goog.dom.classlist.swap(button, opened, closed);
|
||||||
goog.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
|
goog.dom.replaceNode(this.labelNode_, this.labelActiveNode_);
|
||||||
}
|
}
|
||||||
if (!goog.isNull(map)) {
|
if (!goog.isNull(map)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user