Skip to content
This repository was archived by the owner on Dec 15, 2018. It is now read-only.
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion src/infobubble.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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.
*
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@param {string} className

*/
InfoBubble.prototype.setCloseClass = function(classname) {
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -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);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove this line?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I had an issue with varied height content. If I set MaxHeight, for example, 400px, It applies it as css height:400px, which is not ideal. It means even if content is shorter, it will make infoBubble longer. If content is longer than it adds scrollbar. Both of them are not acceptable. So, I just removed the height thing from my script.
It may not be the issue for others, You can ignore that particular line change.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't just ignore the line change unfortunately. <yoda>Merge or do not merge, there is no ignore. </yoda>

If you remove this change I'll merge it in.

};


Expand Down