1
0
mirror of https://github.com/moparisthebest/app-UI synced 2024-12-21 23:18:52 -05:00

bug fix in scroll that prevents selection of form elements.

This commit is contained in:
Andrew Trice 2012-05-10 09:49:29 -04:00
parent db4d649907
commit d090efe429
2 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,57 @@
<!DOCTYPE html>
<html>
<head>
<title>View Navigator Sample</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<script src="../../../src/libs/jquery-1.7.1.js"></script>
<script src="../../../src/libs/jquery.animate-enhanced.js"></script>
<script src="../../../src/libs/iscroll.js"></script>
<script src="../../../src/libs/noClickDelay.js"></script>
<link rel="stylesheet" href="../../../src/viewnavigator/viewnavigator.css" type="text/css" />
<script src="../../../src/viewnavigator/viewnavigator.js"></script>
<script>
$(document).ready( function() {
//Setup the default view
var defaultView = getView();
defaultView.backLabel = null;
//Setup the ViewNavigator
window.viewNavigator = new ViewNavigator( 'body' );
window.viewNavigator.pushView( defaultView );
} );
function pushView() {
//create a view and push it onto the view navigator
var view = getView();
window.viewNavigator.pushView( view );
}
function popView() {
//pop a view from the view navigator
window.viewNavigator.popView();
}
function getView() {
//create a view descriptor with random content
var bodyView =$('<div id="defaultView"><input type="text" placeholder="Email" /> <br/><textarea type="text" placeholder="Text Area" /> <br/>' +
'<select><option value="volvo">Red</option><option value="saab">White</option><option value="mercedes">Blue</option></select></div>');
var links = bodyView.find('a');
return { title: "Default View " + parseInt(Math.random()*1000),
backLabel: "Back",
view: bodyView
};
}
</script>
</head>
<body></body>
</html>

View File

@ -175,6 +175,8 @@ iScroll.prototype = {
switch(e.type) {
case START_EV:
if (!hasTouch && e.button !== 0) return;
var nodeName = e.target.nodeName.toUpperCase();
if (nodeName == "TEXTAREA" || nodeName == "INPUT" || nodeName == "SELECT" ) return;
that._start(e);
break;
case MOVE_EV: that._move(e); break;