Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
NPDD
baobaxia-mucua
Commits
3cadd2ef
Commit
3cadd2ef
authored
3 years ago
by
Alice Bonafé
Browse files
Options
Download
Email Patches
Plain Diff
Issue
#62
: atualizar balaios e mucuas quando altera a sessão de mocambola.
parent
be364d6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
static/js/controller.js
+3
-0
static/js/controller.js
static/js/header.js
+13
-0
static/js/header.js
with
16 additions
and
0 deletions
+16
-0
static/js/controller.js
View file @
3cadd2ef
...
...
@@ -73,6 +73,9 @@ var $page = {
xhr
.
open
(
method
,
API_URL
+
endpoint
);
xhr
.
setRequestHeader
(
"
Cache-Control
"
,
"
no-cache
"
);
xhr
.
setRequestHeader
(
"
Content-type
"
,
"
application/x-www-form-urlencoded
"
);
if
(
this
.
session
){
xhr
.
setRequestHeader
(
"
token
"
,
this
.
session
.
token
);
}
xhr
.
send
(
data
);
},
...
...
This diff is collapsed.
Click to expand it.
static/js/header.js
View file @
3cadd2ef
...
...
@@ -2,6 +2,7 @@ $(function () {
$page
.
onChange
(
'
balaiosList
'
,
function
(
event
)
{
menu
=
$
(
'
#nav-balaios-menu
'
);
menu
.
empty
();
var
checkActive
=
false
;
for
(
var
i
=
0
;
i
<
$page
.
balaiosList
.
length
;
i
++
)
{
var
menuItem
=
$
(
'
<a class="dropdown-item" href="#">
'
);
menuItem
.
data
(
'
smid
'
,
$page
.
balaiosList
[
i
].
smid
);
...
...
@@ -16,6 +17,12 @@ $(function () {
}
});
menu
.
append
(
menuItem
);
if
(
$page
.
balaio
&&
!
checkActive
)
{
checkActive
=
$page
.
balaio
.
smid
==
$page
.
balaiosList
[
i
].
smid
;
}
}
if
(
$page
.
balaio
&&
!
checkActive
)
{
$page
.
balaio
=
$page
.
balaioDefault
;
}
});
$page
.
onChange
(
'
mucuasList
'
,
function
(
event
)
{
...
...
@@ -68,6 +75,12 @@ $(function () {
$page
.
onChange
(
'
context
'
,
function
(
event
)
{
console
.
log
(
'
new context:
'
+
$page
.
context
);
});
$page
.
onChange
(
'
session
'
,
function
(
event
)
{
$page
.
loadBalaiosList
();
if
(
$page
.
balaio
)
{
$page
.
loadMucuasList
();
}
});
$
(
"
#nav-galaxy
"
).
click
(
function
(
event
)
{
$page
.
context
=
'
galaxy
'
;
});
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help