Skip to content

Commit

Permalink
SSR support
Browse files Browse the repository at this point in the history
  • Loading branch information
vsorrokin committed Mar 23, 2018
1 parent 488b57a commit 860f0fe
Show file tree
Hide file tree
Showing 5 changed files with 5,424 additions and 8 deletions.
14 changes: 11 additions & 3 deletions dist/uploader.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,19 @@ var Chunk = _dereq_('./chunk')

var version = '0.2.1'

var isServer = typeof window === 'undefined'

// ie10+
var ie10plus = window.navigator.msPointerEnabled
var ie10plus = isServer ? false : window.navigator.msPointerEnabled
var support = (function () {
var sliceName = 'slice'
var _support = utils.isDefined(window.File) && utils.isDefined(window.Blob) &&
utils.isDefined(window.FileList)

var _support = false
if (!isServer) {
_support = utils.isDefined(window.File) && utils.isDefined(window.Blob) &&
utils.isDefined(window.FileList)
}

var bproto = null
if (_support) {
bproto = window.Blob.prototype
Expand All @@ -376,6 +383,7 @@ var support = (function () {
})()

var supportDirectory = (function () {
if (isServer) return null
var input = window.document.createElement('input')
input.type = 'file'
var sd = 'webkitdirectory' in input || 'directory' in input
Expand Down
Loading

0 comments on commit 860f0fe

Please sign in to comment.