Make event handlers chainable.

This commit is contained in:
Olly Smith 2013-05-10 07:41:09 +01:00
parent e5c856fb10
commit feca1ecaeb
3 changed files with 5 additions and 3 deletions

View File

@ -12,6 +12,7 @@ class Morris.EventEmitter
unless @handlers[name]?
@handlers[name] = []
@handlers[name].push(handler)
@
fire: (name, args...) ->
if @handlers? and @handlers[name]?

View File

@ -21,7 +21,8 @@
if (this.handlers[name] == null) {
this.handlers[name] = [];
}
return this.handlers[name].push(handler);
this.handlers[name].push(handler);
return this;
};
EventEmitter.prototype.fire = function() {
@ -1266,7 +1267,7 @@
Area.prototype.fillForSeries = function(i) {
var color;
color = Raphael.rgb2hsl(this.colorFor(this.data[i], i, 'line'));
return Raphael.hsl(color.h, Math.min(255, this.options.behaveLikeLine ? color.s * 0.9 : color.s * 0.75), Math.min(255, this.options.behaveLikeLine ? color.l * 1.2 : color.l * 1.25));
return Raphael.hsl(color.h, this.options.behaveLikeLine ? color.s * 0.9 : color.s * 0.75, Math.min(0.98, this.options.behaveLikeLine ? color.l * 1.2 : color.l * 1.25));
};
Area.prototype.drawFilledPath = function(path, fill) {

2
morris.min.js vendored

File diff suppressed because one or more lines are too long