Commit e6ee6e95 authored by okhin's avatar okhin 🚴

Adding a shuffle button

parent fb18e1c7
Pipeline #885 passed with stage
in 0 seconds
......@@ -6,8 +6,19 @@
}
.piphone-btn {
position: absolute;
left: -23px;
position: relative;
left: 0;
transform: translateX(-50%);
float: left;
}
.repeat-btn {
position: relative;
top: 0;
left: -56px;
top: 65px;
transform: translateX(-50%);
float: right;
}
.chip.committee {
......
......@@ -64,12 +64,16 @@ $(document).ready(function() {
var contacts = JSON.parse(contacts_json);
list_meps(contacts, wrapper);
var random = Math.floor((Math.random() * $('.collection-item').length));
update_mep($('.collection-item').eq(random));
random_mep();
$('select').material_select();
});
function random_mep() {
var random = Math.floor((Math.random() * $('.collection-item').length));
update_mep($('.collection-item').eq(random));
}
function list_meps(contacts, wrapper) {
contacts = contacts.sort(function(a, b) {
if (a['last_name'] < b['last_name']) {
......
......@@ -14,6 +14,9 @@
<a class="left btn-floating piphone-btn btn-large waves-effect activator green">
<i class="material-icons">phone</i>
</a>
<a class="left btn-floating repeat-btn waves-effect grey" onclick="random_mep()">
<i class="material-icons">shuffle</i>
</a>
<span class="card-title grey-text text-darken-4" id="contact-full_name">
John Doe
</span>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment