From 0a2ebfc1ba866208b29a66264ae3c5b8251a940d Mon Sep 17 00:00:00 2001 From: artra Date: Tue, 11 Aug 2015 17:22:39 +0300 Subject: [PATCH] fix inherited function properties --- .../i-jquery/__inherit/i-jquery__inherit.js | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/blocks-common/i-jquery/__inherit/i-jquery__inherit.js b/blocks-common/i-jquery/__inherit/i-jquery__inherit.js index 952153d7..01e6fd6d 100644 --- a/blocks-common/i-jquery/__inherit/i-jquery__inherit.js +++ b/blocks-common/i-jquery/__inherit/i-jquery__inherit.js @@ -57,14 +57,18 @@ function override(base, result, add) { if($.isFunction(prop) && (!hasIntrospection || prop.toString().indexOf('.__base') > -1)) { - var baseMethod = base[name] || function() {}; - result[name] = function() { - var baseSaved = this.__base; - this.__base = baseMethod; - var result = prop.apply(this, arguments); - this.__base = baseSaved; - return result; - }; + var baseMethod = base[name] || function() {}, + wrapper = function() { + var baseSaved = this.__base; + this.__base = baseMethod; + var result = prop.apply(this, arguments); + this.__base = baseSaved; + return result; + }; + + for (var functionProperty in prop) { + wrapper[functionProperty] = prop[functionProperty]; + } } else {