Firebrick Class
A lightweight JavaScript MVC Framework powered with jQuery, Knockout JS and Require JS
Item Index
Methods
Properties
Methods
addListener
()
shortcut for Firebrick.events.addListener
application
-
options
ready function to kick start the application
Parameters:
-
options
Object-
ready
Object{Function} - called on document ready
-
app
Object-
name
Objectname of the app -
path
Objectpath of the app
-
-
autoRender
Object{Boolean} whether to call first view automatically "{app.name}.view.Index",
-
viewData
Object{Object} viewData to be passed to the autoRender view,
-
splash
Object{String} - html or string to be rendered before the document is loaded - removed on document.ready
-
require
Object{String, Array of Strings} file(s) are required
-
cache
Object{Boolean} [cache=true] whether require should cache files or not,
-
dev
Object{Boolean} [dev=false] true to print requirejs exceptions to console
-
lang
Objectlanguage file name or store,
-
create
()
shortcut for Firebrick.classes:create
createController
()
shortcut for Firebrick.controllers.createController
createStore
()
shortcut for Firebrick.data.store.createStore
createView
()
shortcut for Firebrick.views.createView
define
()
shortcut for Firebrick.classes:define
defineView
()
shortcut for Firebrick.views.defineView
delay
()
shortcut for Firebrick.utils.delay
fireEvent
()
shortcut for Firebrick.events.fireEvent
get
()
shortcut for Firebrick.classes:get
getBody
()
shortcut for Firebrick.views.getBody
getById
()
shortcut for Firebrick.classes:getById
loadRaw
()
shortcut for Firebrick.views.loadRaw
off
()
shortcut for Firebrick.events.off
on
()
shortcut for Firebrick.events.on
removeListener
()
shortcut for Firebrick.events.removeListener
require
()
shortcut for Firebrick.utils.require
shortcut
-
scope
-
func
-
args
Parameters:
-
scope
Object -
func
String -
args
Args..
Returns:
stackTrace
-
force
show stackTrace at any given point by creating an error. This will only work if the application is in "dev" mode.
Parameters:
-
force
Boolean[default=false] set to true to force the stacktrace in prod mode too
Returns:
stack trace
text
()
shortcut for Firebrick.languages.getByKey
Properties
_ns
Array
private
Default: [app.name]
app.name
Object
private
used to store configurations set Firebrick.ready()
scrollContainerSelector
String
Default: "body, html"
scrollTopOffset
Integer | Function
this is used in conjunction with "scrollTo" url parameter. This is needed if you have a fixed header for example and the browser scroll the anchor to position 0 which is behind the header - effectively cutting off content
Default: 0