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.7 KiB

define(["widepalette",
"text!languagepalette.html"], function (palette, template) {
'use strict';
var activitypalette = {};
activitypalette.ActivityPalette = function (activityButton,
datastoreObject) {
palette.Palette.call(this, activityButton);
var activityTitle;
var descriptionLabel;
var descriptionBox;
this.getPalette().id = "activity-palette";
var containerElem = document.createElement('div');
containerElem.innerHTML = template;
this.setContent([containerElem]);
this.langobjects = document.getElementsByClassName("lang");
var that = this;
for (var i=0; i<this.langobjects.length; i++){
this.langobjects[i].addEventListener('click', function(){
var langobj = document.getElementsByClassName("lang");
for (var j=0; j<langobj.length; j++){
langobj[j].style.backgroundColor = "black";
}
this.style.backgroundColor = "grey";
document.getElementById('speaklang').innerHTML = (this.id).split('-')[1];
that.popDown();
});
var currentlang = document.getElementById("lang-"+document.getElementById('speaklang').innerHTML);
if (currentlang == null) currentlang = document.getElementById("lang-en");
currentlang.style.backgroundColor = "grey";
}
};
activitypalette.ActivityPalette.prototype =
Object.create(palette.Palette.prototype, {
setTitleDescription: {
value: "Language Select:",
enumerable: true,
configurable: true,
writable: true
}
});
return activitypalette;
});