Skip to content

Commit 8e593f5

Browse files
authored
Merge pull request #16 from bmsrox/master
Add pjax support
2 parents 4a8d1f4 + 9b952da commit 8e593f5

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

assets/files/js/sortable-widgets.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,13 @@ function initSortableWidgets() {
44
handle: '.sortable-widget-handler',
55
dataIdAttr: 'data-sortable-id',
66
onEnd: function (e) {
7-
$.post($(this.el).parents('[data-sortable-widget=1]').data('sortable-url'), {
7+
var context = $(this.el).parents('[data-sortable-widget=1]');
8+
$.post(context.data('sortable-url'), {
89
sorting: this.toArray()
10+
}).done(function () {
11+
if (context.data('pjax')) {
12+
$.pjax.reload({container: context.data('pjax-container'), timeout: context.data('pjax-timeout')})
13+
}
914
});
1015
}
1116
});

0 commit comments

Comments
 (0)