discourse/app/assets/javascripts/discourse/views/discourse_text_field.js
Robin Ward 40f86829f7 Post Cloaking:
* We now use a new custom view, {{cloaked-collection}} to display posts in a topic.

* Posts are removed and inserted (cloaked/uncloaked) into the DOM dynamically based on whether they
  are visible in the current browser viewport.

* There's been a lot of refactoring to ensure the relationship between the post views and the topic
  controller is sane.

* Lots of fixes involving jumping to a post, including a new LockOn component to that tries to stay
  focused on an element even if stuff is loading before it in the DOM that would normally push it
  down.
2013-11-27 12:53:32 -05:00

23 lines
528 B
JavaScript

/**
This is a custom text field that allows i18n placeholders
@class TextField
@extends Ember.TextField
@namespace Discourse
@module Discourse
**/
Discourse.TextField = Ember.TextField.extend({
attributeBindings: ['autocorrect', 'autocapitalize', 'autofocus'],
placeholder: function() {
if (this.get('placeholderKey')) {
return I18n.t(this.get('placeholderKey'));
} else {
return '';
}
}.property('placeholderKey')
});
Discourse.View.registerHelper('textField', Discourse.TextField);