fixed more indentation in find.js

This commit is contained in:
Devin Howard 2013-02-21 20:52:46 -05:00
parent e670861f3e
commit 28170035b0

View file

@ -182,8 +182,6 @@ function clearFoundData() {
Mconsole.plot();
}
/**
* Define all the dynamic interactions for the FIND/FILTER using Jquery
*/
@ -200,8 +198,6 @@ $(document).ready(function() {
});
// this is where interactions within the find box begin
//
//on keyup, start the countdown
$('#topic_by_name_input').typing({
start: function (event, $elem) {
@ -235,17 +231,17 @@ $(document).ready(function() {
var topicName = $('#topic_by_name_input').val();
// run a search on the canvas or in the commons or both
if (firstVal == "checked" && secondVal == "checked"){
if (firstVal == "checked" && secondVal == "checked") {
setTimeout(function(){onCanvasSearch(topicName,null,null);},0);
$('#topicsByName').val(topicName);
$('#topicsByUser').val("");
$('#topicsByMap').val("");
$('#get_topics_form').submit();
}
else if (firstVal == "checked"){
else if (firstVal == "checked") {
setTimeout(function(){onCanvasSearch(topicName,null,null);},0);
}
else if (secondVal == "checked"){
else if (secondVal == "checked") {
$('#topicsByName').val(topicName);
$('#topicsByUser').val("");
$('#topicsByMap').val("");
@ -255,7 +251,9 @@ $(document).ready(function() {
//do nothing
}
if (topicName == "") { clearFoundData(); }
if (topicName == "") {
clearFoundData();
}
},
delay: 2000
});
@ -264,14 +262,13 @@ $(document).ready(function() {
firstVal = $(this).children("option[value='topics']").attr('selected');
secondVal = $(this).children("option[value='maps']").attr('selected');
thirdVal = $(this).children("option[value='mappers']").attr('selected');
if ( firstVal == 'selected') {
if (firstVal == 'selected') {
$('#sideOptionFind .select_type').children("option[value='metacode']").removeAttr('disabled');
$('#sideOptionFind .select_type').children("option[value='map (by name)']").removeAttr('disabled');
$('#sideOptionFind .select_type').children("option[value='mapper (by name)']").removeAttr('disabled');
$('.find').css('display','none');
$('.find_topic_by_name').css('display','block');
$('#topic_by_name_input').focus();
}
else if ( secondVal == 'selected' ) {
if ( $("#sideOptionFind .select_type").val() != "name") {
@ -306,7 +303,7 @@ $(document).ready(function() {
secondVal = $(this).children("option[value='metacode']").attr('selected');
thirdVal = $(this).children("option[value='map (by name)']").attr('selected');
fourthVal = $(this).children("option[value='mapper (by name)']").attr('selected');
if ( firstVal === 'selected') {
if (firstVal === 'selected') {
$('.find').fadeOut('fast', function() {
showAll();
$('.find_topic_by_metacode ul li').not('#hideAll, #showAll').removeClass('toggledOff');
@ -356,7 +353,7 @@ $(document).ready(function() {
}
});
$('.find_topic_by_name #topic_by_name_input').bind('railsAutocomplete.select', function(event, data){
$('.find_topic_by_name #topic_by_name_input').bind('railsAutocomplete.select', function(event, data) {
/* Do something here */
if (data.item.id != undefined) {
window.open("/topics/" + data.item.id)
@ -364,29 +361,28 @@ $(document).ready(function() {
$('.find_topic_by_name #topic_by_name_input').val('');
});
$('.find_topic_by_name').bind('submit', function(event, data){
$('.find_topic_by_name').bind('submit', function(event, data) {
event.preventDefault();
});
$('.find_map_by_name #map_by_name_input').bind('railsAutocomplete.select', function(event, data){
$('.find_map_by_name #map_by_name_input').bind('railsAutocomplete.select', function(event, data) {
firstVal = $('#sideOptionFind .select_content').children("option[value='topics']").attr('selected');
secondVal = $('#sideOptionFind .select_content').children("option[value='maps']").attr('selected');
thirdVal = $('#sideOptionFind .select_content').children("option[value='mappers']").attr('selected');
if ( firstVal == 'selected') {
if (firstVal == 'selected') {
// grab the checkboxes to see if the search is on the canvas, in the commons, or both
firstNewVal = $("#onCanvas").attr('checked');
secondNewVal = $("#inCommons").attr('checked');
// only have the autocomplete enabled if they are searching in the commons
if (firstNewVal == "checked" && secondNewVal == "checked"){
if (firstNewVal == "checked" && secondNewVal == "checked") {
setTimeout(function(){onCanvasSearch(null,data.item.id,null);},0);
$('#topicsByMap').val(data.item.id);
$('#topicsByUser').val("");
$('#topicsByName').val("");
$('#get_topics_form').submit();
}
else if (firstNewVal == "checked"){
else if (firstNewVal == "checked") {
setTimeout(function(){onCanvasSearch(null,data.item.id,null);},0);
}
else if (secondNewVal == "checked"){
@ -407,7 +403,7 @@ $(document).ready(function() {
$('.find_map_by_name #map_by_name_input').val('');
}
else if ( thirdVal == 'selected' ) {
//nothing
}
});
@ -425,7 +421,6 @@ $(document).ready(function() {
secondNewVal = $("#inCommons").attr('checked');
// only have the autocomplete enabled if they are searching in the commons
if (firstNewVal == "checked" && secondNewVal == "checked"){
setTimeout(function(){onCanvasSearch(null,null,data.item.id.toString());},0);
$('#topicsByUser').val(data.item.id);
@ -448,7 +443,7 @@ $(document).ready(function() {
}
}
else if ( secondVal == 'selected' ) {
//nothing
}
else if ( thirdVal == 'selected' ) {
if (data.item.id != undefined) {
@ -467,7 +462,6 @@ $(document).ready(function() {
obj = document.getElementById('container');
var switchAll = $(this).attr('id');
if ( switchAll === "showAll" || switchAll === "hideAll") {
if (switchAll == "showAll") {
showAll();