-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathangular-restaurant-menu.js
More file actions
90 lines (83 loc) · 2.48 KB
/
Copy pathangular-restaurant-menu.js
File metadata and controls
90 lines (83 loc) · 2.48 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
(function () {
'use strict';
/*
* Angular-Restaurant-Menu
* Version: 0.0.1
*
* Copyright 2015 Danish Noorani.
* Citation - This code wraps and enhance 3D Restaurant Menu Concept By Mary Lou into an angular directiv
* Link to original web app- http://tympanus.net/codrops/2012/09/25/3d-restaurant-menu-concept/
* All Rights Reserved.
* Use, reproduction, distribution, and modification of this code is subject to the terms and
* conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
*
* Author: Danish Noorani
*/
angular.module('restaurant-menu',[])
.directive('restaurantmenu',function () {
return {
restrict: 'E',
templateUrl: "/angular-restaurant-menu/restaurantmenu.html",
scope: {
menu: '=',
menucover: '=',
limitamount: '=?',
cateringmessage: '=?',
showcart: '=?',
menuopen: '=?',
removeclose: '=?',
pagination: '=?',
cateringmessage: '=?',
menuheight: '=?'
},
link: function (scope,element,attrs) {
scope.init = function() {
scope.initDomVars();
scope.initDirectiveVars();
};
scope.initDomVars = function () {
scope.container = $( '#rm-container' );
scope.cover = scope.container.find( 'div.rm-cover' );
scope.middle = scope.container.find( 'div.rm-middle' );
scope.right = scope.container.find( 'div.rm-right' );
scope.open = scope.cover.find('a.rm-button-open');
scope.close = scope.right.find('span.rm-close');
scope.details = scope.container.find( 'a.rm-viewdetails' );
scope.modal = $('.rm-modal');
scope.coverspacing = $('.rm-content h3');
};
scope.initDirectiveVars = function () {
scope.viewDetails = false;
scope.leftoffset=0;
scope.midoffset=0;
scope.rightoffset=0;
if(!scope.pagination){
scope.limitamount = undefined;
}
if(scope.menuheight){
scope.container.height(scope.menuheight);
if(scope.menuheight < 600){
scope.coverspacing.css({"margin": "0px", "padding":"0px"});
}
}
scope.totalprice=0;
scope.cart = {};
}
scope.openMenu = function () {
scope.menuopen = true;
};
scope.closeMenu = function () {
scope.detailsView = false;
scope.currDish = null;
scope.menuopen = false;
console.log('hi');
};
scope.showViewDetails = function (dish) {
scope.detailsView = true;
scope.currDish = dish;
};
scope.init();
}
};
});
}());