JSHint: Add strict comparisons to poll_ui.js
This commit is contained in:
parent
c47b9a1b84
commit
9f51ab347a
|
@ -6,7 +6,6 @@ lib/javascripts/locale/
|
||||||
lib/javascripts/messageformat.js
|
lib/javascripts/messageformat.js
|
||||||
lib/javascripts/moment.js
|
lib/javascripts/moment.js
|
||||||
lib/javascripts/moment_locale/
|
lib/javascripts/moment_locale/
|
||||||
plugins/poll/assets/javascripts/poll_ui.js
|
|
||||||
public/javascripts/
|
public/javascripts/
|
||||||
spec/phantom_js/smoke_test.js
|
spec/phantom_js/smoke_test.js
|
||||||
test/javascripts/helpers/assertions.js
|
test/javascripts/helpers/assertions.js
|
||||||
|
|
|
@ -14,7 +14,7 @@ var Poll = Discourse.Model.extend({
|
||||||
options.push(Ember.Object.create({
|
options.push(Ember.Object.create({
|
||||||
option: option,
|
option: option,
|
||||||
votes: json["options"][option],
|
votes: json["options"][option],
|
||||||
checked: (option == selectedOption)
|
checked: (option === selectedOption)
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
this.set('options', options);
|
this.set('options', options);
|
||||||
|
@ -22,7 +22,7 @@ var Poll = Discourse.Model.extend({
|
||||||
|
|
||||||
saveVote: function(option) {
|
saveVote: function(option) {
|
||||||
this.get('options').forEach(function(opt) {
|
this.get('options').forEach(function(opt) {
|
||||||
opt.set('checked', opt.get('option') == option);
|
opt.set('checked', opt.get('option') === option);
|
||||||
});
|
});
|
||||||
|
|
||||||
return Discourse.ajax("/poll", {
|
return Discourse.ajax("/poll", {
|
||||||
|
@ -99,7 +99,7 @@ Discourse.PostView.reopen({
|
||||||
var view = initializePollView(this);
|
var view = initializePollView(this);
|
||||||
|
|
||||||
var pollContainer = $post.find(".poll-ui:first");
|
var pollContainer = $post.find(".poll-ui:first");
|
||||||
if (pollContainer.length == 0) {
|
if (pollContainer.length === 0) {
|
||||||
pollContainer = $post.find("ul:first");
|
pollContainer = $post.find("ul:first");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue