Merge branch 'master' of git.elab.kth.se:davide/ELAB-partsearch

# Conflicts:
#	parts/static/script.js
This commit is contained in:
2018-11-13 17:23:15 +01:00
4 changed files with 51 additions and 3 deletions
+15
View File
@@ -5,6 +5,7 @@ function init_edit(partID) {
$('table#details tr#partno td p').hide();
$('input[name=partno-input]').show();
$('#magical_autofill').show();
$('table#details tr#description td p').hide();
$('input[name=description-input]').show();
@@ -46,6 +47,8 @@ function end_edit() {
$('table#details tr#partno td p').show();
$('table#details tr#partno td input').hide();
$('#magical_autofill').hide();
$('table#details tr#description td p').text($('table#details tr#description td input').val());
$('table#details tr#description td p').show();
$('table#details tr#description td input').hide();
@@ -229,6 +232,18 @@ function container_onchange() {
}
}
function octopartFetch(){
$.getJSON(rootURL + 'fetchOctopartSnippet/' + $('#partno-input').val()).done(function(json){
if (json['result']=='ok'){
$('#description-input').val(json['snippet']);
}else{
$('#description-input').val('');
$('#description-input').attr('placeholder', json['result']);
}
});
}
$(document).ready(function() {
$.ajaxSetup({ cache: false });
$('.search-bar').on('keyup', function() {