Skip to content

Commit

Permalink
Merge pull request binford2k#366 from marrero984/fix_response_count_d…
Browse files Browse the repository at this point in the history
…isplay

repositioned to left of question in notes display
  • Loading branch information
binford2k committed Dec 15, 2015
2 parents be08502 + f6b1c10 commit 44f490b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 17 deletions.
23 changes: 13 additions & 10 deletions public/css/presenter.css
Original file line number Diff line number Diff line change
Expand Up @@ -341,16 +341,19 @@ div.zoomed {
list-style-type: disc;
}

#notes div.rendered.form span.count {
display: inline;
position: absolute;
top: 3px;
right: 4px;
z-index: 10;
background-color: #ddd;
border: 1px solid #333;
border-radius: 0 0.15em 0 0;
box-shadow: 2px 2px 2px #888;
#notes .element {
display: inline-block;
width: 90%;
}

#notes .count {
display: inline-block;
background-color: #27ae60;
color: #ffffff;
padding: 0 8px;
font-size: 2.5em;
vertical-align: top;
border-radius: .2em;
}

#bottom #notes div.personal {
Expand Down
4 changes: 2 additions & 2 deletions public/css/showoff.css
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ code.executing:hover {
padding-left: 40px;
}
.element label {
margin-right: 0.5em;
margin-left: 0.5em;
}

.element textarea {
Expand Down Expand Up @@ -580,7 +580,7 @@ code.executing:hover {
border-left: 4px solid black;
opacity: 1.0;
}
.rendered .count {
.count {
display: none;
}

Expand Down
10 changes: 5 additions & 5 deletions public/js/showoff.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,12 @@ function renderForm(form) {
var action = form.attr("action");
$.getJSON(action, function( data ) {
//console.log(data);
form.children('div.form.element').each(function() {
form.children('.element').each(function() {
var key = $(this).attr('data-name');

// add a counter label if we haven't already
if( $(this).has('span.count').length == 0 ) {
$(this).prepend('<span class="count"></span>');
if( $(this).next('.count').length === 0 ) {
$(this).after($('<h1>').addClass('count'));
}

$(this).find('ul > li > *').each(function() {
Expand Down Expand Up @@ -557,7 +557,7 @@ function renderForm(form) {
default:
// select doesn't have a type attribute... yay html
// poke inside to get options, then render each as a span and replace the select
parent = $(this).parent();
var parent = $(this).parent();

$(this).children('option').each(function() {
var text = $(this).text();
Expand Down Expand Up @@ -595,7 +595,7 @@ function renderForm(form) {
});

// insert the total into the counter label
$(this).find('span.count').each(function() {
$(this).next('.count').each(function() {
$(this).text(total);
});

Expand Down

0 comments on commit 44f490b

Please sign in to comment.