fix(ionContent) - Fixed embedded object click. Fixes #723

This commit is contained in:
Max Lynch
2014-03-04 13:34:55 -06:00
parent 38bd17ea2d
commit 1b096a4251
2 changed files with 80 additions and 1 deletions

View File

@@ -0,0 +1,76 @@
<html ng-app="navTest">
<head>
<meta charset="utf-8">
<title>Content</title>
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="../../../../dist/css/ionic.css">
<script src="../../../../dist/js/ionic.bundle.js"></script>
<style>
.reveal-animation {
/*
-webkit-transform: translate3d(0%, 0, 0);
transform: translate3d(0%, 0, 0);
-webkit-transition: -webkit-transform 1s ease-in-out;
transition: transform 1s ease-in-out;
*/
}
.reveal-animation.ng-enter {
-webkit-transition: .2s ease-in-out all;
-webkit-transform:translate3d(100%,0,0) ;
}
.reveal-animation.ng-enter-active {
-webkit-transform:translate3d(0,0,0) ;
}
.reveal-animation.ng-leave {
-webkit-transition: .2s ease-in-out all;
-webkit-transform:translate3d(0%,0,0);
}
.reveal-animation.ng-leave-active {
-webkit-transition: .2s ease-in-out all;
-webkit-transform:translate3d(-100%,0,0);
}
.scroll-refresher {
border-bottom: 1px solid #eee;
}
#refresh-content {
color: #999;
text-align: center;
font-size: 48px;
position: absolute;
bottom: 10px;
width: 100%;
}
#search-box {
margin-bottom: 20px;
}
.scroll {
}
</style>
</head>
<body>
<ion-pane>
<ion-header-bar id="header" title="'Title'" type="bar-primary" hides-header></ion-header-bar>
<ion-content id="container" padding="true">
<object width="560" height="315">
<param name="movie" value="//www.youtube.com/v/WzhW20hLp6M?version=3&amp;hl=uk_UA&amp;rel=0"></param>
<param name="allowFullScreen" value="true"></param
<param name="allowscriptaccess" value="always"></param>
<embed src="//www.youtube.com/v/WzhW20hLp6M?version=3&amp;hl=uk_UA&amp;rel=0" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed>
</object>
</ion-content>
</ion-pane>
<script>
angular.module('navTest', ['ionic'])
</script>
</body>
</html>

View File

@@ -1,4 +1,5 @@
var IS_INPUT_LIKE_REGEX = /input|textarea|select/i;
var IS_EMBEDDED_OBJECT_REGEX = /object|embed/i;
/*
* Scroller
* http://github.com/zynga/scroller
@@ -620,7 +621,8 @@ ionic.views.Scroll = ionic.views.View.inherit({
function shouldIgnorePress(e) {
// Don't react if initial down happens on a form element
return e.target.tagName.match(IS_INPUT_LIKE_REGEX) ||
e.target.isContentEditable;
e.target.isContentEditable ||
e.target.tagName.match(IS_EMBEDDED_OBJECT_REGEX);
}
@@ -650,6 +652,7 @@ ionic.views.Scroll = ionic.views.View.inherit({
var mousedown = false;
container.addEventListener("mousedown", function(e) {
console.log('Touch start', e);
if (e.defaultPrevented || shouldIgnorePress(e)) {
return;
}