Skip to content

Instantly share code, notes, and snippets.

@rozanovz
Last active April 2, 2016 10:06
Show Gist options
  • Select an option

  • Save rozanovz/acace449b0f9f852c8cf8dff35ffb4c2 to your computer and use it in GitHub Desktop.

Select an option

Save rozanovz/acace449b0f9f852c8cf8dff35ffb4c2 to your computer and use it in GitHub Desktop.
if (ui.item.sortable.dropindex !== undefined) {
let positions = [];
ui.item.sortable.sourceModel.forEach((metric, index) => {
positions.push({cardMetricRelationId: metric.relationId, position: index + 1});
});
this.cardBuilder.loading = true;
return this.card.metrics.updatePositions(positions).then(() => {
this.cardBuilder.refresh();
});
}
updatePositions(positions) {
return this.DataProvider.post('card/updateMetricsPosition/' + this.card.id, {positions: positions}, false);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment