From: Seth Woodworth Date: Fri, 1 Feb 2013 17:36:04 +0000 (-0500) Subject: modify add course lightbox styling and autocomplete js X-Git-Tag: release-20150131~531^2~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d2900be1020414278d30ba03b649527a755f3be7;p=oweals%2Fkarmaworld.git modify add course lightbox styling and autocomplete js --- 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() {