Uploaded image for project: 'Alloy'
  1. Alloy
  2. ALOY-1036

CustomTSS: Comma-separated queries are using wrong operator AND instead of OR

    Details

    • Sprint:
      2014 Sprint 12 Alloy

      Description

      Problem description

      CustomTSS comma-separated queries are not correctly applied since the boolean operator used in this case is an AND instead of an OR.

      Steps to reproduce
      Sample code

      // index.xml

      <Alloy>
      	<Window>
      		<Label class="classLabel" id="testLabel"/>
      	</Window>
      </Alloy>
      

      // app.tss

      "Label":{
      	font:{
      		fontSize:'22dp'
      	},
      	color:'purple'
      }
       
      ".classLabel":{
      	text:"Simple class label applied"
      }
       
      ".classLabel[platform=ios,android formFactor=tablet,handheld if=Alloy.Globals.custom1,Alloy.Globals.custom2]":{
      	text:"iOS or Android! Styles conditionals correctly applied"
      }
      

      // alloy.js

      Alloy.Globals.custom1 = true;
      Alloy.Globals.custom2 = false;
      

      Steps

      1. Run the sample code either on iOS or Android
      Result: Label text is "Simple class label applied"
      Expected result: Label text should be "iOS or Android! Styles conditionals correctly applied"
      Style conditional is not satisfied as custom2 is false and "if=Alloy.Globals.custom1,Alloy.Globals.custom2" returns false (should be true).

      2. Change "Alloy.Globals.custom2" from false to true. Run on either iOS or Android.
      Result: Label text is "iOS or Android! Styles conditionals correctly applied", since both are true and the AND operator returns true.

        Attachments

          Activity

            People

            • Assignee:
              skypanther Tim Poulsen
              Reporter:
              fcasali Federico Casali
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Integration