Last active
August 29, 2015 14:22
-
-
Save RenatoUtsch/0a94b94ff3eb1994e375 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Calls the functions from the behaviors in order and then the function | |
* from the element, if it exists. | |
*/ | |
_inheritanceCall: function(name) { | |
var args = arguments.slice(1); | |
for(b in this.behaviors) { | |
b[name].apply(this, args); | |
} | |
// Call the one from the element also, if it exists. | |
if(this[name] != this.behaviors[this.behaviors.length - 1][name]) | |
this[name].apply(this, args); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment