-
Notifications
You must be signed in to change notification settings - Fork 179
Added class for close button image #8
base: gh-pages
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,6 +93,10 @@ function InfoBubble(opt_options) { | |
| if (options['closeSrc'] == undefined) { | ||
| options['closeSrc'] = this.CLOSE_SRC_; | ||
| } | ||
|
|
||
| if (options['closeClass'] == undefined) { | ||
| options['closeClass'] = this.CLOSE_CLASS_; | ||
| } | ||
|
|
||
| this.buildDom_(); | ||
| this.setValues(options); | ||
|
|
@@ -186,6 +190,13 @@ InfoBubble.prototype.BACKGROUND_COLOR_ = '#fff'; | |
| */ | ||
| InfoBubble.prototype.CLOSE_SRC_ = 'https://maps.gstatic.com/intl/en_us/mapfiles/iw_close.gif'; | ||
|
|
||
| /** | ||
| * Default close image css class | ||
| * @const | ||
| * @private | ||
| */ | ||
| InfoBubble.prototype.CLOSE_CLASS_ = 'close-image'; | ||
|
|
||
| /** | ||
| * Extends a objects prototype by anothers. | ||
| * | ||
|
|
@@ -223,6 +234,7 @@ InfoBubble.prototype.buildDom_ = function() { | |
| close.style['zIndex'] = this.baseZIndex_ + 1; | ||
| close.style['cursor'] = 'pointer'; | ||
| close.src = this.get('closeSrc'); | ||
| close.className = this.get('closeClass'); | ||
|
|
||
| var that = this; | ||
| google.maps.event.addDomListener(close, 'click', function() { | ||
|
|
@@ -781,6 +793,18 @@ InfoBubble.prototype.setCloseSrc = function(src) { | |
| }; | ||
| InfoBubble.prototype['setCloseSrc'] = InfoBubble.prototype.setCloseSrc; | ||
|
|
||
| /** | ||
| * Set the close image css class | ||
| * | ||
| * @param {string} css class of the image used as a close icon | ||
| */ | ||
| InfoBubble.prototype.setCloseClass = function(classname) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. change classname to className |
||
| if (classname && this.close_) { | ||
| this.close_.className = classname; | ||
| } | ||
| }; | ||
| InfoBubble.prototype['setCloseClass'] = InfoBubble.prototype.setCloseClass; | ||
|
|
||
|
|
||
| /** | ||
| * Set the padding of the InfoBubble | ||
|
|
@@ -1735,7 +1759,7 @@ InfoBubble.prototype.figureOutSize_ = function() { | |
| } | ||
|
|
||
| this.contentContainer_.style['width'] = this.px(width); | ||
| this.contentContainer_.style['height'] = this.px(height); | ||
| // this.contentContainer_.style['height'] = this.px(height); | ||
|
||
| }; | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@param {string} className