1

機能を備えたエンバーコントローラーがあります。この関数では、新しいタブを開きたいと思っています。ここに私のコード:

 App.ActivityController = Em.ObjectController.extend({
   actions: {
    downloadOfflineOrderSpreadsheet: function() { this.downloadOfflineOrderSpreadsheets(); },
    }

   downloadOfflineOrderSpreadsheets: function() {
     //here go to a new tab please??
   }
 }

エンバーとの出会いは初めてなので、まだよくわかりません。

4

1 に答える 1

6

Basically you can't directly control if the new window will open in a new tab or a new window, because it's an option controlled by the settings of the users browser.

But as a rule of thumb opening pages using window.open that was not initiated by a user event will open the page in a new browser window, much like a popup.

That said, you could do it like this:

 App.ActivityController = Em.ObjectController.extend({
   actions: {
     downloadOfflineOrderSpreadsheet: function() {
       this.downloadOfflineOrderSpreadsheets();
     },
     downloadOfflineOrderSpreadsheets: function() {
       //here go to a new tab please??
       window.open('mypage.html');
     }
   }
});

Hope it helps.

于 2013-10-10T09:12:49.583 に答える