nexus site path corrected
[portal.git] / ecomp-portal-FE / client / bower_components / angular-material / modules / js / swipe / swipe.js
1 /*!
2  * Angular Material Design
3  * https://github.com/angular/material
4  * @license MIT
5  * v0.9.8
6  */
7 (function( window, angular, undefined ){
8 "use strict";
9
10 /**
11  * @ngdoc module
12  * @name material.components.swipe
13  * @description Swipe module!
14  */
15 /**
16  * @ngdoc directive
17  * @module material.components.swipe
18  * @name mdSwipeLeft
19  *
20  * @restrict A
21  *
22  * @description
23  * The md-swipe-left directives allows you to specify custom behavior when an element is swiped
24  * left.
25  *
26  * @usage
27  * <hljs lang="html">
28  * <div md-swipe-left="onSwipeLeft()">Swipe me left!</div>
29  * </hljs>
30  */
31 /**
32  * @ngdoc directive
33  * @module material.components.swipe
34  * @name mdSwipeRight
35  *
36  * @restrict A
37  *
38  * @description
39  * The md-swipe-right directives allows you to specify custom behavior when an element is swiped
40  * right.
41  *
42  * @usage
43  * <hljs lang="html">
44  * <div md-swipe-right="onSwipeRight()">Swipe me right!</div>
45  * </hljs>
46  */
47
48 angular.module('material.components.swipe', ['material.core'])
49     .directive('mdSwipeLeft', getDirective('SwipeLeft'))
50     .directive('mdSwipeRight', getDirective('SwipeRight'));
51
52 function getDirective(name) {
53   var directiveName = 'md' + name;
54   var eventName = '$md.' + name.toLowerCase();
55
56     DirectiveFactory.$inject = ["$parse"];
57   return DirectiveFactory;
58
59   /* ngInject */
60   function DirectiveFactory($parse) {
61       return { restrict: 'A', link: postLink };
62       function postLink(scope, element, attr) {
63         var fn = $parse(attr[directiveName]);
64         element.on(eventName, function(ev) {
65           scope.$apply(function() { fn(scope, { $event: ev }); });
66         });
67       }
68     }
69 }
70
71
72
73 })(window, window.angular);