From fbf0a63845c66720707a25a0a46bcc82ca8a599d Mon Sep 17 00:00:00 2001 From: Jamey Campbell Date: Thu, 12 Nov 2015 13:24:44 -0500 Subject: [PATCH] Don't allow "width" option to supersede "maxWidth" --- src/tipso.js | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/src/tipso.js b/src/tipso.js index 83b9999..f63eefc 100644 --- a/src/tipso.js +++ b/src/tipso.js @@ -182,25 +182,19 @@ if (obj.settings.size) { tipso_bubble.addClass(obj.settings.size); } - if (obj.settings.width) { - tipso_bubble.css({ - background: obj.settings.background, - color: obj.settings.color, - width: obj.settings.width - }).hide(); - } else if (obj.settings.maxWidth){ - tipso_bubble.css({ - background: obj.settings.background, - color: obj.settings.color, - maxWidth: obj.settings.maxWidth - }).hide(); - } else { - tipso_bubble.css({ - background: obj.settings.background, - color: obj.settings.color, - width: 200 - }).hide(); - } + var bubbleCss = { + background: obj.settings.background, + color: obj.settings.color, + width: 200 + }; + + if (obj.settings.width) + bubbleCss.width = obj.settings.width; + if (obj.settings.maxWidth) + bubbleCss.maxWidth = obj.settings.maxWidth; + + tipso_bubble.css(bubbleCss).hide(); + tipso_bubble.find('.tipso_title').css({ background: obj.settings.titleBackground, color: obj.settings.titleColor