ember-gestures
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -47,4 +47,2 @@ import Ember from 'ember'; | ||
Ember.Logger.debug('updating css', value); | ||
// TODO can this happen via this.css ? | ||
@@ -92,3 +90,3 @@ this.animate(element, {translateX: value + 'px'}, {duration: 1}); | ||
var allowPanRight = !this.get('_value'); | ||
var dX = e.gesture.deltaX; | ||
var dX = e.originalEvent.gesture.deltaX; | ||
@@ -95,0 +93,0 @@ if (allowPanRight) { |
@@ -7,2 +7,3 @@ import Ember from 'ember'; | ||
import jQuery from 'jquery'; | ||
import mobileDetection from './utils/is-mobile'; | ||
@@ -50,5 +51,45 @@ const eventEndings = { | ||
_fastFocus() { | ||
let $root = jQuery(this.get('rootElement')); | ||
$root.on('click.ember-gestures, touchend.ember-gestures', function (e) { | ||
/* | ||
Implements fastfocus mechanisms on mobile web/Cordova | ||
*/ | ||
if (mobileDetection.is()) { | ||
var $element = jQuery(e.currentTarget); | ||
var $target = jQuery(e.target); | ||
/* | ||
If the click was on an input element that needs to be able to focus, recast | ||
the click as a "focus" event. | ||
This fixes tap events on mobile where keyboardShrinksView or similar is true. | ||
Such devices depend on the ghost click to trigger focus, but the ghost click | ||
will never reach the element. | ||
*/ | ||
var notFocusableTypes = ['submit', 'file', 'button', 'hidden', 'reset', 'range', 'radio', 'image', 'checkbox']; | ||
//fastfocus | ||
if ($element.is('textarea') || ($element.is('input') && notFocusableTypes.indexOf($element.attr('type')) === -1)) { | ||
$element.focus(); | ||
} else if ($target.is('textarea') || ($target.is('input') && notFocusableTypes.indexOf($target.attr('type')) === -1)) { | ||
$target.focus(); | ||
} | ||
} | ||
}); | ||
}, | ||
willDestroy() { | ||
this._super(); | ||
jQuery(this.get('rootElement')).off('.ember-gestures'); | ||
}, | ||
setup: function (addedEvents, rootElement) { | ||
this._initializeGestures(); | ||
this._fastFocus(); | ||
let events = this.get('events'); | ||
@@ -55,0 +96,0 @@ let _events = merge({}, events); |
@@ -27,3 +27,3 @@ /*global Hammer*/ | ||
let eventName = camelize(name).toLowerCase(); | ||
let eventName = details.includeEvents ? camelize(name).toLowerCase() : details.recognizer; | ||
let gesture = capitalize(details.recognizer); | ||
@@ -30,0 +30,0 @@ |
@@ -10,3 +10,3 @@ module.exports = { | ||
{ name: 'runspired/hammer.js', target: 'develop' }, | ||
{ name: 'hammer-time', target: '0.2.0'} | ||
{ name: 'hammer-time', target: '0.2.2'} | ||
]; | ||
@@ -13,0 +13,0 @@ return this.addBowerPackagesToProject(bowerPackages); |
@@ -10,3 +10,3 @@ /* jshint node: true */ | ||
app.import(app.bowerDirectory + '/hammerjs/hammer.min.js'); | ||
app.import(app.bowerDirectory + '/hammer-time/hammer-time.js'); | ||
// app.import(app.bowerDirectory + '/hammer-time/hammer-time.js'); | ||
}, | ||
@@ -13,0 +13,0 @@ |
{ | ||
"name": "ember-gestures", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"description": "Gesture and Mobile support for Ambitious Ember Applications", | ||
@@ -5,0 +5,0 @@ "directories": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72
1132
82675