|
|
|
/*jslint laxbreak:true */
|
|
|
|
/*jslint laxcomma:true */
|
|
|
|
/*jslint loopfunc:true */
|
|
|
|
/*jslint strict:true */
|
|
|
|
/*jslint browser:true */
|
|
|
|
/*jslint devel:true */
|
|
|
|
define([
|
|
|
|
"jquery"
|
|
|
|
, "backbone"
|
|
|
|
, "bootstrap"
|
|
|
|
|
|
|
|
, "text!../../templates/view-list.html"
|
|
|
|
]
|
|
|
|
, function (
|
|
|
|
$
|
|
|
|
, Backbone
|
|
|
|
, Bootstrap
|
|
|
|
|
|
|
|
, tmplListView
|
|
|
|
) {
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
var List = Backbone.View.extend({
|
|
|
|
type: "playlist"
|
|
|
|
|
|
|
|
, initialize: function (options) {
|
|
|
|
var that = this
|
|
|
|
;
|
|
|
|
|
|
|
|
if (options && options.el) {
|
|
|
|
options.el.innerHTML = tmplListView;
|
|
|
|
} else {
|
|
|
|
options = options || {};
|
|
|
|
options.el = document.createElement("div");
|
|
|
|
|
|
|
|
options.el.id = "__view-playlist";
|
|
|
|
options.el.className = "playlist-view-container";
|
|
|
|
options.el.innerHTML = tmplListView;
|
|
|
|
|
|
|
|
this.el = options.el;
|
|
|
|
this.$el = $(this.el);
|
|
|
|
}
|
|
|
|
|
|
|
|
List.__super__.initialize.apply(this, arguments);
|
|
|
|
|
|
|
|
this.$el.find("table:first").html("<tr><td><h1>" + this.type + "</h1></td></tr>");
|
|
|
|
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
, render: function () {
|
|
|
|
return this.$el;
|
|
|
|
}
|
|
|
|
|
|
|
|
, show: function () {
|
|
|
|
var that = this
|
|
|
|
;
|
|
|
|
|
|
|
|
this.$el.show();
|
|
|
|
}
|
|
|
|
|
|
|
|
, hide: function () {
|
|
|
|
var that = this
|
|
|
|
;
|
|
|
|
|
|
|
|
this.$el.hide();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
return List;
|
|
|
|
});
|