2012-05-22 91 views
0

我在我的項目中使用Sass-Bootstrap寶石,在我的application.js文件中有以下內容。什麼叫Javascript?

// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD 
// GO AFTER THE REQUIRES BELOW. 
// 
//= require jquery 
//= require jquery_ujs 
//= require bootstrap 
//= require bootstrap-scrollspy 
//= require bootstrap-modal 
//= require bootstrap-dropdown 
//= require_tree 

我,包括我的application.html.erb文件中的下列標記,利用模態功能。

<div class="modal" id="loginModal"> 
      <div class="modal-header"> 
      <button class="close" data-dismiss="modal">×</button> 
      <h3>Sign in</h3> 
      </div> 
      <div class="modal-body"> 
      <%= simple_form_for(resource, :as => resource_name, :url => session_path(resource_name),:html => { :class => 'form-horizontal' }) do |f| %> 
        <%= f.input :email, :required => false, :autofocus => true %> 
        <%= f.input :password, :required => false %> 
        <%= f.input :remember_me, :as => :boolean if devise_mapping.rememberable? %> 
        <%= f.button :submit, "Sign in", :class => 'btn' %> 
       <% end %> 
      </div> 
     </div> 

但由於某種原因。即使當其他文件中沒有javascript/coffescript時,模式也會顯示...什麼叫它?它是默認行爲嗎?

回答

0

嘗試:

<div class="modal hide" id="loginModal"> 
+0

doh..silly mistake..thanks! – Keva161

+1

我從個人的奮鬥中知道。我發現它沒有很好的記錄。 – evanbikes