Skip to content

Commit

Permalink
Revert "Remove dead view code"
Browse files Browse the repository at this point in the history
  • Loading branch information
trek committed Feb 13, 2015
1 parent 88e24ff commit 13575a1
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions packages/ember-views/lib/views/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
// Ember.ContainerView circular dependency
// Ember.ENV
import Ember from 'ember-metal/core';

import Evented from "ember-runtime/mixins/evented";
import EmberObject from "ember-runtime/system/object";
import EmberError from "ember-metal/error";
import { get } from "ember-metal/property_get";
import run from "ember-metal/run_loop";
Expand Down Expand Up @@ -900,6 +903,21 @@ var View = CoreView.extend(
return this.currentState.rerender(this);
},

/**
Given a property name, returns a dasherized version of that
property name if the property evaluates to a non-falsy value.
For example, if the view has property `isUrgent` that evaluates to true,
passing `isUrgent` to this method will return `"is-urgent"`.
@method _classStringForProperty
@param property
@private
*/
_classStringForProperty: function(parsedPath) {
return View._classStringForValue(parsedPath.path, parsedPath.stream.value(), parsedPath.className, parsedPath.falsyClassName);
},

// ..........................................................
// ELEMENT SUPPORT
//
Expand Down Expand Up @@ -1362,6 +1380,20 @@ deprecateProperty(View.prototype, 'states', '_states');
// once the view has been inserted into the DOM, legal manipulations
// are done on the DOM element.

var mutation = EmberObject.extend(Evented).create();
// TODO MOVE TO RENDERER HOOKS
View.addMutationListener = function(callback) {
mutation.on('change', callback);
};

View.removeMutationListener = function(callback) {
mutation.off('change', callback);
};

View.notifyMutationListeners = function() {
mutation.trigger('change');
};

/**
Global views hash
Expand Down

0 comments on commit 13575a1

Please sign in to comment.