forked from marionettejs/backbone.marionette
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5090557
commit 061dd23
Showing
12 changed files
with
214 additions
and
853 deletions.
There are no files selected for viewing
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import _ from 'underscore'; | ||
import MarionetteError from '../utils/error'; | ||
|
||
// return the region instance from the definition | ||
export default function(definition, regionClass) { | ||
if (_.isString(definition)) { | ||
definition = { el: definition }; | ||
} | ||
|
||
if (!_.isString(definition.el)) { | ||
console.log(definition); | ||
throw new MarionetteError({ | ||
message: 'Improper region configuration type.', | ||
url: 'marionette.region.html#defining-regions' | ||
}); | ||
} | ||
|
||
return _.extend({ regionClass }, definition); | ||
} |
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
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
Oops, something went wrong.