From d8ba3e328babb33838567aac9b94a78ce76603a7 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 18 Jun 2014 14:55:22 +0200 Subject: [PATCH] Add mixOff function. --- app/coffee/utils.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/coffee/utils.coffee b/app/coffee/utils.coffee index 3fe4d186..a4710cdf 100644 --- a/app/coffee/utils.coffee +++ b/app/coffee/utils.coffee @@ -31,5 +31,15 @@ bindOnce = (scope, attr, continuation) => delBind() if delBind +mixOf = (base, mixins...) -> + class Mixed extends base + + for mixin in mixins by -1 #earlier mixins override later ones + for name, method of mixin:: + Mixed::[name] = method + Mixed + + taiga = @.taiga taiga.bindOnce = bindOnce +taiga.mixOf = mixOf