Rename _ol_control_Attribution_ to Attribution

This commit is contained in:
Tim Schaub
2017-12-14 12:56:38 -07:00
parent b74203b846
commit 46e5755f40
4 changed files with 20 additions and 20 deletions

View File

@@ -1,11 +1,11 @@
import _ol_Map_ from '../src/ol/Map.js';
import _ol_View_ from '../src/ol/View.js';
import _ol_control_ from '../src/ol/control.js';
import _ol_control_Attribution_ from '../src/ol/control/Attribution.js';
import Attribution from '../src/ol/control/Attribution.js';
import _ol_layer_Tile_ from '../src/ol/layer/Tile.js';
import _ol_source_OSM_ from '../src/ol/source/OSM.js';
var attribution = new _ol_control_Attribution_({
var attribution = new Attribution({
collapsible: false
});
var map = new _ol_Map_({

View File

@@ -2,7 +2,7 @@
* @module ol/control
*/
import _ol_Collection_ from './Collection.js';
import _ol_control_Attribution_ from './control/Attribution.js';
import Attribution from './control/Attribution.js';
import _ol_control_Rotate_ from './control/Rotate.js';
import _ol_control_Zoom_ from './control/Zoom.js';
var _ol_control_ = {};
@@ -39,7 +39,7 @@ _ol_control_.defaults = function(opt_options) {
var attributionControl = options.attribution !== undefined ?
options.attribution : true;
if (attributionControl) {
controls.push(new _ol_control_Attribution_(options.attributionOptions));
controls.push(new Attribution(options.attributionOptions));
}
return controls;

View File

@@ -25,7 +25,7 @@ import _ol_obj_ from '../obj.js';
* @param {olx.control.AttributionOptions=} opt_options Attribution options.
* @api
*/
var _ol_control_Attribution_ = function(opt_options) {
var Attribution = function(opt_options) {
var options = opt_options ? opt_options : {};
@@ -110,7 +110,7 @@ var _ol_control_Attribution_ = function(opt_options) {
element.appendChild(this.ulElement_);
element.appendChild(button);
var render = options.render ? options.render : _ol_control_Attribution_.render;
var render = options.render ? options.render : Attribution.render;
_ol_control_Control_.call(this, {
element: element,
@@ -139,7 +139,7 @@ var _ol_control_Attribution_ = function(opt_options) {
};
inherits(_ol_control_Attribution_, _ol_control_Control_);
inherits(Attribution, _ol_control_Control_);
/**
@@ -148,7 +148,7 @@ inherits(_ol_control_Attribution_, _ol_control_Control_);
* @return {Array.<string>} Attributions.
* @private
*/
_ol_control_Attribution_.prototype.getSourceAttributions_ = function(frameState) {
Attribution.prototype.getSourceAttributions_ = function(frameState) {
/**
* Used to determine if an attribution already exists.
* @type {Object.<string, boolean>}
@@ -208,7 +208,7 @@ _ol_control_Attribution_.prototype.getSourceAttributions_ = function(frameState)
* @this {ol.control.Attribution}
* @api
*/
_ol_control_Attribution_.render = function(mapEvent) {
Attribution.render = function(mapEvent) {
this.updateElement_(mapEvent.frameState);
};
@@ -217,7 +217,7 @@ _ol_control_Attribution_.render = function(mapEvent) {
* @private
* @param {?olx.FrameState} frameState Frame state.
*/
_ol_control_Attribution_.prototype.updateElement_ = function(frameState) {
Attribution.prototype.updateElement_ = function(frameState) {
if (!frameState) {
if (this.renderedVisible_) {
this.element.style.display = 'none';
@@ -265,7 +265,7 @@ _ol_control_Attribution_.prototype.updateElement_ = function(frameState) {
* @param {?olx.FrameState} frameState Frame state.
* @private
*/
_ol_control_Attribution_.prototype.insertLogos_ = function(frameState) {
Attribution.prototype.insertLogos_ = function(frameState) {
var logo;
var logos = frameState.logos;
@@ -309,7 +309,7 @@ _ol_control_Attribution_.prototype.insertLogos_ = function(frameState) {
* @param {Event} event The event to handle
* @private
*/
_ol_control_Attribution_.prototype.handleClick_ = function(event) {
Attribution.prototype.handleClick_ = function(event) {
event.preventDefault();
this.handleToggle_();
};
@@ -318,7 +318,7 @@ _ol_control_Attribution_.prototype.handleClick_ = function(event) {
/**
* @private
*/
_ol_control_Attribution_.prototype.handleToggle_ = function() {
Attribution.prototype.handleToggle_ = function() {
this.element.classList.toggle('ol-collapsed');
if (this.collapsed_) {
replaceNode(this.collapseLabel_, this.label_);
@@ -334,7 +334,7 @@ _ol_control_Attribution_.prototype.handleToggle_ = function() {
* @return {boolean} True if the widget is collapsible.
* @api
*/
_ol_control_Attribution_.prototype.getCollapsible = function() {
Attribution.prototype.getCollapsible = function() {
return this.collapsible_;
};
@@ -344,7 +344,7 @@ _ol_control_Attribution_.prototype.getCollapsible = function() {
* @param {boolean} collapsible True if the widget is collapsible.
* @api
*/
_ol_control_Attribution_.prototype.setCollapsible = function(collapsible) {
Attribution.prototype.setCollapsible = function(collapsible) {
if (this.collapsible_ === collapsible) {
return;
}
@@ -363,7 +363,7 @@ _ol_control_Attribution_.prototype.setCollapsible = function(collapsible) {
* @param {boolean} collapsed True if the widget is collapsed.
* @api
*/
_ol_control_Attribution_.prototype.setCollapsed = function(collapsed) {
Attribution.prototype.setCollapsed = function(collapsed) {
if (!this.collapsible_ || this.collapsed_ === collapsed) {
return;
}
@@ -377,7 +377,7 @@ _ol_control_Attribution_.prototype.setCollapsed = function(collapsed) {
* @return {boolean} True if the widget is collapsed.
* @api
*/
_ol_control_Attribution_.prototype.getCollapsed = function() {
Attribution.prototype.getCollapsed = function() {
return this.collapsed_;
};
export default _ol_control_Attribution_;
export default Attribution;

View File

@@ -1,7 +1,7 @@
import _ol_Map_ from '../../../../src/ol/Map.js';
import _ol_Tile_ from '../../../../src/ol/Tile.js';
import _ol_View_ from '../../../../src/ol/View.js';
import _ol_control_Attribution_ from '../../../../src/ol/control/Attribution.js';
import Attribution from '../../../../src/ol/control/Attribution.js';
import _ol_layer_Tile_ from '../../../../src/ol/layer/Tile.js';
import _ol_source_Tile_ from '../../../../src/ol/source/Tile.js';
import _ol_tilegrid_ from '../../../../src/ol/tilegrid.js';
@@ -15,7 +15,7 @@ describe('ol.control.Attribution', function() {
document.body.appendChild(target);
map = new _ol_Map_({
target: target,
controls: [new _ol_control_Attribution_({
controls: [new Attribution({
collapsed: false,
collapsible: false
})],