Add className option to ol.control.ZoomSlider

This commit is contained in:
Tom Payne
2013-05-07 16:36:25 +02:00
parent 9c59116dd1
commit b698b1736f
2 changed files with 5 additions and 21 deletions

View File

@@ -165,6 +165,7 @@
/**
* @typedef {Object} ol.control.ZoomSliderOptions
* @property {string|undefined} className Class name.
* @property {ol.Map|undefined} map Map.
* @property {number|undefined} maxResolution Maximum resolution.
* @property {number|undefined} minResolution Minimum resolution.

View File

@@ -60,10 +60,10 @@ ol.control.ZoomSlider = function(opt_options) {
*/
this.draggerListenerKeys_ = null;
var sliderCssCls = ol.control.ZoomSlider.CSS_CLASS_CONTAINER + ' ' +
ol.css.CLASS_UNSELECTABLE;
var thumbCssCls = ol.control.ZoomSlider.CSS_CLASS_THUMB + ' ' +
ol.css.CLASS_UNSELECTABLE;
var className = goog.isDef(options.className) ?
options.className : 'ol-zoomslider';
var sliderCssCls = className + ' ' + ol.css.CLASS_UNSELECTABLE;
var thumbCssCls = className + '-thumb' + ' ' + ol.css.CLASS_UNSELECTABLE;
var element = goog.dom.createDom(goog.dom.TagName.DIV, sliderCssCls,
goog.dom.createDom(goog.dom.TagName.DIV, thumbCssCls));
@@ -94,23 +94,6 @@ ol.control.ZoomSlider.direction = {
};
/**
* The CSS class that we'll give the zoomslider container.
*
* @const {string}
*/
ol.control.ZoomSlider.CSS_CLASS_CONTAINER = 'ol-zoomslider';
/**
* The CSS class that we'll give the zoomslider thumb.
*
* @const {string}
*/
ol.control.ZoomSlider.CSS_CLASS_THUMB =
ol.control.ZoomSlider.CSS_CLASS_CONTAINER + '-thumb';
/**
* @inheritDoc
*/