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
a7c4d676
authored
Nov 30, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
minor bug fixed when adding pictos
parent
51d0f4ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
sails/src/assets/scripts/modules/student/controllers/collections.js
sails/src/assets/scripts/modules/student/controllers/collections.js
View file @
a7c4d676
...
@@ -70,6 +70,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
...
@@ -70,6 +70,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
// function to make category colores brighter
// function to make category colores brighter
$scope
.
shadeColor
=
function
(
color
,
percent
)
{
$scope
.
shadeColor
=
function
(
color
,
percent
)
{
if
(
!
color
)
return
;
var
f
=
parseInt
(
color
.
slice
(
1
),
16
),
t
=
percent
<
0
?
0
:
255
,
p
=
percent
<
0
?
percent
*-
1
:
percent
,
R
=
f
>>
16
,
G
=
f
>>
8
&
0x00FF
,
B
=
f
&
0x0000FF
;
var
f
=
parseInt
(
color
.
slice
(
1
),
16
),
t
=
percent
<
0
?
0
:
255
,
p
=
percent
<
0
?
percent
*-
1
:
percent
,
R
=
f
>>
16
,
G
=
f
>>
8
&
0x00FF
,
B
=
f
&
0x0000FF
;
return
"#"
+
(
0x1000000
+
(
Math
.
round
((
t
-
R
)
*
p
)
+
R
)
*
0x10000
+
(
Math
.
round
((
t
-
G
)
*
p
)
+
G
)
*
0x100
+
(
Math
.
round
((
t
-
B
)
*
p
)
+
B
)).
toString
(
16
).
slice
(
1
);
return
"#"
+
(
0x1000000
+
(
Math
.
round
((
t
-
R
)
*
p
)
+
R
)
*
0x10000
+
(
Math
.
round
((
t
-
G
)
*
p
)
+
G
)
*
0x100
+
(
Math
.
round
((
t
-
B
)
*
p
)
+
B
)).
toString
(
16
).
slice
(
1
);
};
};
...
@@ -102,6 +104,11 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
...
@@ -102,6 +104,11 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
var
freeCategoryPositionY
=
picto
.
attributes
.
free_category_coord_y
;
var
freeCategoryPositionY
=
picto
.
attributes
.
free_category_coord_y
;
var
category
;
var
category
;
// Fill with grid (if not done before)
$scope
.
freeCategoryPictos
=
$scope
.
freeCategoryPictos
||
generateGrid
();
$scope
.
studentPictos
[
$scope
.
getCategoryId
(
$scope
.
selectedCategory
)]
=
$scope
.
studentPictos
[
$scope
.
getCategoryId
(
$scope
.
selectedCategory
)]
||
generateGrid
();
if
(
$scope
.
isCategory
(
picto
))
{
if
(
$scope
.
isCategory
(
picto
))
{
$scope
.
categories
.
push
(
picto
);
$scope
.
categories
.
push
(
picto
);
}
}
...
@@ -326,6 +333,7 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
...
@@ -326,6 +333,7 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
// Send the picto to the server
// Send the picto to the server
$http
.
post
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
+
'/picto/'
+
pictoId
,
{
$http
.
post
(
config
.
backend
+
'/stu/'
+
$scope
.
studentData
.
id
+
'/picto/'
+
pictoId
,
{
attributes
:
{
attributes
:
{
id_cat
:
$scope
.
showFreeCategory
?
null
:
$scope
.
getCategoryId
(
$scope
.
selectedCategory
),
coord_x
:
$scope
.
showFreeCategory
?
null
:
col
,
coord_x
:
$scope
.
showFreeCategory
?
null
:
col
,
coord_y
:
$scope
.
showFreeCategory
?
null
:
row
,
coord_y
:
$scope
.
showFreeCategory
?
null
:
row
,
status
:
'enabled'
,
status
:
'enabled'
,
...
@@ -352,7 +360,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
...
@@ -352,7 +360,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
});
});
});
});
$scope
.
loadPictos
();
// not needed
// $scope.loadPictos();
});
});
};
};
...
...
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