not really known
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.8 KiB

  1. define(["worldpalettetemplate",
  2. "text!worldpalette.html"], function (palette, template) {
  3. 'use strict';
  4. var activitypalette = {};
  5. activitypalette.ActivityPalette = function (activityButton,
  6. datastoreObject) {
  7. palette.Palette.call(this, activityButton);
  8. var activityTitle;
  9. var descriptionLabel;
  10. var descriptionBox;
  11. this.getPalette().id = "activity-palette";
  12. var containerElem = document.createElement('div');
  13. containerElem.innerHTML = template;
  14. this.setContent([containerElem]);
  15. this.countryobjects = document.getElementsByClassName("country");
  16. var that = this;
  17. for (var i=0; i<this.countryobjects.length; i++){
  18. this.countryobjects[i].addEventListener('click', function(){
  19. var countryobj = document.getElementsByClassName("country");
  20. for (var j=0; j<countryobj.length; j++){
  21. countryobj[j].style.backgroundColor = "black";
  22. }
  23. this.style.backgroundColor = "grey";
  24. document.getElementById('worldConst').innerHTML = [(this.id).split(',')[0],(this.id).split(',')[1]];
  25. that.popDown();
  26. });
  27. var currentcountry = document.getElementById(document.getElementById('worldConst').innerHTML);
  28. if (currentcountry == null) currentcountry = document.getElementById("55.3781,-3.4360");
  29. //currentcountry.style.backgroundColor = "grey";
  30. }
  31. };
  32. activitypalette.ActivityPalette.prototype =
  33. Object.create(palette.Palette.prototype, {
  34. setTitleDescription: {
  35. value: "World Select:",
  36. enumerable: true,
  37. configurable: true,
  38. writable: true
  39. }
  40. });
  41. return activitypalette;
  42. });