Commit f79b2100 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix wiki popup for new page

parent 4e6f131c
...@@ -39,7 +39,9 @@ class Dispatcher ...@@ -39,7 +39,9 @@ class Dispatcher
switch path.first() switch path.first()
when 'admin' then new Admin() when 'admin' then new Admin()
when 'wikis' then new Wikis() when 'projects'
new Wikis() if path[1] == 'wikis'
initSearch: -> initSearch: ->
autocomplete_json = $('.search-autocomplete-json').data('autocomplete-opts') autocomplete_json = $('.search-autocomplete-json').data('autocomplete-opts')
......
class Wikis class Wikis
constructor: -> constructor: ->
modal = $('#modal-new-wiki').modal({modal: true, show:false})
$('.add-new-wiki').bind "click", ->
modal.show()
$('.build-new-wiki').bind "click", -> $('.build-new-wiki').bind "click", ->
field = $('#new_wiki_path') field = $('#new_wiki_path')
slug = field.val() slug = field.val()
...@@ -13,7 +8,5 @@ class Wikis ...@@ -13,7 +8,5 @@ class Wikis
if(slug.length > 0) if(slug.length > 0)
location.href = path + "/" + slug location.href = path + "/" + slug
$('.modal-header .close').bind "click", ->
modal.hide()
@Wikis = Wikis @Wikis = Wikis
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
- if can?(current_user, :write_wiki, @project) - if can?(current_user, :write_wiki, @project)
.pull-right .pull-right
= link_to '#', class: "add-new-wiki btn btn-new" do = link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do
%i.icon-plus %i.icon-plus
New Page New Page
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment