jupyter-js-filebrowser
Advanced tools
Comparing version 0.4.2 to 0.4.3
@@ -10,3 +10,2 @@ // Copyright (c) Jupyter Development Team. | ||
var jupyter_js_domutils_1 = require('jupyter-js-domutils'); | ||
var phosphor_command_1 = require('phosphor-command'); | ||
var phosphor_menus_1 = require('phosphor-menus'); | ||
@@ -59,8 +58,11 @@ var phosphor_widget_1 = require('phosphor-widget'); | ||
// Create the "new" menu. | ||
var command = new phosphor_command_1.DelegateCommand(function (args) { | ||
_this._model.newUntitled(args).catch(function (error) { | ||
var handler = function (item) { | ||
var type = item.text.toLowerCase(); | ||
if (type === 'text file') | ||
type = 'file'; | ||
_this._model.newUntitled(type).catch(function (error) { | ||
return utils_1.showErrorMessage(_this, 'New File Error', error); | ||
}).then(function () { return _this._model.refresh(); }); | ||
}); | ||
this._newMenu = Private.createNewItemMenu(command); | ||
}; | ||
this._newMenu = Private.createNewItemMenu(handler); | ||
} | ||
@@ -154,18 +156,15 @@ /** | ||
*/ | ||
function createNewItemMenu(command) { | ||
function createNewItemMenu(handler) { | ||
return new phosphor_menus_1.Menu([ | ||
new phosphor_menus_1.MenuItem({ | ||
text: 'Notebook', | ||
command: command, | ||
commandArgs: 'notebook' | ||
handler: handler, | ||
}), | ||
new phosphor_menus_1.MenuItem({ | ||
text: 'Text File', | ||
command: command, | ||
commandArgs: 'file' | ||
handler: handler, | ||
}), | ||
new phosphor_menus_1.MenuItem({ | ||
text: 'Directory', | ||
command: command, | ||
commandArgs: 'directory' | ||
handler: handler, | ||
}) | ||
@@ -172,0 +171,0 @@ ]); |
@@ -112,2 +112,6 @@ import { IContentsModel } from 'jupyter-js-services'; | ||
/** | ||
* Handle the `'keydown'` event for the widget. | ||
*/ | ||
private _evtKeyDown(event); | ||
/** | ||
* Handle the `'dblclick'` event for the widget. | ||
@@ -114,0 +118,0 @@ */ |
@@ -158,2 +158,3 @@ // Copyright (c) Jupyter Development Team. | ||
header.appendChild(modified); | ||
node.tabIndex = 1; | ||
return node; | ||
@@ -336,2 +337,4 @@ }; | ||
break; | ||
case 'keydown': | ||
this._evtKeyDown(event); | ||
case 'click': | ||
@@ -364,2 +367,3 @@ this._evtClick(event); | ||
node.addEventListener('mousedown', this); | ||
node.addEventListener('keydown', this); | ||
node.addEventListener('click', this); | ||
@@ -379,2 +383,3 @@ node.addEventListener('dblclick', this); | ||
node.removeEventListener('mousedown', this); | ||
node.removeEventListener('keydown', this); | ||
node.removeEventListener('click', this); | ||
@@ -522,2 +527,12 @@ node.removeEventListener('dblclick', this); | ||
/** | ||
* Handle the `'keydown'` event for the widget. | ||
*/ | ||
DirListing.prototype._evtKeyDown = function (event) { | ||
if (event.keyCode == 13 && this._selectedNames.length === 1) { | ||
event.stopPropagation(); | ||
event.preventDefault(); | ||
this._doRename(); | ||
} | ||
}; | ||
/** | ||
* Handle the `'dblclick'` event for the widget. | ||
@@ -524,0 +539,0 @@ */ |
{ | ||
"name": "jupyter-js-filebrowser", | ||
"version": "0.4.2", | ||
"version": "0.4.3", | ||
"description": "File browser widget for Jupyter", | ||
@@ -13,7 +13,6 @@ "main": "lib/index.js", | ||
"moment": "^2.10.6", | ||
"phosphor-command": "^0.5.0", | ||
"phosphor-disposable": "^1.0.5", | ||
"phosphor-domutil": "^1.2.0", | ||
"phosphor-dragdrop": "^0.9.0", | ||
"phosphor-menus": "^1.0.0-rc.0", | ||
"phosphor-menus": "^1.0.0-rc.1", | ||
"phosphor-messaging": "^1.0.5", | ||
@@ -20,0 +19,0 @@ "phosphor-nodewrapper": "^1.0.4", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
112439
15
3206
- Removedphosphor-command@^0.5.0
- Removedphosphor-command@0.5.0(transitive)
Updatedphosphor-menus@^1.0.0-rc.1