Skip to content

Commit

Permalink
Merge pull request #89 from funktechno/dev
Browse files Browse the repository at this point in the history
wiki menu fix
  • Loading branch information
lastlink committed Jul 24, 2024
2 parents 1e36157 + 8eb0094 commit 9cc54e2
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
16 changes: 16 additions & 0 deletions Asset/Javascript/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

KB.on('dom.ready', function () {
function goToLink(selector) {
if (!KB.modal.isOpen()) {
let element = KB.find(selector);

if (element !== null) {
window.location = element.attr('href');
}
}
}

KB.onKey('v+w', function () {
goToLink('a.view-wiki');
});
});
19 changes: 1 addition & 18 deletions Asset/Javascript/wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jQuery(document).ready(function () {
}

// console.log("request", request)


$.ajax({
cache: false,
Expand Down Expand Up @@ -49,20 +49,3 @@ jQuery(document).ready(function () {
})
}
});

KB.on('dom.ready', function () {
function goToLink(selector) {
if (!KB.modal.isOpen()) {
let element = KB.find(selector);

if (element !== null) {
window.location = element.attr('href');
}
}
}

KB.onKey('v+w', function () {
goToLink('a.view-wiki');
});
});

7 changes: 4 additions & 3 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,15 @@ public function initialize()

$this->template->hook->attach('template:header:dropdown', 'wiki:header/dropdown');
$this->template->hook->attach('template:project-header:view-switcher', 'Wiki:project_header/views');

$this->template->setTemplateOverride('board/view_public', 'wiki:board/view_public');

$this->template->setTemplateOverride('file_viewer/show', 'wiki:file_viewer/show');

$this->hook->on('template:layout:css', array('template' => 'plugins/Wiki/Asset/css/wiki.css'));
// $this->hook->on('template:layout:js', array('template' => 'plugins/Wiki/Asset/vendor/jquery-sortable/jquery-sortable.js'));
// $this->hook->on('template:layout:js', array('template' => 'plugins/Wiki/Asset/Javascript/wiki.js'));
$this->hook->on('template:layout:js', array('template' => 'plugins/Wiki/Asset/Javascript/main.js'));


// $this->template->setTemplateOverride('wiki', 'wiki:wiki/layout');
Expand All @@ -59,7 +60,7 @@ public function initialize()
// $this->helper->register('wiki', '\Kanboard\Plugin\Wiki\Helper\layout');

$this->helper->register('wikiHelper', '\Kanboard\Plugin\Wiki\Helper\WikiHelper');


}

Expand Down

0 comments on commit 9cc54e2

Please sign in to comment.