Laverna/laverna

View on GitHub
app/scripts/apps/notebooks/list/views/notebooksItem.js

Summary

Maintainability
B
5 hrs
Test Coverage
/**
 * Copyright (C) 2015 Laverna project Authors.
 * 
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */
/* global define */
define([
    'underscore',
    'marionette',
    'backbone.radio',
    'apps/notebooks/list/behaviors/itemBehavior',
    'text!apps/notebooks/list/templates/notebooksItem.html'
], function(_, Marionette, Radio, ItemBehavior, Tmpl) {
    'use strict';

    /**
     * Notebooks item view.
     * Everything happens in its behaviour.
     */
    var View = Marionette.ItemView.extend({
        template: _.template(Tmpl),

        className: 'list--group list-group',

        behaviors: {
            ItemBehavior: {
                behaviorClass: ItemBehavior
            }
        },

        serializeData: function() {
            return _.extend(this.model.toJSON(), {
                uri  : Radio.request('uri', 'link:profile', '')
            });
        }
    });

    return View;
});