Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6b66b364
authored
Jan 10, 2018
by
Sebastián Collado Montañez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
picto status change doesnt reload all the dashboard
parent
5a341b73
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
sails/src/assets/scripts/modules/student/controllers/collections.js
sails/src/assets/scripts/modules/student/controllers/pictoconfig.js
sails/src/assets/scripts/modules/student/controllers/collections.js
View file @
6b66b364
...
...
@@ -602,9 +602,16 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
io
.
socket
.
off
(
'vocabulary'
);
io
.
socket
.
on
(
'vocabulary'
,
function
(
data
)
{
if
(
data
.
attributes
.
id_grid
==
$scope
.
viewingGrid
.
id
){
//Reload grid
ngToast
.
success
(
$translate
.
instant
(
'reload_grid'
));
$scope
.
showGrid
(
data
.
attributes
.
id_grid
,
'menu'
);
// Reload data
if
(
data
.
attributes
.
all_pictos
==
true
){
// Reload all
$scope
.
showGrid
(
data
.
attributes
.
id_grid
,
'menu'
);
}
else
{
// Reload only modified picto
$scope
.
mainGrid
[
data
.
attributes
.
stu_picto
.
attributes
.
coord_x
][
data
.
attributes
.
stu_picto
.
attributes
.
coord_y
]
=
data
.
attributes
.
stu_picto
;
}
}
$scope
.
$apply
();
});
...
...
sails/src/assets/scripts/modules/student/controllers/pictoconfig.js
View file @
6b66b364
...
...
@@ -89,12 +89,17 @@ dashboardControllers.controller('PictoConfigCtrl', function (
.
then
(
function
(
result
)
{
return
new
Promise
(
function
(
resolve
,
reject
)
{
// If update_all_legend then set attribute true
var
all_pictos
=
false
;
if
(
$scope
.
update_all_legend
)
all_pictos
=
true
;
io
.
socket
.
post
(
'/stu/vocabulary'
,
{
action
:
'update'
,
attributes
:
{
id_stu
:
stu
.
id
,
id_grid
:
viewingGrid
.
id
,
stu_picto
:
result
stu_picto
:
result
,
all_pictos
:
all_pictos
}
},
function
(
res
)
{});
...
...
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