Skip to content

Instantly share code, notes, and snippets.

@raedatoui
Last active December 17, 2015 23:39
Show Gist options
  • Save raedatoui/5690717 to your computer and use it in GitHub Desktop.
Save raedatoui/5690717 to your computer and use it in GitHub Desktop.

Revisions

  1. raedatoui revised this gist Jun 4, 2013. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions gistfile1.coffee
    Original file line number Diff line number Diff line change
    @@ -7,8 +7,7 @@
    # progress ui

    complete: (xhr) =>
    @bar.hide()
    @percent.hide()
    # fetch model based on id
    attr = JSON.parse xhr.responseText
    App.Layer.url = "/layers/#{attr.id}"
    App.Layer.one "refresh", (data) =>
  2. raedatoui revised this gist Jun 1, 2013. 1 changed file with 3 additions and 11 deletions.
    14 changes: 3 additions & 11 deletions gistfile1.coffee
    Original file line number Diff line number Diff line change
    @@ -1,24 +1,16 @@
    @form.ajaxForm
    dataType: 'json'
    beforeSend: =>
    @submitBtn.attr
    percentVal = "0%"
    @bar.show()
    @percent.show()
    @bar.width percentVal
    @percent.html percentVal
    # ui treatement

    uploadProgress: (event, position, total, percentComplete) =>
    percentVal = percentComplete + "%"
    @bar.width percentVal
    @percent.html percentVal
    # progress ui

    complete: (xhr) =>
    @bar.hide()
    @percent.hide()
    attr = JSON.parse xhr.responseText
    App.Layer.url = "/layers/#{attr.id}"
    App.Layer.one "refresh", (data) =>
    App.Layer.url = "/layers"
    Spine.trigger "dataAdded", data[0]
    App.Layer.url = "/layers"
    App.Layer.fetch()
  3. raedatoui created this gist Jun 1, 2013.
    24 changes: 24 additions & 0 deletions gistfile1.coffee
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    @form.ajaxForm
    dataType: 'json'
    beforeSend: =>
    @submitBtn.attr
    percentVal = "0%"
    @bar.show()
    @percent.show()
    @bar.width percentVal
    @percent.html percentVal

    uploadProgress: (event, position, total, percentComplete) =>
    percentVal = percentComplete + "%"
    @bar.width percentVal
    @percent.html percentVal

    complete: (xhr) =>
    @bar.hide()
    @percent.hide()
    attr = JSON.parse xhr.responseText
    App.Layer.url = "/layers/#{attr.id}"
    App.Layer.one "refresh", (data) =>
    App.Layer.url = "/layers"
    Spine.trigger "dataAdded", data[0]
    App.Layer.fetch()