Don't show empty tooltips #1299

Merged
merged 3 commits into from Feb 16, 2015

Projects

None yet

4 participants

@muffinmad
Contributor

Also make tooltip hidden on creation.
Fixing this issue

@SergioCrisostomo SergioCrisostomo added this to the 1.5.2 milestone Jan 15, 2015
@SergioCrisostomo
Member

@muffinmad nice work!

👍

@anutron anutron commented on the diff Feb 16, 2015
Source/Interface/Tips.js
@@ -170,15 +172,22 @@ this.Tips = new Class({
clearTimeout(this.timer);
this.timer = (function(){
this.container.empty();
-
+ var showTip = !this.options.hideEmpty;
@anutron
anutron Feb 16, 2015 Member

Not a blocker for shipping this, but you declare this variable just to reference it once in a conditional; I'd remove this line and reference the option directly on line 186.

@anutron
anutron Feb 16, 2015 Member

Ignore this. I see line 183...

@anutron anutron commented on the diff Feb 16, 2015
Source/Interface/Tips.js
}, this);
- this.show(element);
+ if (showTip){
+ this.show(element);
+ } else {
+ this.hide(element);
+ }
@anutron
anutron Feb 16, 2015 Member

minor style thing; MooTools style is to put these on one line:

if (true) something();
else somethingElse();

only if either of the conditional statements are > 1 line do we add braces (in which case we add braces to both clauses, even if one is one line).

At least, that used to be the convention. Again, not a blocker on shipping it.

@arian arian merged commit 7d556a0 into mootools:master Feb 16, 2015

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment