Skip to content

Commit

Permalink
Added files for version 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustavo Gondim committed Oct 25, 2014
1 parent d46a650 commit 2dd7c53
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
59 changes: 59 additions & 0 deletions listrap.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
/*
// Listrap v1.0, by Gustavo Gondim (http://github.com/ggondim)
// Licenced under MIT License
// For updates, improvements and issues, see https://github.com/inosoftbr/listrap
*/
.listrap {
list-style-type: none;
margin: 0;
padding: 0;
cursor: default;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}

.listrap li {
margin: 0;
padding: 10px;
}

.listrap li.active, .listrap li:hover {
background-color: #d9edf7;
}

.listrap strong {
margin-left: 10px;
}

.listrap .listrap-toggle {
display: inline-block;
width: 60px;
height: 60px;
}

.listrap .listrap-toggle span {
background-color: #428bca;
opacity: 0.8;
z-index: 100;
width: 60px;
height: 60px;
display: none;
position: absolute;
border-radius: 50%;
text-align: center;
line-height: 60px;
vertical-align: middle;
color: #ffffff;
}

.listrap .listrap-toggle span:before {
font-family: 'Glyphicons Halflings';
content: "\e013";
}

.listrap li.active .listrap-toggle span {
display: block;
}
24 changes: 24 additions & 0 deletions listrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Listrap v1.0, by Gustavo Gondim (http://github.com/ggondim)
// Licenced under MIT License
// For updates, improvements and issues, see https://github.com/inosoftbr/listrap
jQuery.fn.extend({
listrap: function () {
var listrap = this;
$(this).addClass("listrap");
listrap.getSelection = function () {
var selection = new Array();
listrap.children("li.active").each(function (ix, el) {
selection.push($(el)[0]);
});
return selection;
}
var toggle = "li .listrap-toggle ";
var selectionChanged = function () {
$(this).parent().parent().toggleClass("active");
listrap.trigger("selection-changed", [listrap.getSelection()]);
}
$(listrap).find(toggle + "img").on("click", selectionChanged);
$(listrap).find(toggle + "span").on("click", selectionChanged);
return listrap;
}
});
1 change: 1 addition & 0 deletions listrap.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions listrap.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 2dd7c53

Please sign in to comment.