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
+1
View File
@@ -165,6 +165,7 @@
/** /**
* @typedef {Object} ol.control.ZoomSliderOptions * @typedef {Object} ol.control.ZoomSliderOptions
* @property {string|undefined} className Class name.
* @property {ol.Map|undefined} map Map. * @property {ol.Map|undefined} map Map.
* @property {number|undefined} maxResolution Maximum resolution. * @property {number|undefined} maxResolution Maximum resolution.
* @property {number|undefined} minResolution Minimum resolution. * @property {number|undefined} minResolution Minimum resolution.
+4 -21
View File
@@ -60,10 +60,10 @@ ol.control.ZoomSlider = function(opt_options) {
*/ */
this.draggerListenerKeys_ = null; this.draggerListenerKeys_ = null;
var sliderCssCls = ol.control.ZoomSlider.CSS_CLASS_CONTAINER + ' ' + var className = goog.isDef(options.className) ?
ol.css.CLASS_UNSELECTABLE; options.className : 'ol-zoomslider';
var thumbCssCls = ol.control.ZoomSlider.CSS_CLASS_THUMB + ' ' + var sliderCssCls = className + ' ' + ol.css.CLASS_UNSELECTABLE;
ol.css.CLASS_UNSELECTABLE; var thumbCssCls = className + '-thumb' + ' ' + ol.css.CLASS_UNSELECTABLE;
var element = goog.dom.createDom(goog.dom.TagName.DIV, sliderCssCls, var element = goog.dom.createDom(goog.dom.TagName.DIV, sliderCssCls,
goog.dom.createDom(goog.dom.TagName.DIV, thumbCssCls)); 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 * @inheritDoc
*/ */