View | Details | Raw Unified | Return to bug 26062
Collapse All | Expand All

(-)umc/js/udm.js (-8 / +10 lines)
 Lines 668-677    Link Here 
668
668
669
				// add a context menu to edit/delete items
669
				// add a context menu to edit/delete items
670
				var menu = new Menu({});
670
				var menu = new Menu({});
671
				var nameMenuItem = new MenuItem({
672
					label: null, // this._navContextItem.path
673
					disabled: true
674
				});
675
				menu.addChild(nameMenuItem);
671
				menu.addChild(new MenuItem({
676
				menu.addChild(new MenuItem({
672
					label: _( 'Edit' ),
677
					label: _( 'Edit' ),
673
					iconClass: 'umcIconEdit',
678
					iconClass: 'umcIconEdit',
674
					onClick: lang.hitch(this, function(e) {
679
					onClick: lang.hitch(this, function() {
675
						this.createDetailPage(this._navContextItem.objectType, this._navContextItem.id);
680
						this.createDetailPage(this._navContextItem.objectType, this._navContextItem.id);
676
					})
681
					})
677
				}));
682
				}));
 Lines 699-711    Link Here 
699
				this.own(menu);
704
				this.own(menu);
700
705
701
				// remember on which item the context menu has been opened
706
				// remember on which item the context menu has been opened
702
				this.own(aspect.after(menu, '_openMyself', lang.hitch(this, function(e) {
707
				this.own(aspect.after(this._tree, '_onNodeFocus', lang.hitch(this, function(node) {
703
					if (this._tree.selectedNode) {
708
					this._navContextItem = node.item;
704
						this._navContextItem = this._tree.selectedNode.item;
709
					nameMenuItem.set('label', this._navContextItem.id);
705
					} else {
710
				}), true));
706
						console.warn('this._tree.selectedNode is null');
707
					}
708
				})));
709
				// in the case of changes, reload the navigation, as well (could have
711
				// in the case of changes, reload the navigation, as well (could have
710
				// changes referring to container objects)
712
				// changes referring to container objects)
711
				this.on('objectsaved', lang.hitch(this, function(dn, objectType) {
713
				this.on('objectsaved', lang.hitch(this, function(dn, objectType) {

Return to bug 26062