mirror of
https://github.com/flarum/core.git
synced 2025-08-06 08:27:42 +02:00
Implement discussion composition and creation
This commit is contained in:
18
ember/app/components/ui/controls/text-input.js
Normal file
18
ember/app/components/ui/controls/text-input.js
Normal file
@@ -0,0 +1,18 @@
|
||||
import Ember from 'ember';
|
||||
|
||||
export default Ember.TextField.extend({
|
||||
didInsertElement: function() {
|
||||
var component = this;
|
||||
this.$().on('input', function() {
|
||||
var empty = !$(this).val();
|
||||
if (empty) {
|
||||
$(this).val(component.get('placeholder'));
|
||||
}
|
||||
$(this).css('width', 0);
|
||||
$(this).width($(this)[0].scrollWidth);
|
||||
if (empty) {
|
||||
$(this).val('');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
Reference in New Issue
Block a user