Skip to content

Commit

Permalink
Added "elements" and "events" attributes inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
umate committed Mar 13, 2013
1 parent af5554a commit 9ee7217
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/spine.coffee
Expand Up @@ -417,6 +417,10 @@ class Controller extends Module
@events = @constructor.events unless @events
@elements = @constructor.elements unless @elements

if parent_prototype = @constructor.prototype.__proto__
@events = $.extend({}, parent_prototype.events, @events) if parent_prototype.events
@elements = $.extend({}, parent_prototype.elements, @elements) if parent_prototype.elements

@delegateEvents(@events) if @events
@refreshElements() if @elements

Expand Down

0 comments on commit 9ee7217

Please sign in to comment.