From d2900be1020414278d30ba03b649527a755f3be7 Mon Sep 17 00:00:00 2001 From: Seth Woodworth Date: Fri, 1 Feb 2013 12:36:04 -0500 Subject: [PATCH] modify add course lightbox styling and autocomplete js --- karmaworld/assets/css/lightbox.css | 14 +++++++ karmaworld/templates/lightbox/add_course.html | 38 +++++++++---------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/karmaworld/assets/css/lightbox.css b/karmaworld/assets/css/lightbox.css index 425e3c8..4387470 100644 --- a/karmaworld/assets/css/lightbox.css +++ b/karmaworld/assets/css/lightbox.css @@ -193,3 +193,17 @@ div#file-uploader-label h2 { display: none; } + +button.lightbox-button { + background:none!important; + border:none; + color: #FFF; + cursor: pointer; + padding:0!important; + font-family: "MuseoSlab-700"; + font-size: 16px; +} + +button.lightbox-button:hover { + text-decoration: underline; +} diff --git a/karmaworld/templates/lightbox/add_course.html b/karmaworld/templates/lightbox/add_course.html index 8a5a712..6181938 100644 --- a/karmaworld/templates/lightbox/add_course.html +++ b/karmaworld/templates/lightbox/add_course.html @@ -17,7 +17,7 @@ $(function() { setupAjax(); - $("#school").autocomplete({ + $("#str_school").autocomplete({ source: function(request, response){ $.ajax({ url: "{% url 'json_school_list' %}", @@ -28,7 +28,8 @@ $(function() { response($.map(data['schools'], function(item) { return { value: item.name, - real_value: item.id + real_value: item.id, + label: item.name, }; })); } else { @@ -41,10 +42,15 @@ $(function() { }); }, select: function(event, ui) { + console.log("select func"); + console.log("id"); + console.log(ui.item.value); + console.log("name"); + console.log(ui.item.label); // set the school id as the value of the hidden field - $('#id_school').val(ui.item.real_value); - // set the School name as the textbox ield - $('#school').val(ui.item.value); + $('#id_school').val(ui.item.real_value); + // set the School name as the textbox field + //$('#str_school').val(ui.item.label); }, minLength: 3 }); @@ -53,7 +59,8 @@ $(function() {