From 19a970ca6c234e74ef8a01d9450e655595d4665a Mon Sep 17 00:00:00 2001 From: Daniel Freedman Date: Mon, 25 Nov 2013 15:07:34 -0800 Subject: [PATCH] support touch-action in shadows --- src/touch-action.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/touch-action.js b/src/touch-action.js index a6f06d76..3bdeafab 100644 --- a/src/touch-action.js +++ b/src/touch-action.js @@ -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 + '"]'; } @@ -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');