Sha256: e8c9c2b7dbc5a842f9724c569c7c3b497f93a92304ab7c5ef5603238b0481ada

Contents?: true

Size: 892 Bytes

Versions: 15

Compression:

Stored size: 892 Bytes

Contents

class Turbolinks.Renderer
  @render: (delegate, callback, args...) ->
    renderer = new this args...
    renderer.delegate = delegate
    renderer.render(callback)
    renderer

  renderView: (callback) ->
    @delegate.viewWillRender(@newBody)
    callback()
    @delegate.viewRendered(@newBody)

  invalidateView: ->
    @delegate.viewInvalidated()

  createScriptElement: (element) ->
    if element.getAttribute("data-turbolinks-eval") is "false"
      element
    else
      createdScriptElement = document.createElement("script")
      createdScriptElement.textContent = element.textContent
      createdScriptElement.async = false
      copyElementAttributes(createdScriptElement, element)
      createdScriptElement

  copyElementAttributes = (destinationElement, sourceElement) ->
    for {name, value} in sourceElement.attributes
      destinationElement.setAttribute(name, value)

Version data entries

15 entries across 14 versions & 6 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/turbolinks/src/turbolinks/renderer.coffee
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/turbolinks/src/turbolinks/renderer.coffee
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/turbolinks/src/turbolinks/renderer.coffee
ruby2js-4.0.4 lib/tasks/testrails/node_modules/turbolinks/src/turbolinks/renderer.coffee
ruby2js-4.0.3 lib/tasks/testrails/node_modules/turbolinks/src/turbolinks/renderer.coffee
jester-data-8.0.0 node_modules/turbolinks/src/turbolinks/renderer.coffee
ezii-os-5.2.1 node_modules/turbolinks/src/turbolinks/renderer.coffee
ezii-os-2.0.1 node_modules/turbolinks/src/turbolinks/renderer.coffee
ezii-os-1.1.0 node_modules/turbolinks/src/turbolinks/renderer.coffee
ezii-os-1.0.0 node_modules/turbolinks/src/turbolinks/renderer.coffee
ezii-os-0.0.0.1.0 node_modules/turbolinks/src/turbolinks/renderer.coffee
ezii-os-0.0.0.0.1 node_modules/turbolinks/src/turbolinks/renderer.coffee
rails_auth-1.0.6 test/dummy/node_modules/turbolinks/src/turbolinks/renderer.coffee
rails_auth-1.0.5 test/dummy/node_modules/turbolinks/src/turbolinks/renderer.coffee
rails_auth-1.0.4 test/dummy/node_modules/turbolinks/src/turbolinks/renderer.coffee