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

Commit

Permalink
chore(ngMobile): rename module ngTouch and file to angular-touch.js
Browse files Browse the repository at this point in the history
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
  • Loading branch information
btford authored and IgorMinar committed Aug 9, 2013
1 parent 0d17838 commit 94ec84e
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
14 changes: 7 additions & 7 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ module.exports = function(grunt) {
dest: 'build/angular-loader.js',
src: util.wrap(['src/loader.js'], 'loader')
},
mobile: {
dest: 'build/angular-mobile.js',
touch: {
dest: 'build/angular-touch.js',
src: util.wrap([
'src/ngMobile/mobile.js',
'src/ngMobile/swipe.js',
'src/ngMobile/directive/ngClick.js',
'src/ngMobile/directive/ngSwipe.js'
'src/ngTouch/touch.js',
'src/ngTouch/swipe.js',
'src/ngTouch/directive/ngClick.js',
'src/ngTouch/directive/ngSwipe.js'
], 'module')
},
mocks: {
Expand Down Expand Up @@ -174,7 +174,7 @@ module.exports = function(grunt) {
animate: 'build/angular-animate.js',
cookies: 'build/angular-cookies.js',
loader: 'build/angular-loader.js',
mobile: 'build/angular-mobile.js',
touch: 'build/angular-touch.js',
resource: 'build/angular-resource.js',
route: 'build/angular-route.js',
sanitize: 'build/angular-sanitize.js'
Expand Down
12 changes: 6 additions & 6 deletions angularFiles.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ angularFiles = {
'src/ngSanitize/sanitize.js',
'src/ngSanitize/filter/linky.js',
'src/ngMock/angular-mocks.js',
'src/ngMobile/mobile.js',
'src/ngMobile/swipe.js',
'src/ngMobile/directive/ngClick.js',
'src/ngMobile/directive/ngSwipe.js',
'src/ngTouch/touch.js',
'src/ngTouch/swipe.js',
'src/ngTouch/directive/ngClick.js',
'src/ngTouch/directive/ngSwipe.js',
'docs/components/angular-bootstrap/bootstrap.js'
],

Expand Down Expand Up @@ -113,7 +113,7 @@ angularFiles = {
'test/ngRoute/**/*.js',
'test/ngSanitize/**/*.js',
'test/ngMock/*.js',
'test/ngMobile/**/*.js'
'test/ngTouch/**/*.js'
],

'karma': [
Expand Down Expand Up @@ -150,7 +150,7 @@ angularFiles = {
'test/ngRoute/**/*.js',
'test/ngResource/*.js',
'test/ngSanitize/**/*.js',
'test/ngMobile/**/*.js'
'test/ngTouch/**/*.js'
],

'karmaJquery': [
Expand Down
2 changes: 1 addition & 1 deletion docs/src/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
addTag('script', {src: path('angular-route.js') }, sync);
addTag('script', {src: path('angular-cookies.js') }, sync);
addTag('script', {src: path('angular-sanitize.js') }, sync);
addTag('script', {src: path('angular-mobile.js') }, sync);
addTag('script', {src: path('angular-touch.js') }, sync);
addTag('script', {src: path('angular-animate.js') }, sync);
addTag('script', {src: 'components/angular-bootstrap.js' }, sync);
addTag('script', {src: 'components/angular-bootstrap-prettify.js' }, sync);
Expand Down
2 changes: 1 addition & 1 deletion karma-docs.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = function(config) {
'build/angular-cookies.js',
'build/angular-mocks.js',
'build/angular-resource.js',
'build/angular-mobile.js',
'build/angular-touch.js',
'build/angular-sanitize.js',
'build/angular-route.js',
'build/angular-animate.js',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* @ngdoc directive
* @name ngMobile.directive:ngClick
* @name ngTouch.directive:ngClick
*
* @description
* A more powerful replacement for the default ngClick designed to be used on touchscreen
Expand Down Expand Up @@ -31,15 +31,15 @@
</doc:example>
*/

ngMobile.config(['$provide', function($provide) {
ngTouch.config(['$provide', function($provide) {
$provide.decorator('ngClickDirective', ['$delegate', function($delegate) {
// drop the default ngClick directive
$delegate.shift();
return $delegate;
}]);
}]);

ngMobile.directive('ngClick', ['$parse', '$timeout', '$rootElement',
ngTouch.directive('ngClick', ['$parse', '$timeout', '$rootElement',
function($parse, $timeout, $rootElement) {
var TAP_DURATION = 750; // Shorter than 750ms is a tap, longer is a taphold or drag.
var MOVE_TOLERANCE = 12; // 12px seems to work in most mobile browsers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* @ngdoc directive
* @name ngMobile.directive:ngSwipeLeft
* @name ngTouch.directive:ngSwipeLeft
*
* @description
* Specify custom behavior when an element is swiped to the left on a touchscreen device.
Expand All @@ -29,7 +29,7 @@

/**
* @ngdoc directive
* @name ngMobile.directive:ngSwipeRight
* @name ngTouch.directive:ngSwipeRight
*
* @description
* Specify custom behavior when an element is swiped to the right on a touchscreen device.
Expand All @@ -55,7 +55,7 @@
*/

function makeSwipeDirective(directiveName, direction, eventName) {
ngMobile.directive(directiveName, ['$parse', '$swipe', function($parse, $swipe) {
ngTouch.directive(directiveName, ['$parse', '$swipe', function($parse, $swipe) {
// The maximum vertical delta for a swipe should be less than 75px.
var MAX_VERTICAL_DISTANCE = 75;
// Vertical distance should not be more than a fraction of the horizontal distance.
Expand Down
10 changes: 5 additions & 5 deletions src/ngMobile/swipe.js → src/ngTouch/swipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

/**
* @ngdoc object
* @name ngMobile.$swipe
* @name ngTouch.$swipe
*
* @description
* The `$swipe` service is a service that abstracts the messier details of hold-and-drag swipe
* behavior, to make implementing swipe-related directives more convenient.
*
* It is used by the `ngSwipeLeft` and `ngSwipeRight` directives in `ngMobile`, and by
* It is used by the `ngSwipeLeft` and `ngSwipeRight` directives in `ngTouch`, and by
* `ngCarousel` in a separate component.
*
* # Usage
Expand All @@ -17,7 +17,7 @@
* documentation for `bind` below.
*/

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

Expand All @@ -37,8 +37,8 @@ ngMobile.factory('$swipe', [function() {
return {
/**
* @ngdoc method
* @name ngMobile.$swipe#bind
* @methodOf ngMobile.$swipe
* @name ngTouch.$swipe#bind
* @methodOf ngTouch.$swipe
*
* @description
* The main method of `$swipe`. It takes an element to be watched for swipe motions, and an
Expand Down
6 changes: 3 additions & 3 deletions src/ngMobile/mobile.js → src/ngTouch/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

/**
* @ngdoc overview
* @name ngMobile
* @name ngTouch
* @description
* Touch events and other mobile helpers.
* Based on jQuery Mobile touch event handling (jquerymobile.com)
*/

// define ngMobile module
var ngMobile = angular.module('ngMobile', []);
// define ngTouch module
var ngTouch = angular.module('ngTouch', []);

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

describe('ngClick (mobile)', function() {
describe('ngClick (touch)', function() {
var element, time, orig_now;

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


beforeEach(function() {
module('ngMobile');
module('ngTouch');
orig_now = Date.now;
time = 0;
Date.now = mockTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var swipeTests = function(description, restrictBrowsers, startEvent, moveEvent,
}

beforeEach(function() {
module('ngMobile');
module('ngTouch');
});

afterEach(function() {
Expand Down
2 changes: 1 addition & 1 deletion test/ngMobile/swipeSpec.js → test/ngTouch/swipeSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var swipeTests = function(description, restrictBrowsers, startEvent, moveEvent,
}

beforeEach(function() {
module('ngMobile');
module('ngTouch');
});

afterEach(function() {
Expand Down

0 comments on commit 94ec84e

Please sign in to comment.