hotkey actions: toggle_expand, collapse_article: check if element exists
before acting on it (closes #815)
This commit is contained in:
parent
110ce72a72
commit
98cbae8dfa
26
js/tt-rss.js
26
js/tt-rss.js
|
@ -302,21 +302,27 @@ function init() {
|
||||||
hotkey_actions["collapse_article"] = function() {
|
hotkey_actions["collapse_article"] = function() {
|
||||||
var id = getActiveArticleId();
|
var id = getActiveArticleId();
|
||||||
var elem = $("CICD-"+id);
|
var elem = $("CICD-"+id);
|
||||||
if(elem.visible()) {
|
|
||||||
cdmCollapseArticle(null, id);
|
if (elem) {
|
||||||
}
|
if (elem.visible()) {
|
||||||
else {
|
cdmCollapseArticle(null, id);
|
||||||
cdmExpandArticle(id);
|
}
|
||||||
|
else {
|
||||||
|
cdmExpandArticle(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
hotkey_actions["toggle_expand"] = function() {
|
hotkey_actions["toggle_expand"] = function() {
|
||||||
var id = getActiveArticleId();
|
var id = getActiveArticleId();
|
||||||
var elem = $("CICD-"+id);
|
var elem = $("CICD-"+id);
|
||||||
if(elem.visible()) {
|
|
||||||
cdmCollapseArticle(null, id, false);
|
if (elem) {
|
||||||
}
|
if (elem.visible()) {
|
||||||
else {
|
cdmCollapseArticle(null, id, false);
|
||||||
cdmExpandArticle(id);
|
}
|
||||||
|
else {
|
||||||
|
cdmExpandArticle(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
hotkey_actions["search_dialog"] = function() {
|
hotkey_actions["search_dialog"] = function() {
|
||||||
|
|
Loading…
Reference in New Issue