Skip to content

Commit

Permalink
Merge pull request #6 from NiGhTTraX/4-demo-show-fs-capacity
Browse files Browse the repository at this point in the history
4 demo show fs capacity
  • Loading branch information
NiGhTTraX committed Jun 30, 2014
2 parents c70d55d + 75ec005 commit 2864805
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions javascripts/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});

8 changes: 8 additions & 0 deletions stylesheets/demo.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@
height: 100px;
}

.fs:after {
content: attr(data-content) " slots left";
position: absolute;
top: 10px;
width: 50px;
height: 50px;
}

.fsortable-empty {
float: left;
height: 20px;
Expand Down

0 comments on commit 2864805

Please sign in to comment.