Hide hover tooltip if empty

This commit is contained in:
mikach 2014-04-01 14:10:54 +03:00
parent d31c072942
commit 9532354320
3 changed files with 15 additions and 8 deletions

View File

@ -11,6 +11,9 @@ class Morris.Hover
@options.parent.append(@el) @options.parent.append(@el)
update: (html, x, y) -> update: (html, x, y) ->
if not html
@hide()
else
@html(html) @html(html)
@show() @show()
@moveTo(x, y) @moveTo(x, y)

View File

@ -663,9 +663,13 @@ Licensed under the BSD-2-Clause License.
} }
Hover.prototype.update = function(html, x, y) { Hover.prototype.update = function(html, x, y) {
if (!html) {
return this.hide();
} else {
this.html(html); this.html(html);
this.show(); this.show();
return this.moveTo(x, y); return this.moveTo(x, y);
}
}; };
Hover.prototype.html = function(content) { Hover.prototype.html = function(content) {

4
morris.min.js vendored

File diff suppressed because one or more lines are too long