-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.js
More file actions
46 lines (38 loc) · 1.14 KB
/
app.js
File metadata and controls
46 lines (38 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
angular.module('MattinoTheme', [
'ngRoute', // in AngularJS 1.2.0 in separate module
'header',
'catalog',
'resources.fastcheckout',
'infinite-scroll',
'kmplzt.common',
'templates.app',
'templates.common'
]);
angular.module('MattinoTheme').constant('CHECKOUT_CONFIG', {
url: '/fastcheckout',
formdata: true
});
angular.module('MattinoTheme')
.config(function($locationProvider) {
$locationProvider.html5Mode(true);
});
angular.module('MattinoTheme')
.controller('FiltersCtrl', function ($scope, $resource, $location) {
$scope.$on('reload', function(event, item) {
$scope.reload(item.url);
});
$scope.reload = function(url) {
//console.log('url: ' + url);
url = url.replace(/(.*\.ru)(.*)/, '$2');
//console.log('url: ' + url);
url = window.decodeURIComponent(url);
$location.path(url);
$scope.load(url);
};
$scope.load = function(url) {
$resource(url + '?m-ajax=1&json=true&blocks=mana.catalog.leftnav')
.get(function(response) {
$scope.$broadcast('loaded', response);
});
};
});