2015-06-27 86 views
0

我想在流星應用中使用blueimp image gallery。我的圖片庫在開發中,但是當我像這樣運行時:流星應用在生產中不起作用

meteor --production 

它不起作用。它顯示了鐵路由器的啓動畫面。同樣,如果我部署我的應用程序meteor.com它不工作:

meteor deploy blueimpMeteor 

see the site

但是如果我在調試模式下部署我的應用程序,它的工作:

meteor deploy blueimpMeteorDebug --debug 

see the debug site

什麼可能導致我的流星應用程序不能在生產模式下工作?

來源:https://github.com/icedTeaFresh/meteorBlueimpBroken

回答

3

感謝提供源。我嘗試了一些東西,發現這是最簡單的:

  1. 你不應該同時包括jQuery和與微細化以及非精縮版沿插件的非jQuery的版本。我刪除了client/compatibility/js下的所有腳本,但jquery.blueimp-gallery.min.js除外。

  2. home.html中刪除<script>標記。在流星中,您通常想要從onRendered回調中初始化插件,但在這種情況下,這兩者都不是必需的。

  3. 如圖here你只需要到data-gallery屬性添加到您的鏈接,像這樣:

<div id = "links"> 
    <a href="/1.JPG" title="1" data-gallery> 
    <img src="/1.JPG" class="img-thumbnail" alt="1" width="100" height="100"> 
    </a> 
    <a href="/1.JPG" title="1" data-gallery> 
    <img src="/1.JPG" class="img-thumbnail" alt="1" width="100" height="100"> 
    </a> 
</div> 

進行這些更改後,在開發和生產模式爲我工作。