public function branchPopup($js = 'nojs') {
    if ($js == 'ajax') {
      $response = new AjaxResponse();
      $form['#attached']['library'][] = 'core/drupal.dialog.ajax';
      $response->setAttachments($form['#attached']);
      $modal = new OpenModalDialogCommand(t('Select location'), $this->buildPopupContent(FALSE), $this->popupOptions());
      $response->addCommand($modal);
      return $response;
    }
    else {
      return $this->redirect('user.page');
    }
  }
public function branchPopup($js = 'nojs') {
    if ($js == 'ajax') {
      $response = new AjaxResponse();
      $form['#attached']['library'][] = 'core/drupal.dialog.ajax';
      $response->setAttachments($form['#attached']);
      $modal = new OpenModalDialogCommand(t('Select location'), $this->buildPopupContent(FALSE), $this->popupOptions());
      $response->addCommand($modal);
      return $response;
    }
    else {
      return $this->redirect('user.page');
    }
  }
public function branchPopup ( $ js = 'nojs' ) { if ( $ js == 'ajax' ) { $ response = new AjaxResponse ( ) ; $ form [ '#attached' ] [ 'library' ] [ ] = 'core/drupal.dialog.ajax' ; $ response -> setAttachments ( $ form [ '#attached' ] ) ; $ modal = new OpenModalDialogCommand ( t ( 'Select location' ) , $ this -> buildPopupContent ( FALSE ) , $ this -> popupOptions ( ) ) ; $ response -> addCommand ( $ modal ) ; return $ response ; } else { return $ this -> redirect ( 'user.page' ) ; } }
Branch Popup.

@param string $js
Nojs|ajax.

@return AjaxResponse
Response.
Branch Popup .