1
0
mirror of https://github.com/flarum/core.git synced 2025-08-10 10:24:46 +02:00

Fix JSHint errors

This commit is contained in:
Toby Zerner
2015-01-21 14:29:00 +10:30
parent bc91f61f17
commit df7da9338d
28 changed files with 108 additions and 94 deletions

View File

@@ -19,9 +19,9 @@ export default Ember.Component.extend({
click: function(e) {
e.preventDefault();
var action = this.get('action');
if (typeof action == 'string') {
if (typeof action === 'string') {
this.sendAction('action');
} else if (typeof action == 'function') {
} else if (typeof action === 'function') {
action();
}
}

View File

@@ -1,5 +1,3 @@
import Ember from 'ember';
import DropdownButton from './dropdown-button';
export default DropdownButton.extend({

View File

@@ -7,10 +7,12 @@ export default Ember.Component.extend({
layoutName: 'components/ui/controls/item-list',
listItems: function() {
if (!Ember.isArray(this.get('items'))) return [];
if (!Ember.isArray(this.get('items'))) {
return [];
}
var listItems = [];
this.get('items').forEach(function(item) {
if (item.tagName != 'li') {
if (item.tagName !== 'li') {
item = ComponentItem.extend({component: item});
}
listItems.push(item);

View File

@@ -9,7 +9,7 @@ export default Ember.Component.extend({
didInsertElement: function() {
var self = this;
this.$().find('input').on('keydown', function(e) {
if (e.which == 27) {
if (e.which === 27) {
self.clear();
}
});
@@ -18,7 +18,7 @@ export default Ember.Component.extend({
}).on('click', function(e) {
e.preventDefault();
self.clear();
})
});
},
clear: function() {