Sha256: d422e8b42356d7138041f97d0fa35282336139fcf04b02da1a70be12638fd564

Contents?: true

Size: 527 Bytes

Versions: 8

Compression:

Stored size: 527 Bytes

Contents

# Monkey patch Turbolinks to render 401
# See https://github.com/turbolinks/turbolinks/issues/179
#     https://github.com/projecthydra-labs/hyrax/issues/617
if Turbolinks?
  Turbolinks.HttpRequest.prototype.requestLoaded = ->
    @endRequest =>
      if 200 <= @xhr.status < 300 or @xhr.status == 401
        @delegate.requestCompletedWithResponse(@xhr.responseText, @xhr.getResponseHeader("Turbolinks-Location"))
      else
        @failed = true
        @delegate.requestFailedWithStatusCode(@xhr.status, @xhr.responseText)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hyrax-1.1.1 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-1.1.0 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-1.0.5 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-1.0.4 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-1.0.3 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-1.0.2 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-1.0.1 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-1.0.0.rc2 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee