Sha256: 22aa9507c5596938b07886eac6787d0d9f5a06487f362e434c5c358fc621c2b4

Contents?: true

Size: 1.45 KB

Versions: 30

Compression:

Stored size: 1.45 KB

Contents

(function() {

  Luca.fields.TextAreaField = Luca.core.Field.extend({
    form_field: true,
    events: {
      "keydown input": "keydown_handler",
      "blur input": "blur_handler",
      "focus input": "focus_handler"
    },
    template: 'fields/text_area_field',
    height: "200px",
    width: "90%",
    initialize: function(options) {
      this.options = options != null ? options : {};
      _.bindAll(this, "keydown_handler");
      Luca.core.Field.prototype.initialize.apply(this, arguments);
      this.input_id || (this.input_id = _.uniqueId('field'));
      this.input_name || (this.input_name = this.name);
      this.label || (this.label = this.name);
      this.input_class || (this.input_class = this["class"]);
      return this.inputStyles || (this.inputStyles = "height:" + this.height + ";width:" + this.width);
    },
    setValue: function(value) {
      return $(this.field()).val(value);
    },
    getValue: function() {
      return $(this.field()).val();
    },
    field: function() {
      return this.input = $("textarea#" + this.input_id, this.el);
    },
    keydown_handler: function(e) {
      var me, my;
      return me = my = $(e.currentTarget);
    },
    blur_handler: function(e) {
      var me, my;
      return me = my = $(e.currentTarget);
    },
    focus_handler: function(e) {
      var me, my;
      return me = my = $(e.currentTarget);
    }
  });

  Luca.register("text_area_field", "Luca.fields.TextAreaField");

}).call(this);

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
luca-0.9.76 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.9.7 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.9.65 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.9.6 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.9.42 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.9.4 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.9.2 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.9.1 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.9.0 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.8.599 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.8.59 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.8.3 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.8.2 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.8.06 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.8 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.7.92 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.7.91 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.7.9 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.7.8 vendor/assets/luca-ui/components/fields/text_area_field.js
luca-0.7.7 vendor/assets/luca-ui/components/fields/text_area_field.js