mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 07:38:45 -05:00
Start checking eslint in plugins.
This commit is contained in:
parent
8d46727d67
commit
ae5a033469
6 changed files with 5 additions and 15 deletions
|
@ -45,6 +45,7 @@ before_install:
|
|||
- eslint app/assets/javascripts
|
||||
- eslint --ext .es6 app/assets/javascripts
|
||||
- eslint --ext .es6 test/javascripts
|
||||
- eslint --ext .es6 plugins/**/assets/javascripts
|
||||
- eslint test/javascripts
|
||||
|
||||
before_script:
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
import User from 'discourse/models/user';
|
||||
import PollVoters from 'discourse/plugins/poll/components/poll-voters';
|
||||
|
||||
export default PollVoters.extend({
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import computed from 'ember-addons/ember-computed-decorators';
|
||||
import User from 'discourse/models/user';
|
||||
import PollVoters from 'discourse/plugins/poll/components/poll-voters';
|
||||
|
||||
export default PollVoters.extend({
|
||||
|
|
|
@ -70,7 +70,6 @@ export default Ember.Controller.extend({
|
|||
@computed("isMultiple", "isNumber", "pollOptionsCount", "pollMin", "pollStep")
|
||||
pollMaxOptions(isMultiple, isNumber, count, pollMin, pollStep) {
|
||||
if (!isMultiple && !isNumber) return;
|
||||
var range = [];
|
||||
const pollMinInt = parseInt(pollMin);
|
||||
|
||||
if (isMultiple) {
|
||||
|
@ -84,7 +83,6 @@ export default Ember.Controller.extend({
|
|||
@computed("isNumber", "pollMax")
|
||||
pollStepOptions(isNumber, pollMax) {
|
||||
if (!isNumber) return;
|
||||
|
||||
return this._comboboxOptions(1, parseInt(pollMax) + 1);
|
||||
},
|
||||
|
||||
|
@ -99,7 +97,7 @@ export default Ember.Controller.extend({
|
|||
if (pollMax) pollHeader += ` max=${pollMax}`;
|
||||
if (isNumber) pollHeader += ` step=${pollStep}`;
|
||||
if (publicPoll) pollHeader += ' public=true';
|
||||
pollHeader += ']'
|
||||
pollHeader += ']';
|
||||
output += `${pollHeader}\n`;
|
||||
|
||||
if (pollOptions.length > 0 && !isNumber) {
|
||||
|
@ -112,11 +110,7 @@ export default Ember.Controller.extend({
|
|||
|
||||
@computed("pollOptionsCount", "isNumber")
|
||||
disableInsert(count, isNumber) {
|
||||
if (isNumber) {
|
||||
return false;
|
||||
} else {
|
||||
return count < 2;
|
||||
}
|
||||
return isNumber ? false : (count < 2);
|
||||
},
|
||||
|
||||
@computed("disableInsert")
|
||||
|
@ -132,8 +126,8 @@ export default Ember.Controller.extend({
|
|||
|
||||
_comboboxOptions(start_index, end_index) {
|
||||
return _.range(start_index, end_index).map(number => {
|
||||
return { value: number, name: number }
|
||||
})
|
||||
return { value: number, name: number };
|
||||
});
|
||||
},
|
||||
|
||||
_setupPoll() {
|
||||
|
|
|
@ -147,7 +147,6 @@ export default Ember.Controller.extend({
|
|||
}).then(results => {
|
||||
const poll = results.poll;
|
||||
const votes = results.vote;
|
||||
const currentUser = this.currentUser;
|
||||
|
||||
this.setProperties({ vote: votes, showResults: true });
|
||||
this.set("model", Em.Object.create(poll));
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
import { on } from "ember-addons/ember-computed-decorators";
|
||||
|
||||
export default Em.View.extend({
|
||||
templateName: "poll",
|
||||
classNames: ["poll"],
|
||||
|
|
Loading…
Reference in a new issue