Code cleanup

This commit is contained in:
Ruud
2014-06-11 12:29:31 +02:00
parent 79cb716ced
commit 876c602710
33 changed files with 56 additions and 53 deletions
+2 -2
View File
@@ -7,9 +7,9 @@ var ApiClass = new Class({
},
request: function(type, options){
var self = this;
var self = this,
r_type = self.options.is_remote ? 'JSONP' : 'JSON';
var r_type = self.options.is_remote ? 'JSONP' : 'JSON';
return new Request[r_type](Object.merge({
'callbackKey': 'callback_func',
'method': 'get',
+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;
}
})
});
+2 -2
View File
@@ -27,8 +27,8 @@ Page.Settings = new Class({
},
openTab: function(action){
var self = this;
var action = (action == 'index' ? 'about' : action) || self.action;
var self = this,
action = (action == 'index' ? 'about' : action) || self.action;
if(self.current)
self.toggleTab(self.current, true);