hotkey actions: toggle_expand, collapse_article: check if element exists

before acting on it (closes #815)
master
Andrew Dolgov 10 years ago
parent 110ce72a72
commit 98cbae8dfa

@ -302,21 +302,27 @@ function init() {
hotkey_actions["collapse_article"] = function() {
var id = getActiveArticleId();
var elem = $("CICD-"+id);
if(elem.visible()) {
cdmCollapseArticle(null, id);
}
else {
cdmExpandArticle(id);
if (elem) {
if (elem.visible()) {
cdmCollapseArticle(null, id);
}
else {
cdmExpandArticle(id);
}
}
};
hotkey_actions["toggle_expand"] = function() {
var id = getActiveArticleId();
var elem = $("CICD-"+id);
if(elem.visible()) {
cdmCollapseArticle(null, id, false);
}
else {
cdmExpandArticle(id);
if (elem) {
if (elem.visible()) {
cdmCollapseArticle(null, id, false);
}
else {
cdmExpandArticle(id);
}
}
};
hotkey_actions["search_dialog"] = function() {

Loading…
Cancel
Save