Last active
October 4, 2017 20:01
-
-
Save denisraslov/68c1d14a90da345793ac22ba5fc7352a to your computer and use it in GitHub Desktop.
This file contains 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
import AdminContent from 'views/adminContent'; | |
import UserContent from 'views/userContent'; | |
const Page = Backbone.View.extend({ | |
render() { | |
const contentNode = this.$('.content')[0]; | |
// Use a method of the global app instance | |
// (the model of the current user is hold there) | |
if (APP.isAdminUser()) { | |
this.contentView = new AdminContent(contentNode); | |
} else { | |
this.contentView = new UserContent(contentNode); | |
} | |
this.contentView.render(); | |
return this; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment