Skip to content

Commit

Permalink
feat(generators/demo): add logic to determine the $appRoot element.
Browse files Browse the repository at this point in the history
Often, the `document` and the app will share the same root elemenet, but not necessarily so.

Omitted when `generators/app` was changed on commit 8e8e0d4.
  • Loading branch information
cueedee committed Oct 9, 2017
1 parent 2721ef0 commit f7e5989
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion generators/demo/templates/src/index.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var buildRun = 'build-run=' + encodeURIComponent( buildRun );

%>
<html lang="en-GB">
<html class="<@= packageName @>" lang="en-GB">
<head><%

//
Expand Down
17 changes: 13 additions & 4 deletions generators/demo/templates/src/router.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
if typeof exports is 'object'
module.exports = factory(
require( 'backbone' )
require( 'underscore' )

require( 'jquery' )
require( 'madlib-settings' )
require( 'underscore' )

require( './views/navigation.coffee' )

require( './views/index.coffee' )
require( './views/i18n.coffee' )
require( './views/documentation.coffee' )
Expand All @@ -13,9 +17,13 @@
else if typeof define is 'function' and define.amd
define( [
'backbone'
'underscore'

'jquery'
'madlib-settings'
'underscore'

'./views/navigation.coffee'

'./views/index.coffee'
'./views/i18n.coffee'
'./views/documentation.coffee'
Expand All @@ -24,8 +32,9 @@
return
)((
Backbone
_
$
settings
_

NavigationView

Expand Down Expand Up @@ -193,7 +202,7 @@
# @final
###

@$mainContent = $( '#main-content' )
@$mainContent = settings.get( '$appRoot' ).find( '#main-content' )

###*
# A handle on the current View instance loaded into `@$mainContent` container.
Expand Down

0 comments on commit f7e5989

Please sign in to comment.