'use strict';

define([
    'jquery',
    'underscore',
    'view/widget/panel/panel',
    'view/widget/body/body',
    'view/widget/navigation/navigation',
], function ($, _, Panel, Body, Navigation) {

    return Panel.extend({

        initialize: function () {
                positionFixed: true,
                display: 'overlay',
                body: new Body({
                    items: {
                        navigation: new Navigation({
                            activeState: false,
                            rows: [
                                { dashboard: {text: '<i class="fa fa-list-ul"></i> Dashboard'} },
                                { providers: {text: '<i class="fa fa-copyright"></i> Providers'} },
                                { products: {text: '<i class="fa fa-database"></i> Products'} },
                                { blocks: {text: '<i class="fa fa-th-large"></i> Blocks'} },
                                { beds: {text: '<i class="fa fa-bars"></i> Beds'} },
                                { crops: {text: '<i class="fa fa-crop"></i> Crops'} },
                                { tasks: {text: '<i class="fa fa-tasks"></i> Tasks'} },
                                { works: {text: '<i class="fa fa-wrench"></i> Works'} },
                                { varieties: {text: '<i class="fa fa-pagelines"></i> Varieties'} },
                                { poss: {text: '<i class="fa fa-truck"></i> Points of sale'} },
                                { logout: {text: '<i class="fa fa-sign-out"></i> Logout'} },
                            ],
                            events: {
                                click: function (route) {
                                    this.redirect(route)
                                }.bind(this),
                            },
                        }),
                    },
                }),
            });
        },

        redirect: function (route) {
            this.close().done(function() {
                app.router.navigate(route);
            }.bind(this));
        },
    });
});
            Panel.prototype.initialize.call(this, {
                id: 'menu-panel',
                position: 'right',