try debugging "undefined watched global"
This commit is contained in:
parent
50de5c85d5
commit
028c7645fc
160
assets/javascripts/vendor/ember.js
vendored
160
assets/javascripts/vendor/ember.js
vendored
|
@ -2128,6 +2128,10 @@ function flushPendingChains() {
|
|||
forEach.call(queue, function(q) { q[0].add(q[1]); });
|
||||
|
||||
Ember.warn('Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0);
|
||||
|
||||
if(pendingQueue.length > 0) {
|
||||
console.log(pendingQueue)
|
||||
}
|
||||
}
|
||||
|
||||
/** @private */
|
||||
|
@ -3523,7 +3527,7 @@ Ember.RunLoop = RunLoop;
|
|||
call.
|
||||
|
||||
Ember.run(function(){
|
||||
// code to be execute within a RunLoop
|
||||
// code to be execute within a RunLoop
|
||||
});
|
||||
|
||||
@name run
|
||||
|
@ -3561,7 +3565,7 @@ var run = Ember.run;
|
|||
an lower-level way to use a RunLoop instead of using Ember.run().
|
||||
|
||||
Ember.run.begin();
|
||||
// code to be execute within a RunLoop
|
||||
// code to be execute within a RunLoop
|
||||
Ember.run.end();
|
||||
|
||||
|
||||
|
@ -3577,7 +3581,7 @@ Ember.run.begin = function() {
|
|||
instead of using Ember.run().
|
||||
|
||||
Ember.run.begin();
|
||||
// code to be execute within a RunLoop
|
||||
// code to be execute within a RunLoop
|
||||
Ember.run.end();
|
||||
|
||||
@returns {void}
|
||||
|
@ -5321,7 +5325,7 @@ Ember.inspect = function(obj) {
|
|||
/**
|
||||
Compares two objects, returning true if they are logically equal. This is
|
||||
a deeper comparison than a simple triple equal. For sets it will compare the
|
||||
internal objects. For any other object that implements `isEqual()` it will
|
||||
internal objects. For any other object that implements `isEqual()` it will
|
||||
respect that method.
|
||||
|
||||
Ember.isEqual('hello', 'hello'); => true
|
||||
|
@ -5504,7 +5508,7 @@ Ember.String = {
|
|||
> beta
|
||||
> gamma
|
||||
|
||||
@param {String} str
|
||||
@param {String} str
|
||||
The string to split
|
||||
|
||||
@returns {String} split string
|
||||
|
@ -5513,7 +5517,7 @@ Ember.String = {
|
|||
|
||||
/**
|
||||
Converts a camelized string into all lower case separated by underscores.
|
||||
|
||||
|
||||
'innerHTML'.decamelize() => 'inner_html'
|
||||
'action_name'.decamelize() => 'action_name'
|
||||
'css-class-name'.decamelize() => 'css-class-name'
|
||||
|
@ -5530,7 +5534,7 @@ Ember.String = {
|
|||
|
||||
/**
|
||||
Replaces underscores or spaces with dashes.
|
||||
|
||||
|
||||
'innerHTML'.dasherize() => 'inner-html'
|
||||
'action_name'.dasherize() => 'action-name'
|
||||
'css-class-name'.dasherize() => 'css-class-name'
|
||||
|
@ -5697,7 +5701,7 @@ if (Ember.EXTEND_PROTOTYPES) {
|
|||
|
||||
/**
|
||||
The `property` extension of Javascript's Function prototype is available
|
||||
when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
|
||||
Computed properties allow you to treat a function like a property:
|
||||
|
||||
|
@ -5752,7 +5756,7 @@ if (Ember.EXTEND_PROTOTYPES) {
|
|||
|
||||
/**
|
||||
The `observes` extension of Javascript's Function prototype is available
|
||||
when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
|
||||
You can observe property changes simply by adding the `observes`
|
||||
call to the end of your method declarations in classes that you write.
|
||||
|
@ -5763,7 +5767,7 @@ if (Ember.EXTEND_PROTOTYPES) {
|
|||
// Executes whenever the "value" property changes
|
||||
}.observes('value')
|
||||
});
|
||||
|
||||
|
||||
@see Ember.Observable
|
||||
*/
|
||||
Function.prototype.observes = function() {
|
||||
|
@ -5773,7 +5777,7 @@ if (Ember.EXTEND_PROTOTYPES) {
|
|||
|
||||
/**
|
||||
The `observesBefore` extension of Javascript's Function prototype is
|
||||
available when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
available when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
|
||||
You can get notified when a property changes is about to happen by
|
||||
by adding the `observesBefore` call to the end of your method
|
||||
|
@ -5784,7 +5788,7 @@ if (Ember.EXTEND_PROTOTYPES) {
|
|||
// Executes whenever the "value" property is about to change
|
||||
}.observesBefore('value')
|
||||
});
|
||||
|
||||
|
||||
@see Ember.Observable
|
||||
*/
|
||||
Function.prototype.observesBefore = function() {
|
||||
|
@ -7385,7 +7389,7 @@ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
|
|||
colors.clear(); => []
|
||||
colors.length(); => 0
|
||||
|
||||
@returns {Ember.Array} An empty Array.
|
||||
@returns {Ember.Array} An empty Array.
|
||||
*/
|
||||
clear: function () {
|
||||
var len = get(this, 'length');
|
||||
|
@ -7593,15 +7597,15 @@ var get = Ember.get, set = Ember.set, defineProperty = Ember.defineProperty;
|
|||
@class
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
This mixin provides properties and property observing functionality, core
|
||||
features of the Ember object model.
|
||||
|
||||
|
||||
Properties and observers allow one object to observe changes to a
|
||||
property on another object. This is one of the fundamental ways that
|
||||
models, controllers and views communicate with each other in an Ember
|
||||
application.
|
||||
|
||||
|
||||
Any object that has this mixin applied can be used in observer
|
||||
operations. That includes Ember.Object and most objects you will
|
||||
interact with as you write your Ember application.
|
||||
|
@ -7609,16 +7613,16 @@ var get = Ember.get, set = Ember.set, defineProperty = Ember.defineProperty;
|
|||
Note that you will not generally apply this mixin to classes yourself,
|
||||
but you will use the features provided by this module frequently, so it
|
||||
is important to understand how to use it.
|
||||
|
||||
|
||||
## Using get() and set()
|
||||
|
||||
|
||||
Because of Ember's support for bindings and observers, you will always
|
||||
access properties using the get method, and set properties using the
|
||||
set method. This allows the observing objects to be notified and
|
||||
computed properties to be handled properly.
|
||||
|
||||
|
||||
More documentation about `get` and `set` are below.
|
||||
|
||||
|
||||
## Observing Property Changes
|
||||
|
||||
You typically observe property changes simply by adding the `observes`
|
||||
|
@ -7630,7 +7634,7 @@ var get = Ember.get, set = Ember.set, defineProperty = Ember.defineProperty;
|
|||
// Executes whenever the "value" property changes
|
||||
}.observes('value')
|
||||
});
|
||||
|
||||
|
||||
Although this is the most common way to add an observer, this capability
|
||||
is actually built into the Ember.Object class on top of two methods
|
||||
defined in this mixin: `addObserver` and `removeObserver`. You can use
|
||||
|
@ -7643,12 +7647,12 @@ var get = Ember.get, set = Ember.set, defineProperty = Ember.defineProperty;
|
|||
|
||||
This will call the `targetAction` method on the `targetObject` to be called
|
||||
whenever the value of the `propertyKey` changes.
|
||||
|
||||
Note that if `propertyKey` is a computed property, the observer will be
|
||||
called when any of the property dependencies are changed, even if the
|
||||
|
||||
Note that if `propertyKey` is a computed property, the observer will be
|
||||
called when any of the property dependencies are changed, even if the
|
||||
resulting value of the computed property is unchanged. This is necessary
|
||||
because computed properties are not computed until `get` is called.
|
||||
|
||||
|
||||
@extends Ember.Mixin
|
||||
*/
|
||||
Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
||||
|
@ -7662,7 +7666,7 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
This method is usually similar to using object[keyName] or object.keyName,
|
||||
however it supports both computed properties and the unknownProperty
|
||||
handler.
|
||||
|
||||
|
||||
Because `get` unifies the syntax for accessing all these kinds
|
||||
of properties, it can make many refactorings easier, such as replacing a
|
||||
simple property with a computed property, or vice versa.
|
||||
|
@ -7858,11 +7862,11 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
Ember.propertyDidChange(this, keyName);
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
Convenience method to call `propertyWillChange` and `propertyDidChange` in
|
||||
succession.
|
||||
|
||||
|
||||
@param {String} keyName The property key to be notified about.
|
||||
@returns {Ember.Observable}
|
||||
*/
|
||||
|
@ -7954,7 +7958,7 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
This method will be called when a client attempts to get the value of a
|
||||
property that has not been defined in one of the typical ways. Override
|
||||
this method to create "virtual" properties.
|
||||
|
||||
|
||||
@param {String} key The name of the unknown property that was requested.
|
||||
@returns {Object} The property value or undefined. Default is undefined.
|
||||
*/
|
||||
|
@ -7966,7 +7970,7 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
This method will be called when a client attempts to set the value of a
|
||||
property that has not been defined in one of the typical ways. Override
|
||||
this method to create "virtual" properties.
|
||||
|
||||
|
||||
@param {String} key The name of the unknown property to be set.
|
||||
@param {Object} value The value the unknown property is to be set to.
|
||||
*/
|
||||
|
@ -7999,9 +8003,9 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
/**
|
||||
Retrieves the value of a property, or a default value in the case that the property
|
||||
returns undefined.
|
||||
|
||||
|
||||
person.getWithDefault('lastName', 'Doe');
|
||||
|
||||
|
||||
@param {String} keyName The name of the property to retrieve
|
||||
@param {Object} defaultValue The value to return if the property value is undefined
|
||||
@returns {Object} The property value or the defaultValue.
|
||||
|
@ -8012,10 +8016,10 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
|
||||
/**
|
||||
Set the value of a property to the current value plus some amount.
|
||||
|
||||
|
||||
person.incrementProperty('age');
|
||||
team.incrementProperty('score', 2);
|
||||
|
||||
|
||||
@param {String} keyName The name of the property to increment
|
||||
@param {Object} increment The amount to increment by. Defaults to 1
|
||||
@returns {Object} The new property value
|
||||
|
@ -8025,13 +8029,13 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
set(this, keyName, (get(this, keyName) || 0)+increment);
|
||||
return get(this, keyName);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
Set the value of a property to the current value minus some amount.
|
||||
|
||||
|
||||
player.decrementProperty('lives');
|
||||
orc.decrementProperty('health', 5);
|
||||
|
||||
|
||||
@param {String} keyName The name of the property to decrement
|
||||
@param {Object} increment The amount to decrement by. Defaults to 1
|
||||
@returns {Object} The new property value
|
||||
|
@ -8045,9 +8049,9 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
/**
|
||||
Set the value of a boolean property to the opposite of it's
|
||||
current value.
|
||||
|
||||
|
||||
starship.toggleProperty('warpDriveEnaged');
|
||||
|
||||
|
||||
@param {String} keyName The name of the property to toggle
|
||||
@returns {Object} The new property value
|
||||
*/
|
||||
|
@ -11557,7 +11561,7 @@ var invokeForState = {
|
|||
`Ember.View` is the class in Ember responsible for encapsulating templates of HTML
|
||||
content, combining templates with data to render as sections of a page's DOM, and
|
||||
registering and responding to user-initiated events.
|
||||
|
||||
|
||||
## HTML Tag
|
||||
The default HTML tag name used for a view's DOM representation is `div`. This can be
|
||||
customized by setting the `tagName` property. The following view class:
|
||||
|
@ -11583,7 +11587,7 @@ var invokeForState = {
|
|||
<div id="ember1" class="ember-view my-class my-other-class"></div>
|
||||
|
||||
`class` attribute values can also be set by providing a `classNameBindings` property
|
||||
set to an array of properties names for the view. The return value of these properties
|
||||
set to an array of properties names for the view. The return value of these properties
|
||||
will be added as part of the value for the view's `class` attribute. These properties
|
||||
can be computed properties:
|
||||
|
||||
|
@ -11612,7 +11616,7 @@ var invokeForState = {
|
|||
|
||||
<div id="ember1" class="ember-view hovered"></div>
|
||||
|
||||
When using boolean class name bindings you can supply a string value other than the
|
||||
When using boolean class name bindings you can supply a string value other than the
|
||||
property name for use as the `class` HTML attribute by appending the preferred value after
|
||||
a ":" character when defining the binding:
|
||||
|
||||
|
@ -11690,11 +11694,11 @@ var invokeForState = {
|
|||
<div id="ember1" class="ember-view disabled"></div>
|
||||
|
||||
|
||||
Updates to the the value of a class name binding will result in automatic update
|
||||
Updates to the the value of a class name binding will result in automatic update
|
||||
of the HTML `class` attribute in the view's rendered HTML representation.
|
||||
If the value becomes `false` or `undefined` the class name will be removed.
|
||||
|
||||
Both `classNames` and `classNameBindings` are concatenated properties.
|
||||
Both `classNames` and `classNameBindings` are concatenated properties.
|
||||
See `Ember.Object` documentation for more information about concatenated properties.
|
||||
|
||||
## HTML Attributes
|
||||
|
@ -11740,7 +11744,7 @@ var invokeForState = {
|
|||
}.property()
|
||||
})
|
||||
|
||||
Updates to the the property of an attribute binding will result in automatic update
|
||||
Updates to the the property of an attribute binding will result in automatic update
|
||||
of the HTML attribute in the view's rendered HTML representation.
|
||||
|
||||
`attributeBindings` is a concatenated property. See `Ember.Object` documentation
|
||||
|
@ -11831,7 +11835,7 @@ var invokeForState = {
|
|||
primary templates, layouts can be any function that accepts an optional context
|
||||
parameter and returns a string of HTML that will be inserted inside view's tag. Views whose HTML
|
||||
element is self closing (e.g. `<input />`) cannot have a layout and this property will be ignored.
|
||||
|
||||
|
||||
Most typically in Ember a layout will be a compiled Ember.Handlebars template.
|
||||
|
||||
A view's layout can be set directly with the `layout` property or reference an
|
||||
|
@ -11856,7 +11860,7 @@ var invokeForState = {
|
|||
See `Handlebars.helpers.yield` for more information.
|
||||
|
||||
## Responding to Browser Events
|
||||
Views can respond to user-initiated events in one of three ways: method implementation,
|
||||
Views can respond to user-initiated events in one of three ways: method implementation,
|
||||
through an event manager, and through `{{action}}` helper use in their template or layout.
|
||||
|
||||
### Method Implementation
|
||||
|
@ -11873,8 +11877,8 @@ var invokeForState = {
|
|||
### Event Managers
|
||||
Views can define an object as their `eventManager` property. This object can then
|
||||
implement methods that match the desired event names. Matching events that occur
|
||||
on the view's rendered HTML or the rendered HTML of any of its DOM descendants
|
||||
will trigger this method. A `jQuery.Event` object will be passed as the first
|
||||
on the view's rendered HTML or the rendered HTML of any of its DOM descendants
|
||||
will trigger this method. A `jQuery.Event` object will be passed as the first
|
||||
argument to the method and an `Ember.View` object as the second. The `Ember.View`
|
||||
will be the view whose rendered HTML was interacted with. This may be the view with
|
||||
the `eventManager` property or one of its descendent views.
|
||||
|
@ -11908,7 +11912,7 @@ var invokeForState = {
|
|||
|
||||
Similarly a view's event manager will take precedence for events of any views
|
||||
rendered as a descendent. A method name that matches an event name will not be called
|
||||
if the view instance was rendered inside the HTML representation of a view that has
|
||||
if the view instance was rendered inside the HTML representation of a view that has
|
||||
an `eventManager` property defined that handles events of the name. Events not handled
|
||||
by the event manager will still trigger method calls on the descendent.
|
||||
|
||||
|
@ -11930,7 +11934,7 @@ var invokeForState = {
|
|||
// eventManager doesn't handle click events
|
||||
},
|
||||
mouseEnter: function(event){
|
||||
// will never be called if rendered inside
|
||||
// will never be called if rendered inside
|
||||
// an OuterView.
|
||||
}
|
||||
})
|
||||
|
@ -11951,7 +11955,7 @@ var invokeForState = {
|
|||
Form events: 'submit', 'change', 'focusIn', 'focusOut', 'input'
|
||||
|
||||
HTML5 drag and drop events: 'dragStart', 'drag', 'dragEnter', 'dragLeave', 'drop', 'dragEnd'
|
||||
|
||||
|
||||
## Handlebars `{{view}}` Helper
|
||||
Other `Ember.View` instances can be included as part of a view's template by using the `{{view}}`
|
||||
Handlebars helper. See `Handlebars.helpers.view` for additional information.
|
||||
|
@ -14404,7 +14408,7 @@ var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
|
|||
@class
|
||||
|
||||
`Ember.CollectionView` is an `Ember.View` descendent responsible for managing a
|
||||
collection (an array or array-like object) by maintaing a child view object and
|
||||
collection (an array or array-like object) by maintaing a child view object and
|
||||
associated DOM representation for each item in the array and ensuring that child
|
||||
views and their associated rendered HTML are updated when items in the array
|
||||
are added, removed, or replaced.
|
||||
|
@ -14448,7 +14452,7 @@ var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
|
|||
|
||||
## Automatic matching of parent/child tagNames
|
||||
|
||||
Setting the `tagName` property of a `CollectionView` to any of
|
||||
Setting the `tagName` property of a `CollectionView` to any of
|
||||
"ul", "ol", "table", "thead", "tbody", "tfoot", "tr", or "select" will result
|
||||
in the item views receiving an appropriately matched `tagName` property.
|
||||
|
||||
|
@ -16468,7 +16472,7 @@ var merge = function(original, hash) {
|
|||
Respectively, loading the page at the URL '#/alphabeta' would detect the route property of
|
||||
'root.bRoute' ('/alphabeta') and transition the router first to the state named 'root' and
|
||||
then to the substate 'bRoute'.
|
||||
|
||||
|
||||
## Adding Nested Routes to a Router
|
||||
Routes can contain nested subroutes each with their own `route` property describing the nested
|
||||
portion of the URL they would like to detect and handle. Router, like all instances of StateManager,
|
||||
|
@ -16476,27 +16480,27 @@ var merge = function(original, hash) {
|
|||
intermediary state when detecting URLs, a Route with nested routes must define both a base `route`
|
||||
property for itself and a child Route with a `route` property of `'/'` which will be transitioned
|
||||
to when the base route is detected in the URL:
|
||||
|
||||
|
||||
Given the following application code:
|
||||
|
||||
App = Ember.Application.create({
|
||||
Router: Ember.Router.extend({
|
||||
root: Ember.Route.extend({
|
||||
aRoute: Ember.Route.extend({
|
||||
route: '/theBaseRouteForThisSet',
|
||||
|
||||
route: '/theBaseRouteForThisSet',
|
||||
|
||||
indexSubRoute: Ember.Route.extend({
|
||||
route: '/',
|
||||
}),
|
||||
|
||||
|
||||
subRouteOne: Ember.Route.extend({
|
||||
route: '/subroute1
|
||||
}),
|
||||
|
||||
|
||||
subRouteTwo: Ember.Route.extend({
|
||||
route: '/subRoute2'
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -16505,10 +16509,10 @@ var merge = function(original, hash) {
|
|||
|
||||
When the application is loaded at '/theBaseRouteForThisSet' the Router will transition to the route
|
||||
at path 'root.aRoute' and then transition to state 'indexSubRoute'.
|
||||
|
||||
|
||||
When the application is loaded at '/theBaseRouteForThisSet/subRoute1' the Router will transition to
|
||||
the route at path 'root.aRoute' and then transition to state 'subRouteOne'.
|
||||
|
||||
|
||||
## Route Transition Events
|
||||
Transitioning between Ember.Route instances (including the transition into the detected
|
||||
route when loading the application) triggers the same transition events as state transitions for
|
||||
|
@ -18890,7 +18894,7 @@ EmberHandlebars.ViewHelper = Ember.Object.create({
|
|||
Will result in HTML structure:
|
||||
|
||||
<body>
|
||||
<!-- Note: the handlebars template script
|
||||
<!-- Note: the handlebars template script
|
||||
also results in a rendered Ember.View
|
||||
which is the outer <div> here -->
|
||||
|
||||
|
@ -18912,7 +18916,7 @@ EmberHandlebars.ViewHelper = Ember.Object.create({
|
|||
})
|
||||
|
||||
aView.appendTo('body')
|
||||
|
||||
|
||||
Will result in HTML structure:
|
||||
|
||||
<div id="ember1" class="ember-view">
|
||||
|
@ -18986,7 +18990,7 @@ EmberHandlebars.ViewHelper = Ember.Object.create({
|
|||
Will result in the following HTML:
|
||||
|
||||
<div id="ember1" class="ember-view">
|
||||
<div id="ember2" class="ember-view a-custom-view-class-as-property">
|
||||
<div id="ember2" class="ember-view a-custom-view-class-as-property">
|
||||
hi
|
||||
</div>
|
||||
</div>
|
||||
|
@ -19146,7 +19150,7 @@ var get = Ember.get, getPath = Ember.Handlebars.getPath, fmt = Ember.String.fmt;
|
|||
<p class="ember-view greeting">Howdy Mary</p>
|
||||
<p class="ember-view greeting">Howdy Sara</p>
|
||||
</div>
|
||||
|
||||
|
||||
@name Handlebars.helpers.collection
|
||||
@param {String} path
|
||||
@param {Hash} options
|
||||
|
@ -19471,7 +19475,7 @@ ActionHelper.registerAction = function(actionName, options) {
|
|||
The `{{action}}` helper registers an HTML element within a template for
|
||||
DOM event handling and forwards that interaction to the Application's router,
|
||||
the template's `Ember.View` instance, or supplied `target` option (see 'Specifiying a Target').
|
||||
|
||||
|
||||
User interaction with that element will invoke the supplied action name on
|
||||
the appropriate target.
|
||||
|
||||
|
@ -19516,7 +19520,7 @@ ActionHelper.registerAction = function(actionName, options) {
|
|||
If you need the default handler to trigger you should either register your
|
||||
own event handler, or use event methods on your view class. See Ember.View
|
||||
'Responding to Browser Events' for more information.
|
||||
|
||||
|
||||
### Specifying DOM event type
|
||||
|
||||
By default the `{{action}}` helper registers for DOM `click` events. You can
|
||||
|
@ -19536,23 +19540,23 @@ ActionHelper.registerAction = function(actionName, options) {
|
|||
`Ember.EventDispatcher` instance will be created when a new
|
||||
`Ember.Application` is created. Having an instance of `Ember.Application`
|
||||
will satisfy this requirement.
|
||||
|
||||
|
||||
|
||||
|
||||
### Specifying a Target
|
||||
There are several possible target objects for `{{action}}` helpers:
|
||||
|
||||
|
||||
In a typical `Ember.Router`-backed Application where views are managed
|
||||
through use of the `{{outlet}}` helper, actions will be forwarded to the
|
||||
current state of the Applications's Router. See Ember.Router 'Responding
|
||||
to User-initiated Events' for more information.
|
||||
|
||||
|
||||
If you manaully set the `target` property on the controller of a template's
|
||||
`Ember.View` instance, the specifed `controller.target` will become the target
|
||||
for any actions. Likely custom values for a controller's `target` are the
|
||||
controller itself or a StateManager other than the Application's Router.
|
||||
|
||||
|
||||
If the templates's view lacks a controller property the view itself is the target.
|
||||
|
||||
|
||||
Finally, a `target` option can be provided to the helper to change which object
|
||||
will receive the method call. This option must be a string representing a
|
||||
path to an object:
|
||||
|
@ -19607,7 +19611,7 @@ ActionHelper.registerAction = function(actionName, options) {
|
|||
|
||||
Will throw `Uncaught TypeError: Cannot call method 'call' of undefined` when
|
||||
"click me" is clicked.
|
||||
|
||||
|
||||
### Specifying a context
|
||||
|
||||
By default the `{{action}}` helper passes the current Handlebars context
|
||||
|
@ -19817,7 +19821,7 @@ var set = Ember.set, get = Ember.get;
|
|||
/**
|
||||
@class
|
||||
|
||||
Creates an HTML input of type 'checkbox' with HTML related properties
|
||||
Creates an HTML input of type 'checkbox' with HTML related properties
|
||||
applied directly to the input.
|
||||
|
||||
{{view Ember.Checkbox classNames="applicaton-specific-checkbox"}}
|
||||
|
@ -20128,7 +20132,7 @@ var get = Ember.get, set = Ember.set;
|
|||
|
||||
## Layout and LayoutName properties
|
||||
|
||||
Because HTML `textarea` elements do not contain inner HTML the `layout` and `layoutName`
|
||||
Because HTML `textarea` elements do not contain inner HTML the `layout` and `layoutName`
|
||||
properties will not be applied. See `Ember.View`'s layout section for more information.
|
||||
|
||||
@extends Ember.View
|
||||
|
|
|
@ -4082,6 +4082,10 @@ function flushPendingChains() {
|
|||
forEach.call(queue, function(q) { q[0].add(q[1]); });
|
||||
|
||||
Ember.warn('Watching an undefined global, Ember expects watched globals to be setup by the time the run loop is flushed, check for typos', pendingQueue.length === 0);
|
||||
|
||||
if(pendingQueue.length > 0) {
|
||||
console.log(pendingQueue)
|
||||
}
|
||||
}
|
||||
|
||||
/** @private */
|
||||
|
@ -5477,7 +5481,7 @@ Ember.RunLoop = RunLoop;
|
|||
call.
|
||||
|
||||
Ember.run(function(){
|
||||
// code to be execute within a RunLoop
|
||||
// code to be execute within a RunLoop
|
||||
});
|
||||
|
||||
@name run
|
||||
|
@ -5515,7 +5519,7 @@ var run = Ember.run;
|
|||
an lower-level way to use a RunLoop instead of using Ember.run().
|
||||
|
||||
Ember.run.begin();
|
||||
// code to be execute within a RunLoop
|
||||
// code to be execute within a RunLoop
|
||||
Ember.run.end();
|
||||
|
||||
|
||||
|
@ -5531,7 +5535,7 @@ Ember.run.begin = function() {
|
|||
instead of using Ember.run().
|
||||
|
||||
Ember.run.begin();
|
||||
// code to be execute within a RunLoop
|
||||
// code to be execute within a RunLoop
|
||||
Ember.run.end();
|
||||
|
||||
@returns {void}
|
||||
|
@ -7275,7 +7279,7 @@ Ember.inspect = function(obj) {
|
|||
/**
|
||||
Compares two objects, returning true if they are logically equal. This is
|
||||
a deeper comparison than a simple triple equal. For sets it will compare the
|
||||
internal objects. For any other object that implements `isEqual()` it will
|
||||
internal objects. For any other object that implements `isEqual()` it will
|
||||
respect that method.
|
||||
|
||||
Ember.isEqual('hello', 'hello'); => true
|
||||
|
@ -7458,7 +7462,7 @@ Ember.String = {
|
|||
> beta
|
||||
> gamma
|
||||
|
||||
@param {String} str
|
||||
@param {String} str
|
||||
The string to split
|
||||
|
||||
@returns {String} split string
|
||||
|
@ -7467,7 +7471,7 @@ Ember.String = {
|
|||
|
||||
/**
|
||||
Converts a camelized string into all lower case separated by underscores.
|
||||
|
||||
|
||||
'innerHTML'.decamelize() => 'inner_html'
|
||||
'action_name'.decamelize() => 'action_name'
|
||||
'css-class-name'.decamelize() => 'css-class-name'
|
||||
|
@ -7484,7 +7488,7 @@ Ember.String = {
|
|||
|
||||
/**
|
||||
Replaces underscores or spaces with dashes.
|
||||
|
||||
|
||||
'innerHTML'.dasherize() => 'inner-html'
|
||||
'action_name'.dasherize() => 'action-name'
|
||||
'css-class-name'.dasherize() => 'css-class-name'
|
||||
|
@ -7651,7 +7655,7 @@ if (Ember.EXTEND_PROTOTYPES) {
|
|||
|
||||
/**
|
||||
The `property` extension of Javascript's Function prototype is available
|
||||
when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
|
||||
Computed properties allow you to treat a function like a property:
|
||||
|
||||
|
@ -7706,7 +7710,7 @@ if (Ember.EXTEND_PROTOTYPES) {
|
|||
|
||||
/**
|
||||
The `observes` extension of Javascript's Function prototype is available
|
||||
when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
|
||||
You can observe property changes simply by adding the `observes`
|
||||
call to the end of your method declarations in classes that you write.
|
||||
|
@ -7717,7 +7721,7 @@ if (Ember.EXTEND_PROTOTYPES) {
|
|||
// Executes whenever the "value" property changes
|
||||
}.observes('value')
|
||||
});
|
||||
|
||||
|
||||
@see Ember.Observable
|
||||
*/
|
||||
Function.prototype.observes = function() {
|
||||
|
@ -7727,7 +7731,7 @@ if (Ember.EXTEND_PROTOTYPES) {
|
|||
|
||||
/**
|
||||
The `observesBefore` extension of Javascript's Function prototype is
|
||||
available when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
available when Ember.EXTEND_PROTOTYPES is true, which is the default.
|
||||
|
||||
You can get notified when a property changes is about to happen by
|
||||
by adding the `observesBefore` call to the end of your method
|
||||
|
@ -7738,7 +7742,7 @@ if (Ember.EXTEND_PROTOTYPES) {
|
|||
// Executes whenever the "value" property is about to change
|
||||
}.observesBefore('value')
|
||||
});
|
||||
|
||||
|
||||
@see Ember.Observable
|
||||
*/
|
||||
Function.prototype.observesBefore = function() {
|
||||
|
@ -9339,7 +9343,7 @@ Ember.MutableArray = Ember.Mixin.create(Ember.Array, Ember.MutableEnumerable,
|
|||
colors.clear(); => []
|
||||
colors.length(); => 0
|
||||
|
||||
@returns {Ember.Array} An empty Array.
|
||||
@returns {Ember.Array} An empty Array.
|
||||
*/
|
||||
clear: function () {
|
||||
var len = get(this, 'length');
|
||||
|
@ -9547,15 +9551,15 @@ var get = Ember.get, set = Ember.set, defineProperty = Ember.defineProperty;
|
|||
@class
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
This mixin provides properties and property observing functionality, core
|
||||
features of the Ember object model.
|
||||
|
||||
|
||||
Properties and observers allow one object to observe changes to a
|
||||
property on another object. This is one of the fundamental ways that
|
||||
models, controllers and views communicate with each other in an Ember
|
||||
application.
|
||||
|
||||
|
||||
Any object that has this mixin applied can be used in observer
|
||||
operations. That includes Ember.Object and most objects you will
|
||||
interact with as you write your Ember application.
|
||||
|
@ -9563,16 +9567,16 @@ var get = Ember.get, set = Ember.set, defineProperty = Ember.defineProperty;
|
|||
Note that you will not generally apply this mixin to classes yourself,
|
||||
but you will use the features provided by this module frequently, so it
|
||||
is important to understand how to use it.
|
||||
|
||||
|
||||
## Using get() and set()
|
||||
|
||||
|
||||
Because of Ember's support for bindings and observers, you will always
|
||||
access properties using the get method, and set properties using the
|
||||
set method. This allows the observing objects to be notified and
|
||||
computed properties to be handled properly.
|
||||
|
||||
|
||||
More documentation about `get` and `set` are below.
|
||||
|
||||
|
||||
## Observing Property Changes
|
||||
|
||||
You typically observe property changes simply by adding the `observes`
|
||||
|
@ -9584,7 +9588,7 @@ var get = Ember.get, set = Ember.set, defineProperty = Ember.defineProperty;
|
|||
// Executes whenever the "value" property changes
|
||||
}.observes('value')
|
||||
});
|
||||
|
||||
|
||||
Although this is the most common way to add an observer, this capability
|
||||
is actually built into the Ember.Object class on top of two methods
|
||||
defined in this mixin: `addObserver` and `removeObserver`. You can use
|
||||
|
@ -9597,12 +9601,12 @@ var get = Ember.get, set = Ember.set, defineProperty = Ember.defineProperty;
|
|||
|
||||
This will call the `targetAction` method on the `targetObject` to be called
|
||||
whenever the value of the `propertyKey` changes.
|
||||
|
||||
Note that if `propertyKey` is a computed property, the observer will be
|
||||
called when any of the property dependencies are changed, even if the
|
||||
|
||||
Note that if `propertyKey` is a computed property, the observer will be
|
||||
called when any of the property dependencies are changed, even if the
|
||||
resulting value of the computed property is unchanged. This is necessary
|
||||
because computed properties are not computed until `get` is called.
|
||||
|
||||
|
||||
@extends Ember.Mixin
|
||||
*/
|
||||
Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
||||
|
@ -9616,7 +9620,7 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
This method is usually similar to using object[keyName] or object.keyName,
|
||||
however it supports both computed properties and the unknownProperty
|
||||
handler.
|
||||
|
||||
|
||||
Because `get` unifies the syntax for accessing all these kinds
|
||||
of properties, it can make many refactorings easier, such as replacing a
|
||||
simple property with a computed property, or vice versa.
|
||||
|
@ -9812,11 +9816,11 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
Ember.propertyDidChange(this, keyName);
|
||||
return this;
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
Convenience method to call `propertyWillChange` and `propertyDidChange` in
|
||||
succession.
|
||||
|
||||
|
||||
@param {String} keyName The property key to be notified about.
|
||||
@returns {Ember.Observable}
|
||||
*/
|
||||
|
@ -9908,7 +9912,7 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
This method will be called when a client attempts to get the value of a
|
||||
property that has not been defined in one of the typical ways. Override
|
||||
this method to create "virtual" properties.
|
||||
|
||||
|
||||
@param {String} key The name of the unknown property that was requested.
|
||||
@returns {Object} The property value or undefined. Default is undefined.
|
||||
*/
|
||||
|
@ -9920,7 +9924,7 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
This method will be called when a client attempts to set the value of a
|
||||
property that has not been defined in one of the typical ways. Override
|
||||
this method to create "virtual" properties.
|
||||
|
||||
|
||||
@param {String} key The name of the unknown property to be set.
|
||||
@param {Object} value The value the unknown property is to be set to.
|
||||
*/
|
||||
|
@ -9953,9 +9957,9 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
/**
|
||||
Retrieves the value of a property, or a default value in the case that the property
|
||||
returns undefined.
|
||||
|
||||
|
||||
person.getWithDefault('lastName', 'Doe');
|
||||
|
||||
|
||||
@param {String} keyName The name of the property to retrieve
|
||||
@param {Object} defaultValue The value to return if the property value is undefined
|
||||
@returns {Object} The property value or the defaultValue.
|
||||
|
@ -9966,10 +9970,10 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
|
||||
/**
|
||||
Set the value of a property to the current value plus some amount.
|
||||
|
||||
|
||||
person.incrementProperty('age');
|
||||
team.incrementProperty('score', 2);
|
||||
|
||||
|
||||
@param {String} keyName The name of the property to increment
|
||||
@param {Object} increment The amount to increment by. Defaults to 1
|
||||
@returns {Object} The new property value
|
||||
|
@ -9979,13 +9983,13 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
set(this, keyName, (get(this, keyName) || 0)+increment);
|
||||
return get(this, keyName);
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
Set the value of a property to the current value minus some amount.
|
||||
|
||||
|
||||
player.decrementProperty('lives');
|
||||
orc.decrementProperty('health', 5);
|
||||
|
||||
|
||||
@param {String} keyName The name of the property to decrement
|
||||
@param {Object} increment The amount to decrement by. Defaults to 1
|
||||
@returns {Object} The new property value
|
||||
|
@ -9999,9 +10003,9 @@ Ember.Observable = Ember.Mixin.create(/** @scope Ember.Observable.prototype */ {
|
|||
/**
|
||||
Set the value of a boolean property to the opposite of it's
|
||||
current value.
|
||||
|
||||
|
||||
starship.toggleProperty('warpDriveEnaged');
|
||||
|
||||
|
||||
@param {String} keyName The name of the property to toggle
|
||||
@returns {Object} The new property value
|
||||
*/
|
||||
|
@ -13511,7 +13515,7 @@ var invokeForState = {
|
|||
`Ember.View` is the class in Ember responsible for encapsulating templates of HTML
|
||||
content, combining templates with data to render as sections of a page's DOM, and
|
||||
registering and responding to user-initiated events.
|
||||
|
||||
|
||||
## HTML Tag
|
||||
The default HTML tag name used for a view's DOM representation is `div`. This can be
|
||||
customized by setting the `tagName` property. The following view class:
|
||||
|
@ -13537,7 +13541,7 @@ var invokeForState = {
|
|||
<div id="ember1" class="ember-view my-class my-other-class"></div>
|
||||
|
||||
`class` attribute values can also be set by providing a `classNameBindings` property
|
||||
set to an array of properties names for the view. The return value of these properties
|
||||
set to an array of properties names for the view. The return value of these properties
|
||||
will be added as part of the value for the view's `class` attribute. These properties
|
||||
can be computed properties:
|
||||
|
||||
|
@ -13566,7 +13570,7 @@ var invokeForState = {
|
|||
|
||||
<div id="ember1" class="ember-view hovered"></div>
|
||||
|
||||
When using boolean class name bindings you can supply a string value other than the
|
||||
When using boolean class name bindings you can supply a string value other than the
|
||||
property name for use as the `class` HTML attribute by appending the preferred value after
|
||||
a ":" character when defining the binding:
|
||||
|
||||
|
@ -13644,11 +13648,11 @@ var invokeForState = {
|
|||
<div id="ember1" class="ember-view disabled"></div>
|
||||
|
||||
|
||||
Updates to the the value of a class name binding will result in automatic update
|
||||
Updates to the the value of a class name binding will result in automatic update
|
||||
of the HTML `class` attribute in the view's rendered HTML representation.
|
||||
If the value becomes `false` or `undefined` the class name will be removed.
|
||||
|
||||
Both `classNames` and `classNameBindings` are concatenated properties.
|
||||
Both `classNames` and `classNameBindings` are concatenated properties.
|
||||
See `Ember.Object` documentation for more information about concatenated properties.
|
||||
|
||||
## HTML Attributes
|
||||
|
@ -13694,7 +13698,7 @@ var invokeForState = {
|
|||
}.property()
|
||||
})
|
||||
|
||||
Updates to the the property of an attribute binding will result in automatic update
|
||||
Updates to the the property of an attribute binding will result in automatic update
|
||||
of the HTML attribute in the view's rendered HTML representation.
|
||||
|
||||
`attributeBindings` is a concatenated property. See `Ember.Object` documentation
|
||||
|
@ -13785,7 +13789,7 @@ var invokeForState = {
|
|||
primary templates, layouts can be any function that accepts an optional context
|
||||
parameter and returns a string of HTML that will be inserted inside view's tag. Views whose HTML
|
||||
element is self closing (e.g. `<input />`) cannot have a layout and this property will be ignored.
|
||||
|
||||
|
||||
Most typically in Ember a layout will be a compiled Ember.Handlebars template.
|
||||
|
||||
A view's layout can be set directly with the `layout` property or reference an
|
||||
|
@ -13810,7 +13814,7 @@ var invokeForState = {
|
|||
See `Handlebars.helpers.yield` for more information.
|
||||
|
||||
## Responding to Browser Events
|
||||
Views can respond to user-initiated events in one of three ways: method implementation,
|
||||
Views can respond to user-initiated events in one of three ways: method implementation,
|
||||
through an event manager, and through `{{action}}` helper use in their template or layout.
|
||||
|
||||
### Method Implementation
|
||||
|
@ -13827,8 +13831,8 @@ var invokeForState = {
|
|||
### Event Managers
|
||||
Views can define an object as their `eventManager` property. This object can then
|
||||
implement methods that match the desired event names. Matching events that occur
|
||||
on the view's rendered HTML or the rendered HTML of any of its DOM descendants
|
||||
will trigger this method. A `jQuery.Event` object will be passed as the first
|
||||
on the view's rendered HTML or the rendered HTML of any of its DOM descendants
|
||||
will trigger this method. A `jQuery.Event` object will be passed as the first
|
||||
argument to the method and an `Ember.View` object as the second. The `Ember.View`
|
||||
will be the view whose rendered HTML was interacted with. This may be the view with
|
||||
the `eventManager` property or one of its descendent views.
|
||||
|
@ -13862,7 +13866,7 @@ var invokeForState = {
|
|||
|
||||
Similarly a view's event manager will take precedence for events of any views
|
||||
rendered as a descendent. A method name that matches an event name will not be called
|
||||
if the view instance was rendered inside the HTML representation of a view that has
|
||||
if the view instance was rendered inside the HTML representation of a view that has
|
||||
an `eventManager` property defined that handles events of the name. Events not handled
|
||||
by the event manager will still trigger method calls on the descendent.
|
||||
|
||||
|
@ -13884,7 +13888,7 @@ var invokeForState = {
|
|||
// eventManager doesn't handle click events
|
||||
},
|
||||
mouseEnter: function(event){
|
||||
// will never be called if rendered inside
|
||||
// will never be called if rendered inside
|
||||
// an OuterView.
|
||||
}
|
||||
})
|
||||
|
@ -13905,7 +13909,7 @@ var invokeForState = {
|
|||
Form events: 'submit', 'change', 'focusIn', 'focusOut', 'input'
|
||||
|
||||
HTML5 drag and drop events: 'dragStart', 'drag', 'dragEnter', 'dragLeave', 'drop', 'dragEnd'
|
||||
|
||||
|
||||
## Handlebars `{{view}}` Helper
|
||||
Other `Ember.View` instances can be included as part of a view's template by using the `{{view}}`
|
||||
Handlebars helper. See `Handlebars.helpers.view` for additional information.
|
||||
|
@ -16358,7 +16362,7 @@ var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
|
|||
@class
|
||||
|
||||
`Ember.CollectionView` is an `Ember.View` descendent responsible for managing a
|
||||
collection (an array or array-like object) by maintaing a child view object and
|
||||
collection (an array or array-like object) by maintaing a child view object and
|
||||
associated DOM representation for each item in the array and ensuring that child
|
||||
views and their associated rendered HTML are updated when items in the array
|
||||
are added, removed, or replaced.
|
||||
|
@ -16402,7 +16406,7 @@ var get = Ember.get, set = Ember.set, fmt = Ember.String.fmt;
|
|||
|
||||
## Automatic matching of parent/child tagNames
|
||||
|
||||
Setting the `tagName` property of a `CollectionView` to any of
|
||||
Setting the `tagName` property of a `CollectionView` to any of
|
||||
"ul", "ol", "table", "thead", "tbody", "tfoot", "tr", or "select" will result
|
||||
in the item views receiving an appropriately matched `tagName` property.
|
||||
|
||||
|
@ -18422,7 +18426,7 @@ var merge = function(original, hash) {
|
|||
Respectively, loading the page at the URL '#/alphabeta' would detect the route property of
|
||||
'root.bRoute' ('/alphabeta') and transition the router first to the state named 'root' and
|
||||
then to the substate 'bRoute'.
|
||||
|
||||
|
||||
## Adding Nested Routes to a Router
|
||||
Routes can contain nested subroutes each with their own `route` property describing the nested
|
||||
portion of the URL they would like to detect and handle. Router, like all instances of StateManager,
|
||||
|
@ -18430,27 +18434,27 @@ var merge = function(original, hash) {
|
|||
intermediary state when detecting URLs, a Route with nested routes must define both a base `route`
|
||||
property for itself and a child Route with a `route` property of `'/'` which will be transitioned
|
||||
to when the base route is detected in the URL:
|
||||
|
||||
|
||||
Given the following application code:
|
||||
|
||||
App = Ember.Application.create({
|
||||
Router: Ember.Router.extend({
|
||||
root: Ember.Route.extend({
|
||||
aRoute: Ember.Route.extend({
|
||||
route: '/theBaseRouteForThisSet',
|
||||
|
||||
route: '/theBaseRouteForThisSet',
|
||||
|
||||
indexSubRoute: Ember.Route.extend({
|
||||
route: '/',
|
||||
}),
|
||||
|
||||
|
||||
subRouteOne: Ember.Route.extend({
|
||||
route: '/subroute1
|
||||
}),
|
||||
|
||||
|
||||
subRouteTwo: Ember.Route.extend({
|
||||
route: '/subRoute2'
|
||||
})
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
})
|
||||
|
@ -18459,10 +18463,10 @@ var merge = function(original, hash) {
|
|||
|
||||
When the application is loaded at '/theBaseRouteForThisSet' the Router will transition to the route
|
||||
at path 'root.aRoute' and then transition to state 'indexSubRoute'.
|
||||
|
||||
|
||||
When the application is loaded at '/theBaseRouteForThisSet/subRoute1' the Router will transition to
|
||||
the route at path 'root.aRoute' and then transition to state 'subRouteOne'.
|
||||
|
||||
|
||||
## Route Transition Events
|
||||
Transitioning between Ember.Route instances (including the transition into the detected
|
||||
route when loading the application) triggers the same transition events as state transitions for
|
||||
|
@ -20844,7 +20848,7 @@ EmberHandlebars.ViewHelper = Ember.Object.create({
|
|||
Will result in HTML structure:
|
||||
|
||||
<body>
|
||||
<!-- Note: the handlebars template script
|
||||
<!-- Note: the handlebars template script
|
||||
also results in a rendered Ember.View
|
||||
which is the outer <div> here -->
|
||||
|
||||
|
@ -20866,7 +20870,7 @@ EmberHandlebars.ViewHelper = Ember.Object.create({
|
|||
})
|
||||
|
||||
aView.appendTo('body')
|
||||
|
||||
|
||||
Will result in HTML structure:
|
||||
|
||||
<div id="ember1" class="ember-view">
|
||||
|
@ -20940,7 +20944,7 @@ EmberHandlebars.ViewHelper = Ember.Object.create({
|
|||
Will result in the following HTML:
|
||||
|
||||
<div id="ember1" class="ember-view">
|
||||
<div id="ember2" class="ember-view a-custom-view-class-as-property">
|
||||
<div id="ember2" class="ember-view a-custom-view-class-as-property">
|
||||
hi
|
||||
</div>
|
||||
</div>
|
||||
|
@ -21100,7 +21104,7 @@ var get = Ember.get, getPath = Ember.Handlebars.getPath, fmt = Ember.String.fmt;
|
|||
<p class="ember-view greeting">Howdy Mary</p>
|
||||
<p class="ember-view greeting">Howdy Sara</p>
|
||||
</div>
|
||||
|
||||
|
||||
@name Handlebars.helpers.collection
|
||||
@param {String} path
|
||||
@param {Hash} options
|
||||
|
@ -21425,7 +21429,7 @@ ActionHelper.registerAction = function(actionName, options) {
|
|||
The `{{action}}` helper registers an HTML element within a template for
|
||||
DOM event handling and forwards that interaction to the Application's router,
|
||||
the template's `Ember.View` instance, or supplied `target` option (see 'Specifiying a Target').
|
||||
|
||||
|
||||
User interaction with that element will invoke the supplied action name on
|
||||
the appropriate target.
|
||||
|
||||
|
@ -21470,7 +21474,7 @@ ActionHelper.registerAction = function(actionName, options) {
|
|||
If you need the default handler to trigger you should either register your
|
||||
own event handler, or use event methods on your view class. See Ember.View
|
||||
'Responding to Browser Events' for more information.
|
||||
|
||||
|
||||
### Specifying DOM event type
|
||||
|
||||
By default the `{{action}}` helper registers for DOM `click` events. You can
|
||||
|
@ -21490,23 +21494,23 @@ ActionHelper.registerAction = function(actionName, options) {
|
|||
`Ember.EventDispatcher` instance will be created when a new
|
||||
`Ember.Application` is created. Having an instance of `Ember.Application`
|
||||
will satisfy this requirement.
|
||||
|
||||
|
||||
|
||||
|
||||
### Specifying a Target
|
||||
There are several possible target objects for `{{action}}` helpers:
|
||||
|
||||
|
||||
In a typical `Ember.Router`-backed Application where views are managed
|
||||
through use of the `{{outlet}}` helper, actions will be forwarded to the
|
||||
current state of the Applications's Router. See Ember.Router 'Responding
|
||||
to User-initiated Events' for more information.
|
||||
|
||||
|
||||
If you manaully set the `target` property on the controller of a template's
|
||||
`Ember.View` instance, the specifed `controller.target` will become the target
|
||||
for any actions. Likely custom values for a controller's `target` are the
|
||||
controller itself or a StateManager other than the Application's Router.
|
||||
|
||||
|
||||
If the templates's view lacks a controller property the view itself is the target.
|
||||
|
||||
|
||||
Finally, a `target` option can be provided to the helper to change which object
|
||||
will receive the method call. This option must be a string representing a
|
||||
path to an object:
|
||||
|
@ -21561,7 +21565,7 @@ ActionHelper.registerAction = function(actionName, options) {
|
|||
|
||||
Will throw `Uncaught TypeError: Cannot call method 'call' of undefined` when
|
||||
"click me" is clicked.
|
||||
|
||||
|
||||
### Specifying a context
|
||||
|
||||
By default the `{{action}}` helper passes the current Handlebars context
|
||||
|
@ -21771,7 +21775,7 @@ var set = Ember.set, get = Ember.get;
|
|||
/**
|
||||
@class
|
||||
|
||||
Creates an HTML input of type 'checkbox' with HTML related properties
|
||||
Creates an HTML input of type 'checkbox' with HTML related properties
|
||||
applied directly to the input.
|
||||
|
||||
{{view Ember.Checkbox classNames="applicaton-specific-checkbox"}}
|
||||
|
@ -22082,7 +22086,7 @@ var get = Ember.get, set = Ember.set;
|
|||
|
||||
## Layout and LayoutName properties
|
||||
|
||||
Because HTML `textarea` elements do not contain inner HTML the `layout` and `layoutName`
|
||||
Because HTML `textarea` elements do not contain inner HTML the `layout` and `layoutName`
|
||||
properties will not be applied. See `Ember.View`'s layout section for more information.
|
||||
|
||||
@extends Ember.View
|
||||
|
|
Loading…
Reference in New Issue
Block a user