@ -266,20 +266,20 @@ function container_onchange() {
}
}
function octopartFetch ( ) {
$ ( '#magic-autofill-button' ) . attr ( 'disabled' , 'disabled' ) ;
$ . getJSON ( rootURL + 'fetchOctopartSnippet/' + $ ( '#partno-input' ) . val ( ) ) . done ( function ( json ) {
$ ( '#magic-autofill-button' ) . removeAttr ( 'disabled' ) ;
if ( json [ 'result' ] == 'ok' ) {
$ ( '#description-input' ) . val ( json [ 'snippet' ] ) ;
} else {
$ ( '#description-input' ) . val ( '' ) ;
$ ( '#description-input' ) . attr ( 'placeholder' , json [ 'result' ] ) ;
}
} ) . fail ( function ( ) {
$ ( '#magic-autofill-button' ) . removeAttr ( 'disabled' ) ;
} ) ;
}
// function octopartFetch(){
// $('#magic-autofill-button').attr('disabled', 'disabled');
// $.getJSON(rootURL + 'fetchOctopartSnippet/' + $('#partno-input').val()).done(function(json){
// $('#magic-autofill-button').removeAttr('disabled');
// if (json['result']=='ok'){
// $('#description-input').val(json['snippet']);
// }else{
// $('#description-input').val('');
// $('#description-input').attr('placeholder', json['result']);
// }
// }).fail(function() {
// $('#magic-autofill-button').removeAttr('disabled');
// });
// }
$ ( document ) . ready ( function ( ) {
$ . ajaxSetup ( { cache : false } ) ;