dist/ember.debug.js in ember-source-2.18.0.beta.4 vs dist/ember.debug.js in ember-source-2.18.0.beta.5

- old
+ new

@@ -4,11 +4,11 @@ * @copyright Copyright 2011-2017 Tilde Inc. and contributors * Portions Copyright 2006-2011 Strobe Inc. * Portions Copyright 2008-2011 Apple Inc. All rights reserved. * @license Licensed under MIT license * See https://raw.github.com/emberjs/ember.js/master/LICENSE - * @version 2.18.0-beta.4 + * @version 2.18.0-beta.5 */ /*global process */ var enifed, requireModule, Ember; var mainContext = this; // Used in ember-environment/lib/global.js @@ -16489,11 +16489,10 @@ @private */ eventName: 'click', init: function () { this._super.apply(this, arguments); - this._isDisabled = false; // Map desired event name to invoke function var eventName = (0, _emberMetal.get)(this, 'eventName'); this.on(eventName, this, this._invoke); }, @@ -16505,16 +16504,17 @@ @property disabled @private */ disabled: (0, _emberMetal.computed)({ get: function (_key) { + // always returns false for `get` because (due to the `set` just below) + // the cached return value from the set will prevent this getter from _ever_ + // being called after a set has occured return false; }, set: function (_key, value) { - if (value !== undefined) { - this.set('_isDisabled', value); - } + this._isDisabled = value; return value ? (0, _emberMetal.get)(this, 'disabledClass') : false; } }), _isActive: function (routerState) { if ((0, _emberMetal.get)(this, 'loading')) { @@ -16593,11 +16593,11 @@ } } if ((0, _emberMetal.get)(this, 'bubbles') === false) { event.stopPropagation(); } - if ((0, _emberMetal.get)(this, '_isDisabled')) { + if (this._isDisabled) { return false; } if ((0, _emberMetal.get)(this, 'loading')) { (true && (0, _emberDebug.warn)('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.', false)); @@ -16840,30 +16840,14 @@ {{#link-to 'photoGallery' disabledWhen=controller.someProperty}} Great Hamster Photos {{/link-to}} ``` - any passed value to `disabled` will disable it except `undefined`. - to ensure that only `true` disable the `link-to` component you can - override the global behavior of `LinkComponent`. + any truthy value passed to `disabled` will disable it except `undefined`. - ```javascript - import LinkComponent from '@ember/routing/link-component'; - import { computed } from '@ember/object'; + See "Overriding Application-wide Defaults" for more. - LinkComponent.reopen({ - disabled: computed(function(key, value) { - if (value !== undefined) { - this.set('_isDisabled', value === true); - } - return value === true ? get(this, 'disabledClass') : false; - }) - }); - ``` - - see "Overriding Application-wide Defaults" for more. - ### Handling `href` `{{link-to}}` will use your application's Router to fill the element's `href` property with a url that matches the path to the supplied `routeName` for your router's configured `Location` scheme, which defaults @@ -17045,34 +17029,35 @@ See [LinkComponent](/api/classes/Ember.LinkComponent.html) for a complete list of overrideable properties. Be sure to also check out inherited properties of `LinkComponent`. ### Overriding Application-wide Defaults - ``{{link-to}}`` creates an instance of `LinkComponent` - for rendering. To override options for your entire - application, reopen `LinkComponent` and supply the - desired values: - ``` javascript + ``{{link-to}}`` creates an instance of `LinkComponent` for rendering. To + override options for your entire application, export your customized + `LinkComponent` from `app/components/link-to.js` with the desired overrides: + + ```javascript + // app/components/link-to.js import LinkComponent from '@ember/routing/link-component'; - LinkComponent.reopen({ + export default LinkComponent.extend({ activeClass: "is-active", tagName: 'li' }) ``` - It is also possible to override the default event in - this manner: + It is also possible to override the default event in this manner: - ``` javascript + ```javascript import LinkCompoennt from '@ember/routing/link-component'; - LinkComponent.reopen({ + export default LinkComponent.extend({ eventName: 'customEventName' }); ``` + @method link-to @for Ember.Templates.helpers @param {String} routeName @param {Object} [context]* @param [options] {Object} Handlebars key/value pairs of options, you can override any property of Ember.LinkComponent @@ -47733,10 +47718,10 @@ */ }); enifed("ember/version", ["exports"], function (exports) { "use strict"; - exports.default = "2.18.0-beta.4"; + exports.default = "2.18.0-beta.5"; }); enifed("handlebars", ["exports"], function (exports) { "use strict"; // File ignored in coverage tests via setting in .istanbul.yml