Sha256: 17d57c957fcad0662700c86eaf37bc1b64a35bd6317b9535deb5198fd8030cc1

Contents?: true

Size: 1.28 KB

Versions: 7

Compression:

Stored size: 1.28 KB

Contents

%ul.nav.nav-list.nav-list-panel.space-list
  %li
    = link_to wiki_pages_path, class: "space-link" do
      All Spaces
      %i.fa.fa-arrow-circle-right
  - if @space.present? && @space.persisted?
    %li.nav-header 
      = @space.title
    - @space.children.each do |page|
      = render 'wiki/spaces/page_list_item', page: page, end_page: @page
      -# %li.page-list-item{data: {page_id: page.id}}
      -#   = link_to wiki_page_path(page) do
      -#     - if page.has_children?
      -#       %i.fa.fa-plus-square
      -#     = page.title
  %li
    = link_to new_wiki_space_path do 
      %i.fa.fa-plus

:coffeescript
  $ ->
    $(document).on "click", ".page-list-item a i.fa-plus-square", ->
      $i = $(this)
      $i.toggleClass("fa-plus-square").toggleClass('fa-minus-square')
      page_id = $i.closest(".page-list-item").data("page-id")
      $.ajax
        method: "GET"
        url: "/wiki/spaces/" + page_id + "/space_list"
        success: (data) ->
          $i.closest("a").after data
      console.log "lalla"
      false

    $(document).on "click", ".page-list-item a i.fa-minus-square", ->
      $i = $(this)
      $i.toggleClass("fa-plus-square").toggleClass('fa-minus-square')
      $i.closest(".page-list-item").find("ul.nav-list-sub").remove()
      console.log "lalla"
      false

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
tawork-0.0.11 app/views/layouts/_spaces.html.haml
tawork-0.0.10 app/views/layouts/_spaces.html.haml
tawork-0.0.9 app/views/layouts/_spaces.html.haml
tawork-0.0.8 app/views/layouts/_spaces.html.haml
tawork-0.0.7 app/views/layouts/_spaces.html.haml
tawork-0.0.6 app/views/layouts/_spaces.html.haml
tawork-0.0.5 app/views/layouts/_spaces.html.haml