Skip to content

Commit

Permalink
Do nothing in Node.js environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladislav Kosinov authored and Vladislav Kosinov committed May 18, 2015
1 parent 93b5d45 commit 29c1ba4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dest/autosize.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@

var autosize = null;

// Do nothing in IE8 or lower
if (typeof window.getComputedStyle !== 'function') {
// Do nothing in Node.js environment and IE8 (or lower)
if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
autosize = function (el) {
return el;
};
Expand Down
2 changes: 1 addition & 1 deletion dest/autosize.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/autosize.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ function update(ta) {

let autosize = null;

// Do nothing in IE8 or lower
if (typeof window.getComputedStyle !== 'function') {
// Do nothing in Node.js environment and IE8 (or lower)
if (typeof window === 'undefined' || typeof window.getComputedStyle !== 'function') {
autosize = el => el;
autosize.destroy = el => el;
autosize.update = el => el;
Expand Down

0 comments on commit 29c1ba4

Please sign in to comment.