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