From 79a4a29a1b698e7776d0b9e3268a5b4d468e2d2d Mon Sep 17 00:00:00 2001 From: Mitch Lloyd Date: Sun, 17 May 2015 14:11:32 -0400 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20stop=20iteration=20on=20first?= =?UTF-8?q?=20:class?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix for issue #11193 (cherry picked from commit cb43551d516980d61a1587282e57bea9d70f9148) --- .../ember-views/lib/system/build-component-template.js | 2 +- .../tests/views/view/class_name_bindings_test.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/ember-views/lib/system/build-component-template.js b/packages/ember-views/lib/system/build-component-template.js index c66dc0bfcdf..fe8cff9a2a2 100644 --- a/packages/ember-views/lib/system/build-component-template.js +++ b/packages/ember-views/lib/system/build-component-template.js @@ -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 diff --git a/packages/ember-views/tests/views/view/class_name_bindings_test.js b/packages/ember-views/tests/views/view/class_name_bindings_test.js index 2c6e845a54a..c8d27685c83 100644 --- a/packages/ember-views/tests/views/view/class_name_bindings_test.js +++ b/packages/ember-views/tests/views/view/class_name_bindings_test.js @@ -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({