Commit affe6dcf authored by Renán Sosa Guillen's avatar Renán Sosa Guillen

issue

parent 1ec08d39
...@@ -85,43 +85,31 @@ function drawPolygon(element) { ...@@ -85,43 +85,31 @@ function drawPolygon(element) {
$('#ajax-input').focus(function () { $('#ajax-input').focus(function () {
console.log('in'); console.log('in');
if (OPT_LIST_IS_HIDDEN && $(this).val() != '') { if (OPT_LIST_IS_HIDDEN && $(this).val() != '') {
// console.log('makeRequest');
// makeRequest($(this).val());
$('#option-list').show(); $('#option-list').show();
OPT_LIST_IS_HIDDEN = false; OPT_LIST_IS_HIDDEN = false;
} }
}).blur(function () { }).blur(function () {
if (!OPT_LIST_IS_HIDDEN && $(this).val() != '') { if (!OPT_LIST_IS_HIDDEN && $(this).val() != '' && $(event.target).closest('#option-list').length ) {
// $('#option-list').hide(); $('#option-list').hide();
// var pol_element = document.getElementById('polygon-list');
// while (pol_element.firstChild) {
// pol_element.removeChild(pol_element.firstChild);
// }
OPT_LIST_IS_HIDDEN = true; OPT_LIST_IS_HIDDEN = true;
} }
}); });
// $(document).click(function (event) { $(document).click(function (event) {
// if (!OPT_LIST_IS_HIDDEN) { if (!OPT_LIST_IS_HIDDEN) {
// //if click is triggered outside '#option-list' element remove the list //if click is triggered outside '#option-list' element remove the list
// if(!$(event.target).closest('#option-list').length > 0 ) { if(!$(event.target).closest('#option-list').length > 0 ) {
// $('#option-list').hide(); $('#option-list').hide();
//
// var pol_element = document.getElementById('polygon-list'); OPT_LIST_IS_HIDDEN = true;
// while (pol_element.firstChild) { }
// pol_element.removeChild(pol_element.firstChild); }
// } });
//
// OPT_LIST_IS_HIDDEN = true;
// }
// }
// });
$(document).ready(function () { $(document).ready(function () {
// var input = document.getElementById('ajax-input');
// var dataList = document.getElementById('polygon-list');
var pol_element = document.getElementById('polygon-list'); var pol_element = document.getElementById('polygon-list');
$('#ajax-input').on('input', function(e) { $('#ajax-input').on('input', function(e) {
...@@ -139,7 +127,7 @@ $(document).ready(function () { ...@@ -139,7 +127,7 @@ $(document).ready(function () {
return return
} }
console.log(value); console.log(value);
// console.log("TOKEN: ", document.getElementsByName('csrfmiddlewaretoken')[0].value);
makeRequest(value); makeRequest(value);
// $.ajax({ // $.ajax({
// type: "POST", // type: "POST",
......
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