BusinessMetadataDetailLayoutView.js 1.2 KB

12345678910111213141516171819202122232425262728
  1. define([ "require", "backbone", "hbs!tmpl/business_metadata/BusinessMetadataDetailLayoutView_tmpl", "utils/Utils" ], function(require, Backbone, BusinessMetadataDetailLayoutViewTmpl, Utils) {
  2. "use strict";
  3. var BusinessMetadataDetailLayoutView = Backbone.Marionette.LayoutView.extend({
  4. template: BusinessMetadataDetailLayoutViewTmpl,
  5. regions: {},
  6. ui: {
  7. title: '[data-id="title"]',
  8. description: '[data-id="description"]',
  9. backButton: '[data-id="backButton"]'
  10. },
  11. events: function() {
  12. var events = {};
  13. return events["click " + this.ui.backButton] = function() {
  14. Utils.backButtonClick();
  15. }, events;
  16. },
  17. initialize: function(options) {
  18. _.extend(this, _.pick(options, "model"));
  19. },
  20. onRender: function() {
  21. this.renderDetail();
  22. },
  23. renderDetail: function() {
  24. this.ui.title.html("<span>" + this.model.get("name") + "</span>"), this.model.get("description") && this.ui.description.text(this.model.get("description"));
  25. }
  26. });
  27. return BusinessMetadataDetailLayoutView;
  28. });