Sha256: 6fea7590b33ac1c4f019c2cb58a9b88e683e2f2dd6be7d835da80626941038bb

Contents?: true

Size: 1.25 KB

Versions: 30

Compression:

Stored size: 1.25 KB

Contents

$(function(){
  // Send ajax request with all forms data for given tabs block.
  function save_tab(tabs){
    var data=""
    tabs.find("form").each(function(){
      data=data+$(this).serialize()
    })
    //alert(data)
    $.ajax({
      url:tabs.attr("data-tabs-url"),
      dataType:"html",
      type:tabs.attr("data-method"),
      data:data,
      success:function(data){
        $("#content").html(data);
        TinyMCEConfigManager.load();
      }
    })
  }
  // Submit all forms through Ajax when Save All button clicked.
  $("button.save-all").live('click',function(){
    //var tab=$(this).parents("div[data-tabs-url]")
    var tab = $("#content").children("div[data-tabs-url]")
    save_tab(tab)
  })
  // All tabs are closable when clicked on tab title.
  $(".tab .tab-title").live('click',function(){
    var tab_title=$(this)
    var closed=tab_title.data("closed") || (tab_title.attr("data-closed")=="false" ? false : true)
      if(closed){
        tab_title.parents(".tab").find(".tab-content").show("fast")
      }else{
        tab_title.parents(".tab").find(".tab-content").hide("fast")
      }
      tab_title.data("closed",!closed)
    })
    // Flash is hidden when clicked on
  $("#flash").live("click", function(){
    $(this).slideUp("fast");
  })
})

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
lolita-4.0.11 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.2.0 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.0.10 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.0.9 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.0.8 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.0.7 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.0.6 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.0.5 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.0.4 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.0.3 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.0.2 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.0.1 spec/rails_app/public/javascripts/lolita/tab.js
lolita-4.0.0 spec/rails_app/public/javascripts/lolita/tab.js
lolita-3.4.3 spec/rails_app/public/javascripts/lolita/tab.js
lolita-3.4.2 spec/rails_app/public/javascripts/lolita/tab.js
lolita-3.4.1 spec/rails_app/public/javascripts/lolita/tab.js
lolita-3.4.0 spec/rails_app/public/javascripts/lolita/tab.js
lolita-3.3.9 spec/rails_app/public/javascripts/lolita/tab.js
lolita-3.3.8 spec/rails_app/public/javascripts/lolita/tab.js
lolita-3.3.7 spec/rails_app/public/javascripts/lolita/tab.js