apps/system/js/task_manager.js
/**
   * Perform a user-initiated action on the given card.
   */
Perform a user-initiated action on the given card.
Perform a user - initiated action on the given card .
cardAction(card, actionName) {
    switch (actionName) {
      case 'close':
        var index = this.stack.indexOf(card.app);
        var maxIdx = this.stack.length - 1;
        if (maxIdx > 0 && this.mirrorIndexIfRTL(index) === maxIdx) {
          var panToIdx = this.mirrorIndexIfRTL(maxIdx - 1);
          this.panToApp(this.stack[panToIdx]).then(() => {
            card.app.kill();
          });
        } else {
          card.app.kill();
        }
        break;
      case 'favorite' :
        console.log('cardAction: TODO: favorite ' +
                    card.element.dataset.origin);
        break;
      case 'select':
        this.panToApp(card.app).then(() => {
          this.hide(card.app);
        });
        break;
    }
  }
cardAction ( card , actionName ) { switch ( actionName ) { case 'close' : var index = this . stack . indexOf ( card . app ) ; var maxIdx = this . stack . length - 1 ; if ( maxIdx > 0 && this . mirrorIndexIfRTL ( index ) === maxIdx ) { var panToIdx = this . mirrorIndexIfRTL ( maxIdx - 1 ) ; this . panToApp ( this . stack [ panToIdx ] ) . then ( ( ) => { card . app . kill ( ) ; } ) ; } else { card . app . kill ( ) ; } break ; case 'favorite' : console . log ( 'cardAction: TODO: favorite ' + card . element . dataset . origin ) ; break ; case 'select' : this . panToApp ( card . app ) . then ( ( ) => { this . hide ( card . app ) ; } ) ; break ; } }
Perform a user-initiated action on the given card.
Perform a user - initiated action on the given card .
// If this is the right-most card on the stack, we must scroll to the // left before killing the app otherwise we can stay where we are. // Select its left neighbour