2016-11-04 31 views
1

我使用Plone的4.3和我有一個BrowserView中,我有一個開放的具體形式 的覆蓋在我的HTML鏈接,我有使用prepOverlay時,如何防止打開多個疊加層?

<table> 
    <thead> 
     <tr> 
      <th class='.prep_form'>Sun</th> 
      <th class='.prep_form'>Mon</th> 
      ... 
     </tr> 
    </thead> 
    <tbody> 
     ... 
    </tbody> 
</table> 

在我的jQuery文件

jquery(function($){ 
    ... 
    $('.prep_form').prepOverlay({ 
     subtype: 'ajax', 
     filter: '#content-core > form', 
     noform: 'redirect', 
     redirect: function(){ 
      redirect_location = ""; // put together a string 
      return redirect_location; 
     }, 
    }); 
    ... 
}); 

不幸的是,我可以在窗體覆蓋層打開之前多次單擊鏈接,這會導致多個窗口打開。

如何防止打開多個疊加層?

+1

關閉所有打開的疊加可以測量XHR請求,需要多長時間?聽起來對我來說,加載覆蓋層需要很長時間。 – Mathias

+0

根據螢火蟲,不幸的是我花了半秒鐘左右。我會牢記這一點,以便用戶沒有雙擊的機會。 –

回答

2

Docs jquery工具是覆蓋選項:oneInstance:true 但它應該是默認值。您可以通過this.getOverlay().close()

​​
+0

對於我遲到的回覆,我表示歉意。感謝您的答覆。這確實解決了我的問題。 –

+0

沒問題,謝謝你的回覆。 – 1letter

相關問題