Skip to content

Commit

Permalink
Merging in touch support feature branch.
Browse files Browse the repository at this point in the history
  • Loading branch information
eculver committed May 14, 2012
2 parents db6abec + 740195d commit 0edf8fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion yui3/example/index.html
Expand Up @@ -19,7 +19,7 @@ <h1>Draggable Background Widget</h1>

<div id="log" class="yui3-widget yui3-console" style="width:400px; height: 600px;"></div>

<script src="http://yui.yahooapis.com/3.3.0/build/yui/yui-min.js" charset="utf-8"></script>
<script src="http://yui.yahooapis.com/3.4.1/build/yui/yui-min.js" charset="utf-8"></script>
<script src="../src/draggable-bg.js"></script>
<script>
YUI({debug: false}).use('widget-draggable-bg', function(Y) {
Expand Down
9 changes: 8 additions & 1 deletion yui3/src/draggable-bg.js
Expand Up @@ -154,6 +154,12 @@ YUI.add('widget-draggable-bg', function(Y) {
node.on('mousemove', this._onMouseMove, this);
node.on('mouseup', this._onMouseUp, this);
node.on('mouseout', this._onMouseOut, this);

// enable touch support
node.on('touchstart', this._onMouseDown, this);
node.on('touchmove', this._onMouseMove, this);
node.on('touchend', this._onMouseUp, this);
node.on('touchcancel', this._onMouseOut, this);
},

/**
Expand Down Expand Up @@ -308,6 +314,7 @@ YUI.add('widget-draggable-bg', function(Y) {
}, '0.0.1', {
requires: [
'node',
'widget'
'widget',
'event-touch'
]
});

0 comments on commit 0edf8fb

Please sign in to comment.