Commit f11e1bd3 authored by gijs's avatar gijs

Fixes #8

parent f0b5ad3a
......@@ -3,29 +3,29 @@ window.W = window.W || {};
;
(function(undefined) {
(function (undefined) {
'use strict';
W.ScoreController = Backbone.Marionette.Object.extend({
scoreList: function() {
scoreList: function () {
var app = this.getOption('application');
// app.getRegion().empty();
var myListView = new W.ScoreListView();
app.showView(myListView);
},
scoreDetail: function(id) {
scoreDetail: function (id) {
var app = this.getOption('application');
// Backbone relational refuse to instantiate more than one model
// with the same id
var scoreModel = W.ScoreModel.find({id: id}) || new W.ScoreModel({id: id});
var scoreModel = W.ScoreModel.find({ id: id }) || new W.ScoreModel({ id: id });
var myScoreDetailView = new W.ScoreDetailView({ model: scoreModel });
// Attach the views when the model is successfully fetched
scoreModel.fetch({
success: (function () {
app.showView(myScoreDetailView);
app.showView(myScoreDetailView);
}).bind(this)
});
}
......
......@@ -496,7 +496,7 @@ window.W = window.W || {};
this.model.unset('alternative_p');
this.model.unset('alternative_mode');
this.editMode = false;
this.collapsed = false;
this.collapsed = true;
this.listenTo(this.model, 'change', this.render);
},
......@@ -753,7 +753,7 @@ window.W = window.W || {};
// inverts the data-collapsed option
// Uses CSS to toggle visibility
this.collapsed = (this.collapsed) ? false : true;
this.collapsed = !this.collapsed;
this.$el.attr("data-collapsed", this.collapsed);
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment