Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
support touch-action in shadows
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Nov 25, 2013
1 parent ce6eeda commit 19a970c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/touch-action.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
* license that can be found in the LICENSE file.
*/
(function() {
function shadowSelector(v) {
return 'body ^^ ' + selector(v);
}
function selector(v) {
return '[touch-action="' + v + '"]';
}
Expand All @@ -26,9 +29,11 @@
var styles = '';
attrib2css.forEach(function(r) {
if (String(r) === r) {
styles += selector(r) + rule(r);
styles += selector(r) + rule(r) + '\n';
styles += shadowSelector(r) + rule(r) + '\n';
} else {
styles += r.selectors.map(selector) + rule(r.rule);
styles += r.selectors.map(selector) + rule(r.rule) + '\n';
styles += r.selectors.map(shadowSelector) + rule(r.rule) + '\n';
}
});
var el = document.createElement('style');
Expand Down

0 comments on commit 19a970c

Please sign in to comment.