Ejemplo n.º 1
0
      function _createBody() {
        this.passScrollView = new Scrollview();

        this.windowWidth = window.innerWidth;
        this.windowHeight = window.innerHeight;

        this.passScrollViewMod = new StateModifier({
          transform: Transform.translate(0,0,1)
        });

        var backModifier = new StateModifier({
          transform: Transform.behind
        });

        this.surfaces = [];

        this.passScrollView.sequenceFrom(this.surfaces);

        //push pass objects into an array
        FirebaseRef.chatRef.child('passes').child(FirebaseRef.user.id).limit(100).on('child_added', function(snapshot) {this.addPassesItem(snapshot.val())}.bind(this));

        //loop that calls each panel of passScrollView

        this.layout.content.add(this.passScrollViewMod).add(this.passScrollView);

      }
Ejemplo n.º 2
0
 this.buttonSurface.on('click', function(e) {
     if(e.detail != null) return false;  
     console.log('use pass clicked');
     // console.log(this.options.passId);
     this.buttonSurface.setContent("<div>Pass Activated</div>");
     this.buttonSurface.setProperties({ 'backgroundColor': 'green' });
     this.buttonSurface.setProperties({ 'color': 'black' });
     FirebaseRef.chatRef.child('passes').child(FirebaseRef.user.id).child(this.options.passId).update({activated: true});
 }.bind(this));
Ejemplo n.º 3
0
    function MyPass(options, data) {
        View.apply(this, arguments);
        _createLayout.call(this);
        _createHeader.call(this);
        _createBody.call(this);
        

        // this will change button to red if pass has been activated
        var pass = FirebaseRef.chatRef.child('passes').child(FirebaseRef.user.id).child(this.options.passId);
        var self = this;
        pass.on('child_changed', function(snapshot){
            // debugger;
            if (snapshot.name() === "activated" && snapshot.val() === true)
              self.activate();
          });
        if (this.options.activated) {
          this.activate();
        };
    }