Skip to content

Commit

Permalink
Merge pull request #264 from vaadin/lint/js-indentation
Browse files Browse the repository at this point in the history
Enable JS indentation check and fix incorrect indentation
  • Loading branch information
tomivirkki authored Jun 27, 2016
2 parents ca7bef9 + 0ba81b7 commit 74419c7
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
1 change: 0 additions & 1 deletion .jscsrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"preset": "google",
"maximumLineLength": 140,
"disallowMultipleVarDecl": false,
"validateIndentation": false,
"disallowTrailingWhitespace": false,
"jsDoc": {
"checkAnnotations": {
Expand Down
3 changes: 2 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ gulp.task('lint:html', function() {
'test/*.html'
])
.pipe(htmlExtract({
sel: 'script, code-example code'
sel: 'script, code-example code',
strip: true
}))
.pipe(jshint())
.pipe(jshint.reporter())
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"chalk": "^1.1.1",
"es6-shim": "^0.35.0",
"gulp": "latest",
"gulp-html-extract": "0.0.3",
"gulp-html-extract": "^0.1.0",
"gulp-jscs": "^3.0.2",
"gulp-jshint": "^2.0.0",
"gulp-sourcemaps": "^1.6.0",
Expand Down
12 changes: 6 additions & 6 deletions test/selecting-items.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,15 @@
});

it('should clear the selection when closing the overlay and input is cleared', function() {
combobox.value = 'foo';
combobox.value = 'foo';

combobox.$.input.bindValue = '';
combobox.$.input.fire('input');
combobox.$.input.bindValue = '';
combobox.$.input.fire('input');

combobox.close();
combobox.close();

expect(combobox.value).to.be.empty;
expect(combobox.$.overlay.$.selector.selectedItem).to.be.null;
expect(combobox.value).to.be.empty;
expect(combobox.$.overlay.$.selector.selectedItem).to.be.null;
});
});
</script>
Expand Down
26 changes: 13 additions & 13 deletions test/toggling-dropdown.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,25 +134,25 @@
});

it('should not refocus the input field when closed from icon', function() {
tapToggleIcon();
tapToggleIcon();

var focusedInput = Polymer.dom(combobox.root).querySelector('input:focus');
var focusedInput = Polymer.dom(combobox.root).querySelector('input:focus');

expect(focusedInput).to.be.null;
expect(focusedInput).to.be.null;
});
} else if (!safari) { // TODO: Sauce Labs bug doesn't allow Safari in OS X to focus.
it('should focus input on dropdown open', function() {
var focusedInput = Polymer.dom(combobox.root).querySelector('input:focus');
expect(focusedInput).to.equal(combobox.$.input);
});

it('should refocus the input field when closed from icon', function() {
tapToggleIcon();
it('should refocus the input field when closed from icon', function() {
tapToggleIcon();

var focusedInput = Polymer.dom(combobox.root).querySelector('input:focus');
var focusedInput = Polymer.dom(combobox.root).querySelector('input:focus');

expect(focusedInput).to.eql(combobox.$.input);
});
expect(focusedInput).to.eql(combobox.$.input);
});
}
});
});
Expand All @@ -162,12 +162,12 @@
it('should close popup when tapping outside overlay', function() {
combobox.open();

Polymer.Base.fire('tap', {}, {
bubbles: true,
node: document.body
});
Polymer.Base.fire('tap', {}, {
bubbles: true,
node: document.body
});

expect(combobox.opened).to.be.false;
expect(combobox.opened).to.be.false;
});
} else {
it('should close popup when clicking outside overlay', function() {
Expand Down
8 changes: 4 additions & 4 deletions vaadin-dropdown-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,11 @@

_removeOutsideClickListener: function() {
if (this.$.overlay.touchDevice) {
// Not sure if this is a good idea to remove this Gesture globally, but that's how the iron-overlay-behavior does it.
Polymer.Gestures.remove(document, 'tap', null);
document.removeEventListener('tap', this._outsideClickListener.bind(this), true);
// Not sure if this is a good idea to remove this Gesture globally, but that's how the iron-overlay-behavior does it.
Polymer.Gestures.remove(document, 'tap', null);
document.removeEventListener('tap', this._outsideClickListener.bind(this), true);
} else {
document.removeEventListener('click', this._outsideClickListener.bind(this), true);
document.removeEventListener('click', this._outsideClickListener.bind(this), true);
}
}
};
Expand Down

0 comments on commit 74419c7

Please sign in to comment.