Lines Matching refs:state
5 * that return the user to the current application state, even in an Ajax
14 * Provides global state management backed by an object, but with no browser
30 * changes, even if there is no associated state change. Default is `false`.
35 * Initial state to set, as an object hash of key/value pairs. This will be
36 * merged into the current global state.
97 * Constant used to identify state changes originating from the
108 * Constant used to identify state changes originating from the
182 * changes, even if there is no associated state change.
191 * Resolved initial state: a merge of the user-supplied initial state
192 * (if any) and any initial state provided by a subclass. This may
194 * nor a subclass supplies an initial state, this property will be
206 * Fired when the state changes. To be notified of all state changes
219 * Object hash of state items that have been added or changed. The
229 * Object hash of key/value pairs of all state items after the
235 * Object hash of key/value pairs of all state items before the
241 * Object hash of key/value pairs of state items that have been
257 // If initialState was provided, merge it into the current state.
266 * Adds a state entry with new values for the specified keys. By default,
267 * the new state will be merged into the existing state, and new values will
270 * new state entry.
273 * @param {Object} state Object hash of key/value pairs.
279 * If <code>true</code> (the default), the new state will be merged
280 * into the existing state. New values will override existing values,
282 * removed from the state.
286 * If <code>false</code>, the existing state will be discarded as a
287 * whole and the new state will take its place.
300 * Adds a state entry with a new value for a single key. By default, the new
301 * value will be merged into the existing state values, and will override an
304 * be removed from the new state entry.
314 var state = {};
315 state[key] = value;
316 return this._change(SRC_ADD, state, options);
320 * Returns the current value of the state parameter specified by <i>key</i>,
321 * or an object hash of key/value pairs for all current state parameters if
326 * @return {Object|String} Value of the specified state parameter, or an
327 * object hash of key/value pairs for all current state parameters.
330 var state = GlobalEnv._state,
331 isObject = _isSimpleObject(state);
334 return isObject && Obj.owns(state, key) ? state[key] : undefined;
336 return isObject ? Y.mix({}, state, true) : state; // mix provides a fast shallow clone.
343 * the new state.
346 * @param {Object} state Object hash of key/value pairs.
360 * with the new state.
370 var state = {};
371 state[key] = value;
372 return this._change(SRC_REPLACE, state, options);
378 * Changes the state. This method provides a common implementation shared by
379 * the public methods for changing state.
384 * @param {Object} state Object hash of key/value pairs.
390 _change: function (src, state, options) {
393 if (options.merge && _isSimpleObject(state) &&
395 state = Y.merge(GlobalEnv._state, state);
398 this._resolveChanges(src, state, options);
403 * Called by _resolveChanges() when the state has changed. This method takes
546 * state and fires appropriate events if things have changed.
552 * new state
604 * Stores the specified state. Don't call this method directly; go through
610 * @param {Object} newState new state to store
627 * @param {EventFacade} e state change event facade