-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gustavo Gondim
committed
Oct 25, 2014
1 parent
d46a650
commit 2dd7c53
Showing
4 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
}); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.