Sha256: cf227699e3b0dd8af071927f850c346c43286e53c01fe9a6e8675b11220c2a0d

Contents?: true

Size: 498 Bytes

Versions: 1

Compression:

Stored size: 498 Bytes

Contents

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

1 entries across 1 versions & 1 rubygems

Version Path
hyrax-1.0.0.rc1 app/assets/javascripts/hyrax/monkey_patch_turbolinks.js.coffee