Skip to content

Commit

Permalink
fix #643, when element has no style attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
jtangelder committed Oct 25, 2014
1 parent 1cab23e commit 5ca6d8c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ Manager.prototype = {
*/
function toggleCssProps(manager, add) {
var element = manager.element;
if(!element.style) {
return;
}
each(manager.options.cssProps, function(value, name) {
element.style[prefixed(element.style, name)] = add ? value : '';
});
Expand Down
2 changes: 1 addition & 1 deletion src/touchaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ TouchAction.prototype = {
value = this.compute();
}

if (NATIVE_TOUCH_ACTION) {
if (NATIVE_TOUCH_ACTION && this.manager.element.style) {
this.manager.element.style[PREFIXED_TOUCH_ACTION] = value;
}
this.actions = value.toLowerCase().trim();
Expand Down

0 comments on commit 5ca6d8c

Please sign in to comment.