@@ -7,7 +7,6 @@ import ComponentLookup from 'ember-views/component_lookup';
7
7
import run from 'ember-metal/run_loop' ;
8
8
import jQuery from 'ember-views/system/jquery' ;
9
9
import TextField from 'ember-views/views/text_field' ;
10
- import Namespace from 'ember-runtime/system/namespace' ;
11
10
import EmberObject from 'ember-runtime/system/object' ;
12
11
import ContainerView from 'ember-views/views/container_view' ;
13
12
import SafeString from 'htmlbars-util/safe-string' ;
@@ -130,27 +129,6 @@ QUnit.test('By default, without a container, EmberView is used', function() {
130
129
ok ( jQuery ( '#qunit-fixture' ) . html ( ) . toUpperCase ( ) . match ( / < S P A N / ) , 'contains view with span' ) ;
131
130
} ) ;
132
131
133
- QUnit . test ( 'View lookup - App.FuView (DEPRECATED)' , function ( ) {
134
- Ember . lookup = {
135
- App : {
136
- FuView : viewClass ( {
137
- elementId : 'fu' ,
138
- template : compile ( 'bro' )
139
- } )
140
- }
141
- } ;
142
-
143
- view = viewClass ( {
144
- template : compile ( '{{view App.FuView}}' )
145
- } ) . create ( ) ;
146
-
147
- expectDeprecation ( function ( ) {
148
- runAppend ( view ) ;
149
- } , / G l o b a l l o o k u p o f A p p f r o m a H a n d l e b a r s t e m p l a t e i s d e p r e c a t e d ./ ) ;
150
-
151
- equal ( jQuery ( '#fu' ) . text ( ) , 'bro' ) ;
152
- } ) ;
153
-
154
132
QUnit . test ( 'View lookup - \'fu\'' , function ( ) {
155
133
var FuView = viewClass ( {
156
134
elementId : 'fu' ,
@@ -848,46 +826,6 @@ QUnit.test('{{view}} should be able to point to a local view', function() {
848
826
equal ( view . $ ( ) . text ( ) , 'common' , 'tries to look up view name locally' ) ;
849
827
} ) ;
850
828
851
- QUnit . test ( '{{view}} should evaluate class bindings set to global paths DEPRECATED' , function ( ) {
852
- var App ;
853
-
854
- run ( function ( ) {
855
- lookup . App = App = Namespace . create ( {
856
- isApp : true ,
857
- isGreat : true ,
858
- directClass : 'app-direct' ,
859
- isEnabled : true
860
- } ) ;
861
- } ) ;
862
-
863
- view = EmberView . create ( {
864
- textField : TextField ,
865
- template : compile ( '{{view view.textField class="unbound" classBinding="App.isGreat:great App.directClass App.isApp App.isEnabled:enabled:disabled"}}' )
866
- } ) ;
867
-
868
- expectDeprecation ( function ( ) {
869
- runAppend ( view ) ;
870
- } ) ;
871
-
872
- ok ( view . $ ( 'input' ) . hasClass ( 'unbound' ) , 'sets unbound classes directly' ) ;
873
- ok ( view . $ ( 'input' ) . hasClass ( 'great' ) , 'evaluates classes bound to global paths' ) ;
874
- ok ( view . $ ( 'input' ) . hasClass ( 'app-direct' ) , 'evaluates classes bound directly to global paths' ) ;
875
- ok ( view . $ ( 'input' ) . hasClass ( 'is-app' ) , 'evaluates classes bound directly to booleans in global paths - dasherizes and sets class when true' ) ;
876
- ok ( view . $ ( 'input' ) . hasClass ( 'enabled' ) , 'evaluates ternary operator in classBindings' ) ;
877
- ok ( ! view . $ ( 'input' ) . hasClass ( 'disabled' ) , 'evaluates ternary operator in classBindings' ) ;
878
-
879
- run ( function ( ) {
880
- App . set ( 'isApp' , false ) ;
881
- App . set ( 'isEnabled' , false ) ;
882
- } ) ;
883
-
884
- ok ( ! view . $ ( 'input' ) . hasClass ( 'is-app' ) , 'evaluates classes bound directly to booleans in global paths - removes class when false' ) ;
885
- ok ( ! view . $ ( 'input' ) . hasClass ( 'enabled' ) , 'evaluates ternary operator in classBindings' ) ;
886
- ok ( view . $ ( 'input' ) . hasClass ( 'disabled' ) , 'evaluates ternary operator in classBindings' ) ;
887
-
888
- runDestroy ( lookup . App ) ;
889
- } ) ;
890
-
891
829
QUnit . test ( '{{view}} should evaluate class bindings set in the current context' , function ( ) {
892
830
view = EmberView . create ( {
893
831
isView : true ,
@@ -917,71 +855,6 @@ QUnit.test('{{view}} should evaluate class bindings set in the current context',
917
855
ok ( view . $ ( 'input' ) . hasClass ( 'disabled' ) , 'evaluates ternary operator in classBindings' ) ;
918
856
} ) ;
919
857
920
- QUnit . test ( '{{view}} should evaluate class bindings set with either classBinding or classNameBindings from globals DEPRECATED' , function ( ) {
921
- var App ;
922
-
923
- run ( function ( ) {
924
- lookup . App = App = Namespace . create ( {
925
- isGreat : true ,
926
- isEnabled : true
927
- } ) ;
928
- } ) ;
929
-
930
- view = EmberView . create ( {
931
- textField : TextField ,
932
- template : compile ( '{{view view.textField class="unbound" classBinding="App.isGreat:great App.isEnabled:enabled:disabled" classNameBindings="App.isGreat:really-great App.isEnabled:really-enabled:really-disabled"}}' )
933
- } ) ;
934
-
935
- expectDeprecation ( function ( ) {
936
- runAppend ( view ) ;
937
- } ) ;
938
-
939
- ok ( view . $ ( 'input' ) . hasClass ( 'unbound' ) , 'sets unbound classes directly' ) ;
940
- ok ( view . $ ( 'input' ) . hasClass ( 'great' ) , 'evaluates classBinding' ) ;
941
- ok ( view . $ ( 'input' ) . hasClass ( 'really-great' ) , 'evaluates classNameBinding' ) ;
942
- ok ( view . $ ( 'input' ) . hasClass ( 'enabled' ) , 'evaluates ternary operator in classBindings' ) ;
943
- ok ( view . $ ( 'input' ) . hasClass ( 'really-enabled' ) , 'evaluates ternary operator in classBindings' ) ;
944
- ok ( ! view . $ ( 'input' ) . hasClass ( 'disabled' ) , 'evaluates ternary operator in classBindings' ) ;
945
- ok ( ! view . $ ( 'input' ) . hasClass ( 'really-disabled' ) , 'evaluates ternary operator in classBindings' ) ;
946
-
947
- run ( function ( ) {
948
- App . set ( 'isEnabled' , false ) ;
949
- } ) ;
950
-
951
- ok ( ! view . $ ( 'input' ) . hasClass ( 'enabled' ) , 'evaluates ternary operator in classBindings' ) ;
952
- ok ( ! view . $ ( 'input' ) . hasClass ( 'really-enabled' ) , 'evaluates ternary operator in classBindings' ) ;
953
- ok ( view . $ ( 'input' ) . hasClass ( 'disabled' ) , 'evaluates ternary operator in classBindings' ) ;
954
- ok ( view . $ ( 'input' ) . hasClass ( 'really-disabled' ) , 'evaluates ternary operator in classBindings' ) ;
955
-
956
- runDestroy ( lookup . App ) ;
957
- } ) ;
958
-
959
- QUnit . test ( '{{view}} should evaluate other attribute bindings set to global paths [DEPRECATED]' , function ( ) {
960
- run ( function ( ) {
961
- lookup . App = Namespace . create ( {
962
- name : 'myApp'
963
- } ) ;
964
- } ) ;
965
-
966
- var template ;
967
- expectDeprecation ( function ( ) {
968
- template = compile ( '{{view view.textField valueBinding="App.name"}}' ) ;
969
- } , / Y o u ' r e u s i n g l e g a c y b i n d i n g s y n t a x : v a l u e B i n d i n g / ) ;
970
-
971
- view = EmberView . create ( {
972
- textField : TextField ,
973
- template
974
- } ) ;
975
-
976
- expectDeprecation ( function ( ) {
977
- runAppend ( view ) ;
978
- } , 'Global lookup of App from a Handlebars template is deprecated.' ) ;
979
-
980
- equal ( view . $ ( 'input' ) . val ( ) , 'myApp' , 'evaluates attributes bound to global paths' ) ;
981
-
982
- runDestroy ( lookup . App ) ;
983
- } ) ;
984
-
985
858
QUnit . test ( '{{view}} should evaluate other attributes bindings set in the current context' , function ( ) {
986
859
view = EmberView . create ( {
987
860
name : 'myView' ,
0 commit comments