Sha256: ce75980665477f4e85d22e224934cee38e0269d7da2fbcfb60a61cc6c8d92cb7

Contents?: true

Size: 517 Bytes

Versions: 15

Compression:

Stored size: 517 Bytes

Contents

# Monkey patch Turbolinks to render 401
# See https://github.com/turbolinks/turbolinks/issues/179
#     https://github.com/samvera/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

15 entries across 15 versions & 1 rubygems

Version Path
hyrax-2.0.3 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.1.0.rc1 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.1.0.beta2 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.0.2 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.1.0.beta1 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.0.1 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.0.0 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.0.0.rc3 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.0.0.rc2 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.0.0.rc1 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.0.0.beta5 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.0.0.beta4 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.0.0.beta3 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.0.0.beta2 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee
hyrax-2.0.0.beta1 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee