Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
third-party
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cooperatic-foodcoops
third-party
Commits
d82c419f
Commit
d82c419f
authored
Nov 24, 2021
by
Etienne Freiss
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'evolution_bdm' into ticket_1727
parents
7c1eda7d
49b745b2
Pipeline
#1546
failed with stage
in 1 minute 27 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
12 deletions
+56
-12
members-space-shifts-exchange.css
members_space/static/css/members-space-shifts-exchange.css
+2
-1
members-space-shifts-exchange.js
members_space/static/js/members-space-shifts-exchange.js
+26
-11
members-space.js
members_space/static/js/members-space.js
+28
-0
No files found.
members_space/static/css/members-space-shifts-exchange.css
View file @
d82c419f
...
@@ -193,5 +193,5 @@ td{
...
@@ -193,5 +193,5 @@ td{
#calendar_explaination_button
{
#calendar_explaination_button
{
max-width
:
60%
;
max-width
:
60%
;
margin
:
2rem
auto
-1
rem
auto
;
margin
:
2rem
auto
0.5
rem
auto
;
}
}
\ No newline at end of file
members_space/static/js/members-space-shifts-exchange.js
View file @
d82c419f
...
@@ -178,7 +178,7 @@ function init_shifts_list() {
...
@@ -178,7 +178,7 @@ function init_shifts_list() {
function
init_calendar_page
()
{
function
init_calendar_page
()
{
let
template_explanations
=
$
(
"#calendar_explaination_template"
);
let
template_explanations
=
$
(
"#calendar_explaination_template"
);
if
(
vw
<=
768
)
{
if
(
vw
<=
992
)
{
$
(
".loading-calendar"
).
show
();
$
(
".loading-calendar"
).
show
();
$
(
"#calendar_explaination_area"
).
hide
();
$
(
"#calendar_explaination_area"
).
hide
();
...
@@ -188,10 +188,10 @@ function init_calendar_page() {
...
@@ -188,10 +188,10 @@ function init_calendar_page() {
closeModal
,
closeModal
,
"J'ai compris"
"J'ai compris"
);
);
});
})
.
show
()
;
}
else
{
}
else
{
$
(
"#calendar_explaination_button"
).
hide
();
$
(
"#calendar_explaination_button"
).
hide
();
$
(
"#calendar_explaination_area"
).
html
(
template_explanations
.
html
());
$
(
"#calendar_explaination_area"
).
html
(
template_explanations
.
html
())
.
show
()
;
}
}
if
(
incoming_shifts
!==
null
)
{
if
(
incoming_shifts
!==
null
)
{
...
@@ -209,11 +209,18 @@ function init_calendar_page() {
...
@@ -209,11 +209,18 @@ function init_calendar_page() {
let
default_initial_view
=
""
;
let
default_initial_view
=
""
;
let
header_toolbar
=
{};
let
header_toolbar
=
{};
if
(
vw
<=
768
)
{
if
(
vw
<=
768
)
{
default_initial_view
=
'listWeek'
;
header_toolbar
=
{
left
:
'title'
,
center
:
'listWeek,timeGridDay'
,
right
:
'prev,next today'
};
}
else
if
(
vw
<=
992
)
{
default_initial_view
=
'listWeek'
;
default_initial_view
=
'listWeek'
;
header_toolbar
=
{
header_toolbar
=
{
left
:
'title'
,
left
:
'title'
,
center
:
''
,
center
:
'
dayGridMonth,listWeek,timeGridDay
'
,
right
:
'prev,next today'
right
:
'prev,next today'
};
};
}
else
{
}
else
{
...
@@ -313,12 +320,14 @@ function init_calendar_page() {
...
@@ -313,12 +320,14 @@ function init_calendar_page() {
}
}
},
},
eventDidMount
:
function
()
{
eventDidMount
:
function
()
{
if
(
vw
<=
768
)
{
// Calendar is hidden at first on mobile to hide header change when data is loaded
$
(
".fc .fc-header-toolbar"
).
addClass
(
"resp-header-toolbar"
);
$
(
".loading-calendar"
).
hide
();
$
(
"#calendar"
).
show
();
// Calendar is hidden at first on mobile to hide header change when data is loaded
if
(
vw
<=
992
)
{
$
(
".loading-calendar"
).
hide
();
$
(
".fc .fc-header-toolbar"
).
addClass
(
"resp-header-toolbar"
);
$
(
"#calendar"
).
show
();
}
else
{
$
(
".fc .fc-header-toolbar"
).
removeClass
(
"resp-header-toolbar"
);
}
}
}
}
});
});
...
@@ -386,4 +395,9 @@ function init_shifts_exchange() {
...
@@ -386,4 +395,9 @@ function init_shifts_exchange() {
$
(
"#shifts_exchange_content"
).
show
();
$
(
"#shifts_exchange_content"
).
show
();
init_calendar_page
();
init_calendar_page
();
}
}
}
$
(
window
).
smartresize
(
function
(){
vw
=
window
.
innerWidth
;
init_calendar_page
();
});
}
\ No newline at end of file
members_space/static/js/members-space.js
View file @
d82c419f
...
@@ -251,3 +251,30 @@ $(document).ready(function() {
...
@@ -251,3 +251,30 @@ $(document).ready(function() {
update_dom
();
update_dom
();
};
};
});
});
(
function
(
$
,
sr
){
// debouncing function from John Hann
// http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
var
debounce
=
function
(
func
,
threshold
,
execAsap
)
{
var
timeout
;
return
function
debounced
()
{
var
obj
=
this
,
args
=
arguments
;
function
delayed
()
{
if
(
!
execAsap
)
func
.
apply
(
obj
,
args
);
timeout
=
null
;
};
if
(
timeout
)
clearTimeout
(
timeout
);
else
if
(
execAsap
)
func
.
apply
(
obj
,
args
);
timeout
=
setTimeout
(
delayed
,
threshold
||
100
);
};
}
// smartresize
jQuery
.
fn
[
sr
]
=
function
(
fn
){
return
fn
?
this
.
bind
(
'resize'
,
debounce
(
fn
))
:
this
.
trigger
(
sr
);
};
})(
jQuery
,
'smartresize'
);
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment