2015-06-27 124 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> 

进行这些更改后,在开发和生产模式为我工作。