jameshight / emberjs-touch Goto Github PK
View Code? Open in Web Editor NEWember.js touch event helpers
ember.js touch event helpers
This goes away if the fix in
emberjs/ember.js@aafb5eb is applied to your copied version of the code.
Thanks for sharing your ember-fastclick with us! Great script.
I have found a Bug with submitting a form in HandlebarsJS:
<form {{action "login" on="submit"}}>
....
<button type="submit">
Login
</button>
This didnt work anymore ive I used your Script.
In Line 129 i add some Debug Code:
console.log("EventName: " + action.eventName + " # " + eventName);
If I click the Button, it prints:
EventName: submit # click
Eventnames are different.
Is it possible to extend your script that submitting forms also works?
We at VersionEye are working hard to keep up the quality of the bower's registry.
We just finished our initial analysis of the quality of the Bower.io registry:
7530 - registered packages, 224 of them doesnt exists anymore;
We analysed 7306 existing packages and 1070 of them don't have bower.json on the master branch ( that's where a Bower client pulls a data ).
Sadly, your library JamesHight/emberjs-touch
is one of them.
Can you spare 15 minutes to help us to make Bower better?
Just add a new file bower.json
and change attributes.
{
"name": "JamesHight/emberjs-touch",
"version": "1.0.0",
"main": "path/to/main.css",
"description": "please add it",
"license": "Eclipse",
"ignore": [
".jshintrc",
"**/*.txt"
],
"dependencies": {
"<dependency_name>": "<semantic_version>",
"<dependency_name>": "<Local_folder>",
"<dependency_name>": "<package>"
},
"devDependencies": {
"<test-framework-name>": "<version>"
}
}
Read more about bower.json on the official spefication and nodejs semver library has great examples of proper versioning.
NB! Please validate your bower.json with jsonlint before commiting your updates.
Thank you!
Timo,
twitter: @versioneye
email: [email protected]
VersionEye - no more legacy software!
The touch.enabled timeout isn't a very good solution to avoiding extra clicks. By returning false from the "second" click, you cause jQuery to preventDefault() its event handling. But the "second" click is sometimes just the same click being bubbled up to a parent view.
E.g. if I add a log right above where this logic is happening I see this for a single click on a checkbox:
Handling click in <Ember.Checkbox:ember713> touch.enabled: true ember-fastclick.js:98
Handling click in <Ember.View:ember696> touch.enabled: false ember-fastclick.js:98
So the second call sees touch disabled, and returns false. This prevents default on the click which prevents the checkbox from being triggered! There are probably other situations where this can cause trouble, but this is the most apparent in an app I am helping with.
Shouldn't the evt.preventDefault()
in your "touchend" handler already prevent the browser from sending its own click duplicating the simulated one? Or why exactly was a2fc30e added?
Thanks for sharing your great script with us! But Ihave a problem, The input field have no response sometimes on safari in ios.
I have a binding like:
<a {{bind-attr href=urlProperty}}>Foo</a>
where urlProperty
is a URL to a non-Ember location. I find that clicking on such links are broken; the browser does nothing.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. πππ
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google β€οΈ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.