app/assets/javascripts/redditor/redditor.coffee in redditor-0.1.5 vs app/assets/javascripts/redditor/redditor.coffee in redditor-0.1.6

- old
+ new

@@ -1,5 +1,8 @@ +#= require fileapi +#= require fileapi/uploader + window.REDDE = {redditor: {}} REDDE.redditor.sliderBlockImagesSortableParams = scroll: false dropOnEmpty: false cursor: "crosshair" @@ -31,11 +34,11 @@ REDDE.redditor.setPositions = -> $el = REDDE.redditor.$el $el.find($el.sortable("option", "items")).each (i) -> - $(this).find("input.js-position").val i # временное решение с input type=number + $(@).find("input.redditor__position").val i REDDE.redditor.sortList = -> sortArray = $.map REDDE.redditor.$el.find("dd"), (n) -> key = $(n).attr("class") input = $(n).find("input[type=hidden][name='#{$(n).find("div.form-name").data("object-name")}[id]']") @@ -87,17 +90,17 @@ return stop: -> $(@).removeClass("now-sortable") return - .on "ajax:beforeSend", "a.update-data", (event, xhr, status) -> + .on "ajax:beforeSend", "a.redditor__update", (event, xhr, status) -> box = $(@).closest "dd" params = REDDE.redditor.parameterizationForm(box) status.url += "?" + $.param(params) $("ul.slider-block-images").sortable REDDE.redditor.sliderBlockImagesSortableParams - $('div.redditor-add-blocks').on "ajax:beforeSend", "a.new-block", (event, xhr, status) -> + $('div.redditor__add-blocks').on "ajax:beforeSend", "a.redditor__add", (event, xhr, status) -> status.url += "?" + $.param(content_block: {temp_id: new Date().getTime()}) # generate uniq id #! jquery-serializeForm - Make an object out of form elements - v1.1.1 - 2013-01-21 #* https://github.com/danheberden/jquery-serializeForm #* Copyright (c) 2013 Dan Heberden; Licensed MIT \ No newline at end of file