Skip to content

Commit

Permalink
Don’t stop iteration on first :class
Browse files Browse the repository at this point in the history
Fix for issue #11193
  • Loading branch information
mitchlloyd committed May 17, 2015
1 parent 28d4c06 commit cda8675
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ function normalizeClasses(classes, output) {
// Legacy :class microsyntax for static class names
if (propName === '') {
output.push(activeClass);
return;
continue;
}

// 2.0TODO: Remove deprecated global path
Expand Down
10 changes: 10 additions & 0 deletions packages/ember-views/tests/views/view/class_name_bindings_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,16 @@ QUnit.test(":: class name syntax works with an empty true class", function() {
equal(view.$().attr('class'), 'ember-view', "no class is added when property is true and the class is empty");
});

QUnit.test("uses all provided static class names (issue #11193)", function() {
view = EmberView.create({
classNameBindings: [':class-one', ':class-two']
});

run(function() { view.createElement(); });

equal(view.$().attr('class'), 'ember-view class-one class-two', "both classes are added");
})

QUnit.test("classNames should not be duplicated on rerender", function() {
run(function() {
view = EmberView.create({
Expand Down

0 comments on commit cda8675

Please sign in to comment.