(function(){"use strict";var a=this;a.define(["backbone","communicator","underscore"],function(a,b,c){var d=a.Marionette.CollectionView.extend({tagName:"ul",initialize:function(a){},onShow:function(a){this.listenTo(b.mediator,"productCollection:updateSort",this.updateSort),$(".sortable").sortable({revert:!0,stop:function(a,b){b.item.trigger("drop",b.item.index())}})},updateSort:function(a){this.collection.remove(a.model),this.collection.each(function(b,c){var d=c;c>=a.position&&(d+=1),b.set("ordinal",d)}),a.model.set("ordinal",a.position),this.collection.add(a.model,{at:a.position}),this.render(),b.mediator.trigger("productCollection:sortUpdated")}});return{LayerSelectionView:d}})}).call(this);