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
8deb8e35
authored
Dec 05, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fixed problem with personalized legend in student's pictos, (issue #650)
parent
b436ebc6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
3 deletions
sails/src/api/models/StuPicto.js
sails/src/assets/scripts/modules/student/views/pictoconfig.html
sails/src/api/models/StuPicto.js
View file @
8deb8e35
...
...
@@ -86,7 +86,9 @@ module.exports = {
status
:
'invisible'
,
highlight
:
false
,
color
:
null
,
expression
:
null
expression
:
null
,
legend
:
null
,
legend_size
:
'small'
};
if
(
typeof
attributes
===
'object'
)
{
...
...
@@ -117,6 +119,15 @@ module.exports = {
if
(
!
((
/^
(
invisible|enabled|disabled
)
$/
).
test
(
validAttributes
.
status
)))
{
delete
validAttributes
.
status
;
}
if
(
typeof
validAttributes
.
expression
!==
'string'
)
{
delete
validAttributes
.
expression
;
}
if
(
typeof
validAttributes
.
legend
!==
'boolean'
)
{
delete
validAttributes
.
legend
;
}
if
(
!
((
/^
(
small|large
)
$/
).
test
(
validAttributes
.
legend_size
)))
{
delete
validAttributes
.
legend_size
;
}
if
(
typeof
validAttributes
.
highlight
!==
'boolean'
)
{
delete
validAttributes
.
highlight
;
}
...
...
@@ -137,7 +148,7 @@ module.exports = {
*/
beforeCreate
:
function
(
attrs
,
next
)
{
if
(
typeof
attrs
.
attributes
!==
'object'
)
{
attrs
.
attributes
=
JSON
.
parse
(
attrs
.
attributes
);
attrs
.
attributes
=
JSON
.
parse
(
attrs
.
attributes
);
}
attrs
.
attributes
=
StuPicto
.
getValidAttributes
(
attrs
.
attributes
);
next
();
...
...
sails/src/assets/scripts/modules/student/views/pictoconfig.html
View file @
8deb8e35
...
...
@@ -37,7 +37,7 @@
-->
<li
class=
"list-group-item"
>
<div
class=
"checkbox"
>
<
label><input
data-toggle=
"toggle"
type=
"checkbox"
ng-model=
"studentPicto.attributes.legend"
ng-change=
"update_properties()"
translate
>
legend
</label>
<
input
data-toggle=
"toggle"
type=
"checkbox"
ng-model=
"studentPicto.attributes.legend"
ng-change=
"update_properties()"
><label
translate
>
legend
</label>
</div>
</ul>
</div>
...
...
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