Commit 4ce8d8e5 authored by alexandre's avatar alexandre

Sidebar and score independant scroll

parent ac7d9377
......@@ -2,17 +2,22 @@ body {
font-family: 'Oswald', sans-serif;
font-size: 16px;
line-height: 22px;
padding: 2em;
}
#slider {
display: none;
.wrapper {
width: 100vw;
height: 100vh;
position: fixed;
overflow: hidden;
}
#score > div {
#score {
width: 100vw;
height: 100vh;
padding: 2em;
box-sizing: border-box;
display: flex;
flex-direction: row-reverse;
margin-left: 75px;
}
.score-edit {
......@@ -22,12 +27,14 @@ body {
header {
position: relative;
flex: 1;
padding-left: 2em;
width: 300px;
margin-left: 20px;
overflow-y: auto;
}
header + ol {
flex: 3;
flex: 1;
overflow-y: auto;
}
h1 {
......
......@@ -799,6 +799,10 @@ window.W = window.W || {};
W.ScoreView = Backbone.Marionette.View.extend({
// Conditionnal rendering according we are in edit mode or not
template: '#score-template-vue',
attributes: {
id: 'score',
tabindex: '1'
},
regions: {
firstRegion: 'ol',
......@@ -1035,18 +1039,22 @@ window.W = window.W || {};
W.ScoreDetailView = Backbone.Marionette.View.extend({
template: '#base-template',
attributes: {class: 'wrapper'},
regions: {
slider: '#slider',
score: '#score'
},
childViewEvents: {
'slide': function () {
// console.log("slide")
// slider: '#slider',
score: {
el: '#score',
replaceElement: true,
}
},
// childViewEvents: {
// 'slide': function () {
// // console.log("slide")
// }
// },
initialize: function (options) {
// This is how the router passes the id of the score
this.options = options;
......@@ -1058,9 +1066,9 @@ window.W = window.W || {};
var scoreModel = W.ScoreModel.find(this.options) || new
W.ScoreModel(this.options);
var sliderView = new W.SliderView({
model: scoreModel
});
// var sliderView = new W.SliderView({
// model: scoreModel
// });
var scoreView = new W.ScoreView({
model: scoreModel
......@@ -1069,7 +1077,7 @@ window.W = window.W || {};
// Attach the views when the model is successfully fetched
scoreModel.fetch({
success: (function () {
this.showChildView('slider', sliderView);
// this.showChildView('slider', sliderView);
this.showChildView('score', scoreView);
}).bind(this)
});
......
<div id="slider"></div>
<!-- <div id="slider"></div> -->
<div id="score" tabindex="1"></div>
<header>
<button class="edit score-edit">🖉</button>
<div class="home"><a href="../../">index</a></div>
<h1 id="title"><%- title %></h1>
<button class="edit score-edit">Éditer</button>
<button class="save" data-label-progress="Saving..." data-label="Enregistrer" <% if (!hasChanges) { %>disabled<% } %>>Enregistrer</button>
<button class="duplicate">Dupliquer</button>
<button class="delete">Supprimer</button>
<dl class="score-meta">
<% if (score_type) { %>
......@@ -44,9 +49,6 @@
<div id="expand-level-slider"></div>
<button class="unfold">Tout déplier</button>
<button class="fold">Tout plier</button><br /><br />
<button class="save" data-label-progress="Saving..." data-label="Enregistrer" <% if (!hasChanges) { %>disabled<% } %>>Enregistrer</button>
<button class="duplicate">Dupliquer</button>
<button class="delete">Supprimer</button>
</div>
<form></form>
......
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