define(["require","exports"],function(r,t){"use strict";var e=function(){function r(r){this.$supporterHolder=r;var t=this.$supporterHolder.find("> ul");t.length>0&&Sortable.create(t[0],{draggable:"li"}),$(".supporterRowAdder").click(function(r){t.append($(this).data("content")),r.preventDefault()}),t.on("click",".delSupporter",function(r){r.preventDefault(),$(this).parents("li").first().remove()});var e=$("#fullTextHolder");r.find(".fullTextAdd").click(function(){for(var r=e.find("textarea").val().split(";"),n=$(".supporterRowAdder").data("content"),i=function(){for(var r=t.find("> li"),e=0;e<r.length;e++){var i=r.eq(e);if(""==i.find(".supporterName").val()&&""==i.find(".supporterOrga").val())return i}var l=$(n);return t.append(l),l},l=null,a=0;a<r.length;a++)if(""!=r[a]){var p=i();if(null==l&&(l=p),p.find("input.supporterOrga").length>0){var o=r[a].split(",");p.find("input.supporterName").val(o[0].trim()),o.length>1&&p.find("input.supporterOrga").val(o[1].trim())}else p.find("input.supporterName").val(r[a])}e.find("textarea").select().focus(),l.scrollintoview()})}return r}();t.MotionSupporterEdit=e});
//# sourceMappingURL=MotionSupporterEdit.js.map
