summaryrefslogtreecommitdiffstats
path: root/module/web/static/js/views/input/textInput.js
diff options
context:
space:
mode:
Diffstat (limited to 'module/web/static/js/views/input/textInput.js')
-rw-r--r--module/web/static/js/views/input/textInput.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/module/web/static/js/views/input/textInput.js b/module/web/static/js/views/input/textInput.js
new file mode 100644
index 000000000..3a6631a0b
--- /dev/null
+++ b/module/web/static/js/views/input/textInput.js
@@ -0,0 +1,35 @@
+define(['jquery', 'backbone', 'underscore', './inputView'], function($, Backbone, _, inputView) {
+
+ return inputView.extend({
+
+ // TODO
+ tagName: 'input',
+ events: {
+ 'keyup': 'onChange',
+ 'focus': 'showTooltip',
+ 'focusout': 'hideTooltip'
+ },
+
+ renderInput: function() {
+ this.$el.attr('type', 'text');
+ this.$el.attr('name', 'textInput');
+
+ if (this.default_value)
+ this.$el.attr('placeholder', this.default_value);
+
+ if (this.value)
+ this.$el.val(this.value);
+
+ return this;
+ },
+
+ clear: function() {
+ this.$el.val('');
+ },
+
+ onChange: function(e) {
+ this.setVal(this.$el.val());
+ }
+
+ });
+}); \ No newline at end of file