mirror of
https://github.com/haiwen/seahub.git
synced 2025-08-23 17:20:29 +00:00
34 lines
613 B
JavaScript
34 lines
613 B
JavaScript
|
define([
|
||
|
"jquery",
|
||
|
"ui/component"
|
||
|
],
|
||
|
function( jQuery, Component ) {
|
||
|
/**
|
||
|
* Text component type
|
||
|
* @class
|
||
|
* @extend {Component}
|
||
|
*/
|
||
|
var Text = Component.extend({
|
||
|
/**
|
||
|
* Initializes the text component
|
||
|
* @override
|
||
|
*/
|
||
|
init: function() {
|
||
|
this._super();
|
||
|
this.element = jQuery( "<input>" )
|
||
|
.bind( "change", jQuery.proxy(function( event ) {
|
||
|
this.setValue( event.target.value );
|
||
|
}, this ) );
|
||
|
},
|
||
|
|
||
|
// invoked when the user has changed the value
|
||
|
/**
|
||
|
* Sets the value of the text field
|
||
|
* @param {string} value
|
||
|
*/
|
||
|
setValue: function( value ) {}
|
||
|
});
|
||
|
|
||
|
return Text;
|
||
|
});
|