double click for actions on sidebar
This commit is contained in:
parent
7764f1287d
commit
9f06d02e52
2 changed files with 20 additions and 0 deletions
|
@ -141,6 +141,7 @@ require(["dojo/_base/declare", "dojo/dom-construct", "dijit/Tree", "dijit/Menu"]
|
||||||
}}));
|
}}));
|
||||||
|
|
||||||
if (bare_id > 0) {
|
if (bare_id > 0) {
|
||||||
|
menu.setAttribute('default_item', 1)
|
||||||
menu.addChild(new dijit.MenuItem({
|
menu.addChild(new dijit.MenuItem({
|
||||||
label: __("Edit feed"),
|
label: __("Edit feed"),
|
||||||
onClick: function() {
|
onClick: function() {
|
||||||
|
|
19
js/tt-rss.js
19
js/tt-rss.js
|
@ -78,6 +78,25 @@ function updateFeedList() {
|
||||||
persist: true,
|
persist: true,
|
||||||
id: "feedTree",
|
id: "feedTree",
|
||||||
}, "feedTree");
|
}, "feedTree");
|
||||||
|
tree.on('dblclick', function(_, item, evt) {
|
||||||
|
var tnode = dijit.byNode(item.domNode)
|
||||||
|
if(tnode._menu === undefined || tnode._menu.attr('default_item') === undefined) {
|
||||||
|
var element = tnode.domNode
|
||||||
|
var newevt = new MouseEvent('contextmenu', {
|
||||||
|
'view': window,
|
||||||
|
'bubbles': true,
|
||||||
|
'cancelable': true,
|
||||||
|
'screenX': evt.screenX,
|
||||||
|
'screenY': evt.screenY,
|
||||||
|
'clientX': evt.clientX,
|
||||||
|
'clientY': evt.clientY,
|
||||||
|
});
|
||||||
|
return !element.dispatchEvent(newevt);
|
||||||
|
} else {
|
||||||
|
var mi = tnode._menu.getChildren()[tnode._menu.attr('default_item')]
|
||||||
|
mi.onClick(evt)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
/* var menu = new dijit.Menu({id: 'feedMenu'});
|
/* var menu = new dijit.Menu({id: 'feedMenu'});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue