Skip to content

Commit e5d32cd

Browse files
committed
Update method & error name
1 parent 497a82a commit e5d32cd

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

js/jquery.mapael.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,10 @@
156156
// Create Raphael paper
157157
self.paper = new Raphael(self.$map[0], self.mapConf.width, self.mapConf.height);
158158

159-
// issue #135: Check if we are drawing on a hidden paper
160-
// This is known to cause problem for Raphael and text element boundaries
161-
if (self.isPaperHidden() === true) {
159+
// issue #135: Check for Raphael bug on text element boundaries
160+
if (self.checkForRaphaelBBoxBug() === true) {
162161
self.destroy();
163-
throw new Error("Drawing on hidden paper is not supported (see src/doc for workaround)");
162+
throw new Error("Can't get boundary box for text (is your container hidden? See #135)");
164163
}
165164

166165
// add plugin class name on element
@@ -1752,7 +1751,7 @@
17521751
* Wants to override this behavior? Use prototype overriding:
17531752
* $.mapael.prototype.isPaperHidden = function() {return false;};
17541753
*/
1755-
isPaperHidden: function(){
1754+
checkForRaphaelBBoxBug: function(){
17561755
var self = this;
17571756
// Draw text, then get its boundaries
17581757
var text_elem = self.paper.text(-50, -50, "TEST");

0 commit comments

Comments
 (0)