diff --git a/src/client/app.js b/src/client/app.js index 955f2123..6ec6a4ff 100644 --- a/src/client/app.js +++ b/src/client/app.js @@ -7,6 +7,7 @@ import Award from './components/Award'; import GalleryItem from './components/GalleryItem'; import TeamMemberProfile from './components/TeamMemberProfile'; import AppController from './controllers/AppController'; +import HomeController from './controllers/HomeController'; import TeamController from './controllers/TeamController'; import DocumentsController from './controllers/DocumentsController'; import api from './api/api'; @@ -96,7 +97,6 @@ app.run(($location, $rootScope, $http) => { require('./filters/remove-hashtags'), require('./filters/removeNewline'), require('./filters/uppercase-first'), - require('./pages/home'), require('./pages/schedule'), require('./pages/gallery'), require('./controllers/ContactsController'), @@ -106,9 +106,14 @@ app.run(($location, $rootScope, $http) => { GalleryItem, TeamMemberProfile, AppController, + HomeController, TeamController, DocumentsController, function (app) { + app.controller('HomePageController', ($scope) => { + $scope.pageClass = 'page-home'; + }); + app.controller('SchedulePageController', ($scope) => { $scope.pageClass = 'page-schedule'; }); diff --git a/src/client/pages/home.js b/src/client/controllers/HomeController.js similarity index 58% rename from src/client/pages/home.js rename to src/client/controllers/HomeController.js index da8cff40..1051c74a 100644 --- a/src/client/pages/home.js +++ b/src/client/controllers/HomeController.js @@ -1,18 +1,10 @@ -/** - * Created by tmshv on 22/11/14. - */ - -module.exports = function (app) { - app.controller('HomePageController', function ($scope, config) { - var fotorama; - - $scope.pageClass = 'page-home'; - - var $tape = $('.tape-block'); - var $fotorama = $tape.find('.tape-block__content'); +export default function (app) { + app.controller('HomeController', () => { + let $tape = $('.tape-block'); + let $fotorama = $tape.find('.tape-block__content'); $tape.addClass('simplified'); - $fotorama.on('fotorama:ready', function () { + $fotorama.on('fotorama:ready', () => { $tape.removeClass('simplified'); fotorama.setOptions({ nav: 'dots', @@ -25,9 +17,8 @@ module.exports = function (app) { }); }); - fotorama = $fotorama.fotorama().data('fotorama'); - - setTimeout(function(){ + let fotorama = $fotorama.fotorama().data('fotorama'); + setTimeout(() => { fotorama.load([ {img: 'https://static.shburg.org/art/img/cat1.jpg'}, {img: 'https://static.shburg.org/art/img/cat2.jpg'}, @@ -35,4 +26,4 @@ module.exports = function (app) { ]); }, 100); }); -}; \ No newline at end of file +}; diff --git a/src/templates/views/home.html b/src/templates/views/home.html index d05788a4..67d22a48 100644 --- a/src/templates/views/home.html +++ b/src/templates/views/home.html @@ -1,28 +1,30 @@ -