Skip to content

Commit

Permalink
creates Ajax.Request label doesn't exist.Otherwise Ajax.Updater
Browse files Browse the repository at this point in the history
  • Loading branch information
gravityblast committed May 5, 2008
1 parent f9928c8 commit 94ee8ae
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions javascripts/rating.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,15 @@ var Ratable = Class.create({
},

createAjax: function() {
if(this.options.ajaxUrl && this.label) {
if(this.options.ajaxUrl) {
var rate = this.getCurrentRating();
var url = new Template(this.options.ajaxUrl).evaluate({id: this.id, rate: rate});
var parameters = new Template(this.options.ajaxParameters).evaluate({id: this.id, rate: rate});
new Ajax.Updater(this.label, url, {
method: this.options.ajaxMethod,
parameters: parameters
});
if(this.label) {
new Ajax.Updater(this.label, url, { method: this.options.ajaxMethod, parameters: parameters });
} else {
new Ajax.Request(url, { method: this.options.ajaxMethod, parameters: parameters });
}
}
},

Expand Down Expand Up @@ -167,7 +168,7 @@ var Ratable = Class.create({

});

r Rating = Class.create({
var Rating = Class.create({

initialize: function(class_name) {
this.class_name = class_name;
Expand Down

0 comments on commit 94ee8ae

Please sign in to comment.