2014-02-09 03:19:48 +00:00
|
|
|
define(function (require) {
|
2014-04-05 19:36:34 +00:00
|
|
|
|
2014-02-09 03:19:48 +00:00
|
|
|
"use strict";
|
2014-04-05 19:36:34 +00:00
|
|
|
|
2014-02-09 03:19:48 +00:00
|
|
|
var $ = require('jquery'),
|
|
|
|
_ = require('underscore'),
|
|
|
|
Backbone = require('backbone'),
|
|
|
|
Marionette = require('marionette'),
|
2014-04-05 19:36:34 +00:00
|
|
|
ListItemView = require('app/views/mods/list_item'),
|
2014-05-06 23:35:44 +00:00
|
|
|
FormView = require('app/views/mods/form'),
|
2014-04-05 19:36:34 +00:00
|
|
|
tpl = require('text!tpl/mods/list.html'),
|
|
|
|
|
|
|
|
template = _.template(tpl);
|
|
|
|
|
|
|
|
return Marionette.CompositeView.extend({
|
2014-02-09 03:19:48 +00:00
|
|
|
itemView: ListItemView,
|
2014-04-05 19:36:34 +00:00
|
|
|
itemViewContainer: "tbody",
|
|
|
|
template: template,
|
2014-04-21 13:24:47 +00:00
|
|
|
|
2014-05-06 23:35:44 +00:00
|
|
|
events: {
|
|
|
|
"click #download": "download"
|
|
|
|
},
|
|
|
|
|
|
|
|
download: function (event) {
|
|
|
|
event.preventDefault();
|
|
|
|
var view = new FormView({mods: this.collection});
|
2015-02-04 23:42:18 +00:00
|
|
|
var modal = new Backbone.BootstrapModal({
|
|
|
|
content: view,
|
|
|
|
animate: true,
|
|
|
|
cancelText: 'Close',
|
|
|
|
okText: 'Search',
|
|
|
|
});
|
2014-05-21 22:52:20 +00:00
|
|
|
view.modal = modal;
|
|
|
|
modal.open();
|
2014-05-06 23:35:44 +00:00
|
|
|
},
|
2014-02-09 03:19:48 +00:00
|
|
|
});
|
|
|
|
});
|