Skip to content

Commit

Permalink
#547 Documentation page - minor change to required fields
Browse files Browse the repository at this point in the history
  • Loading branch information
FayCross committed Nov 4, 2016
1 parent fac175e commit 4798029
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Expand Up @@ -30,8 +30,6 @@ p {
margin: 0;
}



#x_mainHolder {
width: 800px;
height: 600px;
Expand Down Expand Up @@ -381,6 +379,10 @@ audio {
color: red;
}

.alertBorder {
border: 1px solid red;
}

fieldset.noStyle {
border: 0;
padding: 0;
Expand Down
Expand Up @@ -414,7 +414,7 @@

$element = $('<div class="question optionGroup"/>').append($input).append(label);
break;
case 'media': // ** should work for audio / video too
case 'media':
if (xml.getAttribute('url').substr(0,10) == "USER-FILES") {
$element = $('<img class="itemImg">')
.attr('src', xml.getAttribute('url'));
Expand All @@ -427,6 +427,9 @@
case 'description':
break;
case 'line':
if (exclude != 'doc') {
docData.pages[page].sections[section].items[item].itemText = '<hr/>';
}
$element = $('<hr />');
break;
case 'selectlist': // radio,checkbox
Expand Down Expand Up @@ -572,6 +575,7 @@
};

this.checkRequired = function (page) {
$(".alertBorder").removeClass('alertBorder');
var ok = true;

for(var i=0; i<required.length; i++) {
Expand All @@ -580,17 +584,18 @@
case 'checkbox':
if (! $('#'+required[i].key).prop('checked')) {
ok = false;
$('#'+required[i].key).closest('.item').addClass('alertBorder');
}
break;
case 'textarea':
case 'textbox':
default:
if ($('#'+required[i].key).val() == '') {
ok = false;
$('#'+required[i].key).closest('.item').addClass('alertBorder');
}
break;
}
if (! ok) break;
}
}

Expand Down

0 comments on commit 4798029

Please sign in to comment.