Fixed entry shortcuts available in list view

This commit is contained in:
Nicolas Lœuillet 2016-11-22 21:31:21 +01:00
parent 7c6b7a40d1
commit 0df2a4b021
No known key found for this signature in database
GPG key ID: BDC1EFB5CA0145F2
7 changed files with 70 additions and 62 deletions

View file

@ -1,22 +1,26 @@
import Mousetrap from 'mousetrap';
import $ from 'jquery';
/* Article view */
Mousetrap.bind('o', () => {
$('div#article_toolbar ul.links a.original')[0].click();
});
$(document).ready(() => {
if ($('#article').length > 0) {
/* Article view */
Mousetrap.bind('o', () => {
$('div#article_toolbar ul.links a.original')[0].click();
});
/* mark as favorite */
Mousetrap.bind('f', () => {
$('div#article_toolbar ul.links a.favorite')[0].click();
});
/* mark as favorite */
Mousetrap.bind('f', () => {
$('div#article_toolbar ul.links a.favorite')[0].click();
});
/* mark as read */
Mousetrap.bind('a', () => {
$('div#article_toolbar ul.links a.markasread')[0].click();
});
/* mark as read */
Mousetrap.bind('a', () => {
$('div#article_toolbar ul.links a.markasread')[0].click();
});
/* delete */
Mousetrap.bind('del', () => {
$('div#article_toolbar ul.links a.delete')[0].click();
/* delete */
Mousetrap.bind('del', () => {
$('div#article_toolbar ul.links a.delete')[0].click();
});
}
});

View file

@ -1,22 +1,26 @@
import Mousetrap from 'mousetrap';
import $ from 'jquery';
/* open original article */
Mousetrap.bind('o', () => {
$('ul.side-nav a.original i')[0].click();
});
$(document).ready(() => {
if ($('#article').length > 0) {
/* open original article */
Mousetrap.bind('o', () => {
$('ul.side-nav a.original i')[0].click();
});
/* mark as favorite */
Mousetrap.bind('f', () => {
$('ul.side-nav a.favorite i')[0].click();
});
/* mark as favorite */
Mousetrap.bind('f', () => {
$('ul.side-nav a.favorite i')[0].click();
});
/* mark as read */
Mousetrap.bind('a', () => {
$('ul.side-nav a.markasread i')[0].click();
});
/* mark as read */
Mousetrap.bind('a', () => {
$('ul.side-nav a.markasread i')[0].click();
});
/* delete */
Mousetrap.bind('del', () => {
$('ul.side-nav a.delete i')[0].click();
/* delete */
Mousetrap.bind('del', () => {
$('ul.side-nav a.delete i')[0].click();
});
}
});

View file

@ -90,7 +90,7 @@
</a>
</li>
<li>
<a title="{{ 'menu.top.search'|trans }}" class="waves-effect" href="javascript: void(null);" id="nav-btn-search">
<a class="waves-effect tooltipped" data-position="bottom" data-delay="50" data-tooltip="{{ 'menu.top.search'|trans }}" href="javascript: void(null);" id="nav-btn-search">
<i class="material-icons">search</i>
</a>
</li>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long