Line layout tweaks
This commit is contained in:
parent
0e10bb7733
commit
0a9f6318c8
7 changed files with 35 additions and 34 deletions
2
amd/build/report-viewer-components.min.js
vendored
2
amd/build/report-viewer-components.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
2
amd/build/studyplan-editor-components.min.js
vendored
2
amd/build/studyplan-editor-components.min.js
vendored
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -16,6 +16,7 @@ import Debugger from './debugger';
|
||||||
|
|
||||||
// Make π available as a constant
|
// Make π available as a constant
|
||||||
const π = Math.PI;
|
const π = Math.PI;
|
||||||
|
const LINE_GRAVITY = 1.3;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
install(Vue/*,options*/){
|
install(Vue/*,options*/){
|
||||||
|
@ -646,6 +647,10 @@ export default {
|
||||||
if(start !== null && end !== null && isVisible(start) && isVisible(end)){
|
if(start !== null && end !== null && isVisible(start) && isVisible(end)){
|
||||||
lineinfo.line = new SimpleLine(start,end,{
|
lineinfo.line = new SimpleLine(start,end,{
|
||||||
color: lineColor,
|
color: lineColor,
|
||||||
|
gravity: {
|
||||||
|
start: LINE_GRAVITY,
|
||||||
|
end: LINE_GRAVITY,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
let elmWrapper = (this.plan.id >=0)?document.getElementById('studyplan-linewrapper-'+this.plan.id):null;
|
let elmWrapper = (this.plan.id >=0)?document.getElementById('studyplan-linewrapper-'+this.plan.id):null;
|
||||||
|
|
|
@ -22,6 +22,8 @@ const STUDYPLAN_EDITOR_PAGE_FIELDS = //TODO: Add 'fullname', 'shortname' and 'd
|
||||||
const PERIOD_EDITOR_FIELDS =
|
const PERIOD_EDITOR_FIELDS =
|
||||||
['fullname','shortname','startdate','enddate'];
|
['fullname','shortname','startdate','enddate'];
|
||||||
|
|
||||||
|
const LINE_GRAVITY = 1.3;
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
STUDYPLAN_EDITOR_FIELDS: STUDYPLAN_EDITOR_FIELDS, // make copy available in plugin
|
STUDYPLAN_EDITOR_FIELDS: STUDYPLAN_EDITOR_FIELDS, // make copy available in plugin
|
||||||
install(Vue/*,options*/){
|
install(Vue/*,options*/){
|
||||||
|
@ -2289,7 +2291,11 @@ export default {
|
||||||
dragelement.style.left = event.position.x+'px';
|
dragelement.style.left = event.position.x+'px';
|
||||||
dragelement.style.top = event.position.y+'px';
|
dragelement.style.top = event.position.y+'px';
|
||||||
this.dragLine = new SimpleLine(start,dragelement,{
|
this.dragLine = new SimpleLine(start,dragelement,{
|
||||||
color: "#777"
|
color: "#777",
|
||||||
|
gravity: {
|
||||||
|
start: LINE_GRAVITY,
|
||||||
|
end: LINE_GRAVITY,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
// Add separate event listener to reposition mouse move
|
// Add separate event listener to reposition mouse move
|
||||||
document.addEventListener("mousemove",this.onMouseMove);
|
document.addEventListener("mousemove",this.onMouseMove);
|
||||||
|
@ -2337,8 +2343,13 @@ export default {
|
||||||
}
|
}
|
||||||
// create a new line if the start and finish items are visible
|
// create a new line if the start and finish items are visible
|
||||||
if(start !== null && end !== null && isVisible(start) && isVisible(end)){
|
if(start !== null && end !== null && isVisible(start) && isVisible(end)){
|
||||||
this.lines[conn.to_id] = new SimpleLine( start,end,{color: lineColor,}
|
this.lines[conn.to_id] = new SimpleLine( start,end,{
|
||||||
);
|
color: lineColor,
|
||||||
|
gravity: {
|
||||||
|
start: LINE_GRAVITY,
|
||||||
|
end: LINE_GRAVITY,
|
||||||
|
},
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
|
@ -258,6 +258,12 @@ ul.t-competency-list li {
|
||||||
min-height: 32px;
|
min-height: 32px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.t-studyline-slot-0.filter .t-slot-item,
|
||||||
|
.r-studyline-slot-0.filter .r-slot-item {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.t-studyline-slot.t-studyline-slot-0,
|
.t-studyline-slot.t-studyline-slot-0,
|
||||||
.r-studyline-slot.r-studyline-slot-0 {
|
.r-studyline-slot.r-studyline-slot-0 {
|
||||||
|
@ -266,7 +272,7 @@ ul.t-competency-list li {
|
||||||
|
|
||||||
.t-studyline-slot.t-studyline-slot-0 .t-slot-drop.filter .t-slot-item,
|
.t-studyline-slot.t-studyline-slot-0 .t-slot-drop.filter .t-slot-item,
|
||||||
.r-studyline-slot.r-studyline-slot-0 .r-item-base {
|
.r-studyline-slot.r-studyline-slot-0 .r-item-base {
|
||||||
margin-left: 10px;
|
margin-left: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.t-studyline-slot.gradable.current.odd,
|
.t-studyline-slot.gradable.current.odd,
|
||||||
|
@ -373,23 +379,6 @@ ul.t-competency-list li {
|
||||||
min-height: 3px;
|
min-height: 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.t-slot-item.feedback {
|
|
||||||
border: 2px dashed black;
|
|
||||||
border-radius: 3px;
|
|
||||||
}
|
|
||||||
.t-slot-item.drag-mode-copy {
|
|
||||||
color: green;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.t-slot-item.drag-mode-cut {
|
|
||||||
color: red;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
.t-slot-item.drag-mode-reordering {
|
|
||||||
color: blueviolet;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
.t-item-deletebox {
|
.t-item-deletebox {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 100px;
|
width: 100px;
|
||||||
|
@ -572,6 +561,11 @@ ul.t-toolbox li {
|
||||||
line-height: 1px;
|
line-height: 1px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.t-studyline-slot-0.filter .t-slot-drop.filter .t-item-base{
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
a.t-item-config {
|
a.t-item-config {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: -5px;
|
top: -5px;
|
||||||
|
@ -722,15 +716,6 @@ a.t-item-course-config {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*.r-item-base {
|
|
||||||
margin-top: 5px;
|
|
||||||
margin-bottom: 5px;
|
|
||||||
margin-left: auto;
|
|
||||||
margin-right: auto;
|
|
||||||
position: relative;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
.gradable .r-item-base {
|
.gradable .r-item-base {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue