1
0
Fork 0
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.2 KiB

/*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;
});