Sha256: aa9a8e0115b78cebe259e38b958d4a56a8aea1c4d281dd8e74061446b1e4b924

Contents?: true

Size: 914 Bytes

Versions: 12

Compression:

Stored size: 914 Bytes

Contents

(function() {
    var fitopts = {min: 6, max: 400};

    var Title = function(json) {
      view.View.call(this, json);
      this.title = json.title;
      this.clickFocusable = true;
      this.el.addClass("title");
      this.h2 = $('<h2/>');
      this.el.append(this.h2);
      this.h2.text(this.title);
      this.reflow();
    }

    view.inherit(view.View, Title);
    view.Title = Title;
    view.types.Title = Title;

    Title.prototype.json = function() {
      return $.extend(view.View.prototype.json.call(this), {
        type: 'Title',
        title: this.title
      });
    }

    var editTemplate = _.template(
      '<label for="title">Title</label>' +
      '<input type="title" name="title" value="{{title}}" />'
    );

    Title.prototype.editForm = function() {
      return editTemplate(this);
    }

    Title.prototype.reflow = function() {
      this.h2.quickfit(fitopts);
    }
})();

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
riemann-dash-0.2.14 lib/riemann/dash/public/views/title.js
riemann-dash-0.2.13 lib/riemann/dash/public/views/title.js
riemann-dash-0.2.12 lib/riemann/dash/public/views/title.js
riemann-dash-0.2.11 lib/riemann/dash/public/views/title.js
riemann-dash-0.2.10 lib/riemann/dash/public/views/title.js
riemann-dash-0.2.9 lib/riemann/dash/public/views/title.js
riemann-dash-0.2.8 lib/riemann/dash/public/views/title.js
riemann-dash-0.2.7 lib/riemann/dash/public/views/title.js
riemann-dash-0.2.6 lib/riemann/dash/public/views/title.js
riemann-dash-0.2.5 lib/riemann/dash/public/views/title.js
riemann-dash-0.2.4 lib/riemann/dash/public/views/title.js
riemann-dash-0.2.3 lib/riemann/dash/public/views/title.js