Code cleanup

This commit is contained in:
Ruud committed 2014-06-11 12:29:31 +02:00
1 parent 79cb716ced
commit 876c602710
33 files changed
+56 -53

No files matched your search

+11 -11
View File
@@ -1,15 +1,15 @@
var Question = new Class( {
initialize : function(question, hint, answers) {
var self = this
var self = this;
self.question = question
self.hint = hint
self.answers = answers
self.question = question;
self.hint = hint;
self.answers = answers;
self.createQuestion();
self.answers.each(function(answer) {
self.createAnswer(answer)
self.createAnswer(answer);
})
},
@@ -29,14 +29,14 @@ var Question = new Class( {
},
createAnswer : function(options) {
var self = this
var self = this;
var answer = new Element('a', Object.merge(options, {
'class' : 'answer button '+(options['class'] || '')+(options['cancel'] ? ' cancel' : '')
})).inject(this.container)
})).inject(this.container);
if (options.cancel) {
answer.addEvent('click', self.close.bind(self))
answer.addEvent('click', self.close.bind(self));
}
else if (options.request) {
answer.addEvent('click', function(e){
@@ -44,7 +44,7 @@ var Question = new Class( {
new Request(Object.merge(options, {
'url': options.href,
'onComplete': function() {
(options.onComplete || function(){})()
(options.onComplete || function(){})();
self.close();
}
})).send();
@@ -59,7 +59,7 @@ var Question = new Class( {
},
toElement : function() {
return this.container
return this.container;
}
})
});