diff --git a/javascripts/demo.js b/javascripts/demo.js index 0905c22..38fc6a8 100644 --- a/javascripts/demo.js +++ b/javascripts/demo.js @@ -11,5 +11,12 @@ $(document).ready(function() { revert: "invalid", helper: "clone" }); + + $(".fs").on("sortupdate", function() { + $(this).attr("data-content", $(this).fsortable("capacity")); + }).each(function() { + // Set the initial value of the attribute. + $(this).attr("data-content", $(this).find(".fsortable-empty").length); + }); });