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
a03a5fb6
authored
Jul 07, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
scroll when clicking on category working
parent
133bf447
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
10 deletions
sails/src/assets/scripts/controllers/main.js
sails/src/assets/scripts/modules/student/controllers/collections.js
sails/src/assets/scripts/modules/student/views/collections.html
sails/src/assets/scripts/controllers/main.js
View file @
a03a5fb6
...
...
@@ -20,12 +20,12 @@ var dashboardControllers = angular.module('dashboardControllers', ['dashboardCon
// Main Controller
//
//
dashboardControllers
.
controller
(
'MainCtrl'
,
function
MainCtrl
(
$scope
,
$window
,
$location
,
$translate
)
{
dashboardControllers
.
controller
(
'MainCtrl'
,
function
MainCtrl
(
$scope
,
$window
,
$location
,
$translate
,
$rootScope
)
{
// Always use objects if we want to modify this scope in the childs
// Save name and surname in global scope
$scope
.
user
=
{
$scope
.
user
=
{
id
:
''
,
name
:
''
,
surname
:
''
,
...
...
@@ -43,7 +43,7 @@ dashboardControllers.controller('MainCtrl', function MainCtrl($scope, $window, $
lang
=
'es-es'
;
$translate
.
use
(
lang
);
//$translateProvider.preferredLanguage('es-es');
//---------------------------------------------------------------
...
...
@@ -56,6 +56,14 @@ dashboardControllers.controller('MainCtrl', function MainCtrl($scope, $window, $
$scope
.
logout
();
});
//-------------------------------------------
// For scrolling when using routig
//
$rootScope
.
$on
(
'$routeChangeSuccess'
,
function
(
newRoute
,
oldRoute
)
{
$location
.
hash
(
$routeParams
.
scrollTo
);
$anchorScroll
();
});
//---------------------------------------------------------------
// Controller's functions
//
...
...
@@ -77,4 +85,4 @@ dashboardControllers.controller('MainCtrl', function MainCtrl($scope, $window, $
// Redirect to login
$location
.
path
(
'/login'
);
};
});
\ No newline at end of file
});
sails/src/assets/scripts/modules/student/controllers/collections.js
View file @
a03a5fb6
...
...
@@ -13,7 +13,9 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$http
,
config
,
$window
,
$location
,
$filter
,
$anchorScroll
,
$modal
)
{
$scope
.
emptyStudentPicto
=
{
id
:
null
,
...
...
@@ -119,11 +121,8 @@ dashboardControllers.controller('StudentCollectionsCtrl', function StudentCollec
$scope
.
show_category
=
function
(
studentPicto
)
{
if
(
$scope
.
isCategory
(
studentPicto
))
{
$scope
.
selectedCategory
=
studentPicto
;
setTimeout
(
function
()
{
$
(
document
.
body
).
animate
({
scrollTop
:
$
(
'#picto-category-grid'
).
position
().
top
},
500
);
},
0
);
$location
.
hash
(
'picto-category-grid'
);
$anchorScroll
();
}
};
...
...
sails/src/assets/scripts/modules/student/views/collections.html
View file @
a03a5fb6
...
...
@@ -125,6 +125,7 @@
<div
class=
"clearfix"
></div>
</div>
</div>
<a
name=
"picto-category-grid"
/>
<div
id=
"picto-category-grid"
class=
"picto-grid picto-category-grid"
...
...
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