Sha256: 1ebe705b2b5dec7a1ae84b77d02cbb6662f5ae23dc0b4a83d1ccff331f849784
Contents?: true
Size: 845 Bytes
Versions: 19
Compression:
Stored size: 845 Bytes
Contents
ELA.Models ?= {} class ELA.Models.BaseSubappContainer extends ELA.Models.BaseAppModel subapps: {} initialize: (options = {}) -> @subappInstances = {} for name, app of @subapps AppModel = app.model.toFunction() @subappInstances[name] = new AppModel parentApp: this @on 'change:path', @handlePath @handlePath() handlePath: => path = @get('path') subapp = path[0] if _.isEmpty(path) subappPath = @subappInfo()[0].path ELA.router.navigate "app/#{subappPath}", trigger: false replace: true [..., last] = subappPath.split('/') path.push(last) @subappInstances[subapp]?.set(path: path.slice(1)) subappInfo: -> for name, app of @subappInstances name: app.name path: app.path currentApp: -> @subappInstances[@get('path')[0]]
Version data entries
19 entries across 19 versions & 1 rubygems