home controllers refactoring

This commit is contained in:
tmshv committed 2016-02-22 01:32:55 +03:00
1 parent 8b053dc083
commit c7cf73a6d1
3 files changed
+40 -42

No files matched your search

+6 -1
View File
@@ -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';
});
@@ -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);
});
};
};