home controllers refactoring
This commit is contained in:
1 parent
8b053dc083
commit
c7cf73a6d1
3 files changed
+40
-42
No files matched your search
+6
-1
@@ -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);
|
||||
});
|
||||
};
|
||||
};
|
||||
@@ -1,28 +1,30 @@
|
||||
<div class="main-block">
|
||||
<!--<div>-->
|
||||
<!--<!–<a href="tel://{{telephone}}"></a>–>-->
|
||||
<!--<span class="telephone">{{contact.telephone}}</span>-->
|
||||
<div class="content content_wide" ng-controller="HomeController">
|
||||
<div class="main-block">
|
||||
<!--<div>-->
|
||||
<!--<!–<a href="tel://{{telephone}}"></a>–>-->
|
||||
<!--<span class="telephone">{{contact.telephone}}</span>-->
|
||||
|
||||
<!--<!–<ul class="submenu">–>-->
|
||||
<!--<!–<li><a href="/team#director">директор</a><p>М. Г. Тимашева</p></li>–>-->
|
||||
<!--<!–<li><a href="/enter">поступление</a></li>–>-->
|
||||
<!--<!–<li><a href="/contacts">контактная информация</a></li>–>-->
|
||||
<!--<!–<li><a href="/awards">награды</a></li>–>-->
|
||||
<!--<!–</ul>–>-->
|
||||
<!--</div>-->
|
||||
<!--<!–<ul class="submenu">–>-->
|
||||
<!--<!–<li><a href="/team#director">директор</a><p>М. Г. Тимашева</p></li>–>-->
|
||||
<!--<!–<li><a href="/enter">поступление</a></li>–>-->
|
||||
<!--<!–<li><a href="/contacts">контактная информация</a></li>–>-->
|
||||
<!--<!–<li><a href="/awards">награды</a></li>–>-->
|
||||
<!--<!–</ul>–>-->
|
||||
<!--</div>-->
|
||||
|
||||
<h1>Шлиссельбургская детская художественная школа</h1>
|
||||
</div>
|
||||
|
||||
<div class="tape-block">
|
||||
<div class="tape-block__body">
|
||||
<div class="tape tape-tl"></div>
|
||||
<div class="tape tape-tr"></div>
|
||||
<div class="tape tape-bl"></div>
|
||||
<div class="tape tape-br"></div>
|
||||
|
||||
<div class="tape-block__content"></div>
|
||||
<h1>Шлиссельбургская детская художественная школа</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<timeline></timeline>
|
||||
<div class="tape-block">
|
||||
<div class="tape-block__body">
|
||||
<div class="tape tape-tl"></div>
|
||||
<div class="tape tape-tr"></div>
|
||||
<div class="tape tape-bl"></div>
|
||||
<div class="tape tape-br"></div>
|
||||
|
||||
<div class="tape-block__content"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<timeline></timeline>
|
||||
</div>
|
||||
Reference in new issue
Block a user