Skip to content

Commit b17a50d

Browse files
committed
Update README.md
1 parent 2b0ca1d commit b17a50d

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

README.md

+10-12
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,8 @@ This will create the following in ```/app/assets/javascripts/utilities/modal.js.
117117

118118
```
119119
# /app/assets/javascripts/utilities/modal.js.coffee
120-
window.App ||= {}
121-
window.App.Utility ||= {}
122-
class App.Utility.Modal
120+
window.Utility ||= {}
121+
class Utility.Modal
123122
124123
constructor: ->
125124
return this
@@ -129,9 +128,8 @@ Let's add some basic functionality:
129128

130129
```
131130
# /app/assets/javascripts/utilities/modal.js.coffee
132-
window.App ||= {}
133-
window.App.Utility ||= {}
134-
class App.Utility.Modal
131+
window.Utility ||= {}
132+
class Utility.Modal
135133
@element
136134
@trigger
137135
@isOpen = false
@@ -167,7 +165,7 @@ window.App ||= {}
167165
class App.Users extends App.Base
168166
169167
show: ->
170-
@galleryModal = new App.Utility.Modal($('#user-gallery-modal-wrapper'), $('user-gallery-modal-toggle-button'))
168+
@galleryModal = new Utility.Modal($('#user-gallery-modal-wrapper'), $('user-gallery-modal-toggle-button'))
171169
172170
```
173171

@@ -185,8 +183,8 @@ This will create the following in ```/app/assets/javascripts/elements/main_menu.
185183
```
186184
# /app/assets/javascripts/elements/main_menu.js.coffee```
187185
188-
window.App.Element ||= {}
189-
class App.Element.MainMenu
186+
window.Element ||= {}
187+
class Element.MainMenu
190188
191189
constructor: ->
192190
return this
@@ -201,7 +199,7 @@ window.App ||= {}
201199
class App.Base
202200
203201
constructor: ->
204-
App.mainMenu = new App.Element.MainMenu()
202+
App.mainMenu = new Element.MainMenu()
205203
return this
206204
```
207205

@@ -217,8 +215,8 @@ Which generates:
217215
````
218216
# /app/assets/javascripts/elements/main_menu.js.coffee
219217
220-
window.App.Element ||= {}
221-
class App.Element.MainMenu extends App.Utility.Modal
218+
window.Element ||= {}
219+
class Element.MainMenu extends Utility.Modal
222220
223221
constructor: ->
224222
return this

0 commit comments

Comments
 (0)