Commit f79b210061724fa1460fbb10853467182031c2c5
1 parent
4e6f131c
Exists in
master
and in
4 other branches
Fix wiki popup for new page
Showing
3 changed files
with
4 additions
and
9 deletions
Show diff stats
app/assets/javascripts/dispatcher.js.coffee
... | ... | @@ -39,7 +39,9 @@ class Dispatcher |
39 | 39 | |
40 | 40 | switch path.first() |
41 | 41 | when 'admin' then new Admin() |
42 | - when 'wikis' then new Wikis() | |
42 | + when 'projects' | |
43 | + new Wikis() if path[1] == 'wikis' | |
44 | + | |
43 | 45 | |
44 | 46 | initSearch: -> |
45 | 47 | autocomplete_json = $('.search-autocomplete-json').data('autocomplete-opts') | ... | ... |
app/assets/javascripts/wikis.js.coffee
1 | 1 | class Wikis |
2 | 2 | constructor: -> |
3 | - modal = $('#modal-new-wiki').modal({modal: true, show:false}) | |
4 | - | |
5 | - $('.add-new-wiki').bind "click", -> | |
6 | - modal.show() | |
7 | - | |
8 | 3 | $('.build-new-wiki').bind "click", -> |
9 | 4 | field = $('#new_wiki_path') |
10 | 5 | slug = field.val() |
... | ... | @@ -13,7 +8,5 @@ class Wikis |
13 | 8 | if(slug.length > 0) |
14 | 9 | location.href = path + "/" + slug |
15 | 10 | |
16 | - $('.modal-header .close').bind "click", -> | |
17 | - modal.hide() | |
18 | 11 | |
19 | 12 | @Wikis = Wikis | ... | ... |
app/views/projects/wikis/_nav.html.haml
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 | |
13 | 13 | - if can?(current_user, :write_wiki, @project) |
14 | 14 | .pull-right |
15 | - = link_to '#', class: "add-new-wiki btn btn-new" do | |
15 | + = link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do | |
16 | 16 | %i.icon-plus |
17 | 17 | New Page |
18 | 18 | ... | ... |