Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
* Fixed Gantt not applying time shift to date range selector start date.
* Fixed Gantt entry shrinking in size when hovering over it.
* Added missing close-action when clicking on background of pop-up form in logins UI.
* Switched to mousedown event for triggering pop-up form close. With previous version, selecting inputs/texts and leaving the window would trigger a mouseup, closing the pop-up form involuntarily.
  • Loading branch information
r3-gabriel committed Feb 7, 2022
1 parent 3d12ef0 commit 58883aa
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 14 deletions.
7 changes: 5 additions & 2 deletions www/comps/admin/adminLogins.js
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,11 @@ let MyAdminLogins = {
</thead>
<!-- login form -->
<div class="app-sub-window under-header" v-if="loginFormIndexOpen !== null">
<my-form class="form-pop-up"
<div class="app-sub-window under-header"
v-if="loginFormIndexOpen !== null"
@mousedown.self="$refs.popUpForm.closeAsk()"
>
<my-form class="form-pop-up" ref="popUpForm"
@close="loginFormIndexOpen = null"
@record-updated="setRecord(loginFormIndexOpen,loginFormLogin,$event);loginFormIndexOpen = null"
:allowDel="false"
Expand Down
2 changes: 1 addition & 1 deletion www/comps/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
--z-index-list-header:10;

/* calendar elements */
--z-index-gantt-hover:5;
--z-index-calendar-day-event-text-hover:4;
--z-index-calendar-day-event-text:2;
--z-index-calendar-day-event-ending-beam:3;
--z-index-calendar-line:2;
--z-index-calendar-caption:3;
--z-index-gantt-hover:3;

/* input field elements */
--z-index-field-toggle-bool-first:3;
Expand Down
2 changes: 1 addition & 1 deletion www/comps/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export {MyDialog as default};
let MyDialog = {
name:'my-dialog',
components:{MyInputRichtext},
template:`<div class="app-sub-window" @click.self="close">
template:`<div class="app-sub-window" @mousedown.self="close">
<div class="dialog contentBox" :style="styles">
<div class="top">
<div class="area">
Expand Down
2 changes: 1 addition & 1 deletion www/comps/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ let MyForm = {
<!-- pop-up form -->
<div class="app-sub-window under-header"
v-if="popUpFormId !== null"
@click.self="$refs.popUpForm.closeAsk()"
@mousedown.self="$refs.popUpForm.closeAsk()"
>
<my-form class="form-pop-up" ref="popUpForm"
@close="closePopUp()"
Expand Down
5 changes: 4 additions & 1 deletion www/comps/gantt.css
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
border-radius:5px;
}
.gantt-line-record:hover{
width:unset !important;
max-width:unset !important;
color:var(--color-bg-font);
background:rgba(0,0,0,0.7);
z-index:var(--z-index-gantt-hover);
Expand Down Expand Up @@ -154,6 +154,9 @@
right:1px;
top:20px;
}
.gantt-line-record:hover .record-line.end{
display:none;
}
.gantt-line-record .record-line.end{
width:3px;
right:1px;
Expand Down
15 changes: 7 additions & 8 deletions www/comps/gantt.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,12 @@ let MyGanttLineRecord = {
if(width < 1)
return 'display:none';

return [`width:${width}px`,`left:${offset}px`].join(';');
// max-width is overwritten by CSS if hovered over (show full entry)
return [`min-width:${width}px`,`max-width:${width}px`,`left:${offset}px`].join(';');
},
styleBg:function(r) {
if(this.color === null)
return '';

return `background-color:#${this.color};`;
return this.color === null
? '' : `background-color:#${this.color};`;
}
},
methods:{
Expand Down Expand Up @@ -651,15 +650,15 @@ let MyGantt = {
clickHeaderItem:function(unixTime,shift,middleClick) {
if(!this.hasCreate) return;

if(this.isDays)
unixTime = this.getUnixShifted(unixTime,false);

if(this.unixTimeRangeStart === null) {
this.unixTimeRangeStart = unixTime;

if(shift) return;
}

if(this.isDays)
unixTime = this.getUnixShifted(unixTime,false);

let attributes = [
`${this.attributeIdDate0}_${this.unixTimeRangeStart}`,
`${this.attributeIdDate1}_${unixTime}`
Expand Down

0 comments on commit 58883aa

Please sign in to comment.