Advertisement
Guest User

Untitled

a guest
Nov 20th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. //callback to build the profileChooser
  2. function inventoryProfilesByClass(cbd){
  3. $('#simProfile_profile').empty();
  4. for(var i in cbd){
  5. profileArray.push(cbd[i]);
  6. $("<option>", {
  7. value : cbd[i].id,
  8. html : cbd[i].description,
  9. }).appendTo("#simProfile_profile");
  10. }
  11. $("<option>", {
  12. value : 0,
  13. html : "---"
  14. }).prependTo("#simProfile_profile");
  15. $("<option>", {
  16. value : "0xDEAD",
  17. html : "Neu",
  18. selected : true
  19. }).appendTo("#simProfile_profile");
  20. $('#simProfile_profile').trigger("chosen:updated");
  21. $('#simProfile_profile').attr('disabled',false).trigger("chosen:updated");
  22. }
  23.  
  24. //on change check if new profile
  25. //on change change the inventory
  26. $('#simProfile_profile').on('change',function(){
  27. if($('#simProfile_profile').val() === '0xDEAD'){
  28. //NEW PROFILE
  29. } else{
  30. //LOAD PROFILE IN CHARDESIGNER
  31. }
  32. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement