Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit 94ec84e

Browse files
btfordIgorMinar
authored andcommitted
chore(ngMobile): rename module ngTouch and file to angular-touch.js
BREAKING CHANGE: since all the code in the ngMobile module is touch related, we are renaming the module to ngTouch. To migrate, please replace all references to "ngMobile" with "ngTouch" and "angular-mobile.js" to "angular-touch.js". Closes #3526
1 parent 0d17838 commit 94ec84e

File tree

11 files changed

+33
-33
lines changed

11 files changed

+33
-33
lines changed

Gruntfile.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,13 @@ module.exports = function(grunt) {
124124
dest: 'build/angular-loader.js',
125125
src: util.wrap(['src/loader.js'], 'loader')
126126
},
127-
mobile: {
128-
dest: 'build/angular-mobile.js',
127+
touch: {
128+
dest: 'build/angular-touch.js',
129129
src: util.wrap([
130-
'src/ngMobile/mobile.js',
131-
'src/ngMobile/swipe.js',
132-
'src/ngMobile/directive/ngClick.js',
133-
'src/ngMobile/directive/ngSwipe.js'
130+
'src/ngTouch/touch.js',
131+
'src/ngTouch/swipe.js',
132+
'src/ngTouch/directive/ngClick.js',
133+
'src/ngTouch/directive/ngSwipe.js'
134134
], 'module')
135135
},
136136
mocks: {
@@ -174,7 +174,7 @@ module.exports = function(grunt) {
174174
animate: 'build/angular-animate.js',
175175
cookies: 'build/angular-cookies.js',
176176
loader: 'build/angular-loader.js',
177-
mobile: 'build/angular-mobile.js',
177+
touch: 'build/angular-touch.js',
178178
resource: 'build/angular-resource.js',
179179
route: 'build/angular-route.js',
180180
sanitize: 'build/angular-sanitize.js'

angularFiles.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,10 @@ angularFiles = {
7575
'src/ngSanitize/sanitize.js',
7676
'src/ngSanitize/filter/linky.js',
7777
'src/ngMock/angular-mocks.js',
78-
'src/ngMobile/mobile.js',
79-
'src/ngMobile/swipe.js',
80-
'src/ngMobile/directive/ngClick.js',
81-
'src/ngMobile/directive/ngSwipe.js',
78+
'src/ngTouch/touch.js',
79+
'src/ngTouch/swipe.js',
80+
'src/ngTouch/directive/ngClick.js',
81+
'src/ngTouch/directive/ngSwipe.js',
8282
'docs/components/angular-bootstrap/bootstrap.js'
8383
],
8484

@@ -113,7 +113,7 @@ angularFiles = {
113113
'test/ngRoute/**/*.js',
114114
'test/ngSanitize/**/*.js',
115115
'test/ngMock/*.js',
116-
'test/ngMobile/**/*.js'
116+
'test/ngTouch/**/*.js'
117117
],
118118

119119
'karma': [
@@ -150,7 +150,7 @@ angularFiles = {
150150
'test/ngRoute/**/*.js',
151151
'test/ngResource/*.js',
152152
'test/ngSanitize/**/*.js',
153-
'test/ngMobile/**/*.js'
153+
'test/ngTouch/**/*.js'
154154
],
155155

156156
'karmaJquery': [

docs/src/templates/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
addTag('script', {src: path('angular-route.js') }, sync);
4646
addTag('script', {src: path('angular-cookies.js') }, sync);
4747
addTag('script', {src: path('angular-sanitize.js') }, sync);
48-
addTag('script', {src: path('angular-mobile.js') }, sync);
48+
addTag('script', {src: path('angular-touch.js') }, sync);
4949
addTag('script', {src: path('angular-animate.js') }, sync);
5050
addTag('script', {src: 'components/angular-bootstrap.js' }, sync);
5151
addTag('script', {src: 'components/angular-bootstrap-prettify.js' }, sync);

karma-docs.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ module.exports = function(config) {
1212
'build/angular-cookies.js',
1313
'build/angular-mocks.js',
1414
'build/angular-resource.js',
15-
'build/angular-mobile.js',
15+
'build/angular-touch.js',
1616
'build/angular-sanitize.js',
1717
'build/angular-route.js',
1818
'build/angular-animate.js',

src/ngMobile/directive/ngClick.js src/ngTouch/directive/ngClick.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* @ngdoc directive
5-
* @name ngMobile.directive:ngClick
5+
* @name ngTouch.directive:ngClick
66
*
77
* @description
88
* A more powerful replacement for the default ngClick designed to be used on touchscreen
@@ -31,15 +31,15 @@
3131
</doc:example>
3232
*/
3333

34-
ngMobile.config(['$provide', function($provide) {
34+
ngTouch.config(['$provide', function($provide) {
3535
$provide.decorator('ngClickDirective', ['$delegate', function($delegate) {
3636
// drop the default ngClick directive
3737
$delegate.shift();
3838
return $delegate;
3939
}]);
4040
}]);
4141

42-
ngMobile.directive('ngClick', ['$parse', '$timeout', '$rootElement',
42+
ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
4343
function($parse, $timeout, $rootElement) {
4444
var TAP_DURATION = 750; // Shorter than 750ms is a tap, longer is a taphold or drag.
4545
var MOVE_TOLERANCE = 12; // 12px seems to work in most mobile browsers.

src/ngMobile/directive/ngSwipe.js src/ngTouch/directive/ngSwipe.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* @ngdoc directive
5-
* @name ngMobile.directive:ngSwipeLeft
5+
* @name ngTouch.directive:ngSwipeLeft
66
*
77
* @description
88
* Specify custom behavior when an element is swiped to the left on a touchscreen device.
@@ -29,7 +29,7 @@
2929

3030
/**
3131
* @ngdoc directive
32-
* @name ngMobile.directive:ngSwipeRight
32+
* @name ngTouch.directive:ngSwipeRight
3333
*
3434
* @description
3535
* Specify custom behavior when an element is swiped to the right on a touchscreen device.
@@ -55,7 +55,7 @@
5555
*/
5656

5757
function makeSwipeDirective(directiveName, direction, eventName) {
58-
ngMobile.directive(directiveName, ['$parse', '$swipe', function($parse, $swipe) {
58+
ngTouch.directive(directiveName, ['$parse', '$swipe', function($parse, $swipe) {
5959
// The maximum vertical delta for a swipe should be less than 75px.
6060
var MAX_VERTICAL_DISTANCE = 75;
6161
// Vertical distance should not be more than a fraction of the horizontal distance.

src/ngMobile/swipe.js src/ngTouch/swipe.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
/**
44
* @ngdoc object
5-
* @name ngMobile.$swipe
5+
* @name ngTouch.$swipe
66
*
77
* @description
88
* The `$swipe` service is a service that abstracts the messier details of hold-and-drag swipe
99
* behavior, to make implementing swipe-related directives more convenient.
1010
*
11-
* It is used by the `ngSwipeLeft` and `ngSwipeRight` directives in `ngMobile`, and by
11+
* It is used by the `ngSwipeLeft` and `ngSwipeRight` directives in `ngTouch`, and by
1212
* `ngCarousel` in a separate component.
1313
*
1414
* # Usage
@@ -17,7 +17,7 @@
1717
* documentation for `bind` below.
1818
*/
1919

20-
ngMobile.factory('$swipe', [function() {
20+
ngTouch.factory('$swipe', [function() {
2121
// The total distance in any direction before we make the call on swipe vs. scroll.
2222
var MOVE_BUFFER_RADIUS = 10;
2323

@@ -37,8 +37,8 @@ ngMobile.factory('$swipe', [function() {
3737
return {
3838
/**
3939
* @ngdoc method
40-
* @name ngMobile.$swipe#bind
41-
* @methodOf ngMobile.$swipe
40+
* @name ngTouch.$swipe#bind
41+
* @methodOf ngTouch.$swipe
4242
*
4343
* @description
4444
* The main method of `$swipe`. It takes an element to be watched for swipe motions, and an

src/ngMobile/mobile.js src/ngTouch/touch.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
/**
44
* @ngdoc overview
5-
* @name ngMobile
5+
* @name ngTouch
66
* @description
77
* Touch events and other mobile helpers.
88
* Based on jQuery Mobile touch event handling (jquerymobile.com)
99
*/
1010

11-
// define ngMobile module
12-
var ngMobile = angular.module('ngMobile', []);
11+
// define ngTouch module
12+
var ngTouch = angular.module('ngTouch', []);
1313

test/ngMobile/directive/ngClickSpec.js test/ngTouch/directive/ngClickSpec.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
describe('ngClick (mobile)', function() {
3+
describe('ngClick (touch)', function() {
44
var element, time, orig_now;
55

66
// TODO(braden): Once we have other touch-friendly browsers on CI, allow them here.
@@ -16,7 +16,7 @@ describe('ngClick (mobile)', function() {
1616

1717

1818
beforeEach(function() {
19-
module('ngMobile');
19+
module('ngTouch');
2020
orig_now = Date.now;
2121
time = 0;
2222
Date.now = mockTime;

test/ngMobile/directive/ngSwipeSpec.js test/ngTouch/directive/ngSwipeSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var swipeTests = function(description, restrictBrowsers, startEvent, moveEvent,
2323
}
2424

2525
beforeEach(function() {
26-
module('ngMobile');
26+
module('ngTouch');
2727
});
2828

2929
afterEach(function() {

test/ngMobile/swipeSpec.js test/ngTouch/swipeSpec.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ var swipeTests = function(description, restrictBrowsers, startEvent, moveEvent,
2323
}
2424

2525
beforeEach(function() {
26-
module('ngMobile');
26+
module('ngTouch');
2727
});
2828

2929
afterEach(function() {

0 commit comments

Comments
 (0)