Browse Source

Removed host from showDialog function

Elliot Kirk 8 years ago
parent
commit
9de51b83e8

+ 1 - 2
examples/filebrowser/src/index.ts

@@ -263,8 +263,7 @@ function dialogDemo(): void {
   body.appendChild(input);
   body.appendChild(input);
   body.appendChild(selector);
   body.appendChild(selector);
   showDialog({
   showDialog({
-    title: 'Create new notebook',
-    body,
+    title: 'Create new notebook'
   });
   });
 }
 }
 
 

+ 1 - 2
src/console/widget.ts

@@ -168,8 +168,7 @@ class ConsolePanel extends Panel {
       let name = spec.display_name;
       let name = spec.display_name;
       return showDialog({
       return showDialog({
         title: 'Shut down kernel?',
         title: 'Shut down kernel?',
-        body: `Shut down ${name}?`,
-        host: this.node
+        body: `Shut down ${name}?`
       });
       });
     }).then(value => {
     }).then(value => {
       if (value && value.text === 'OK') {
       if (value && value.text === 'OK') {

+ 1 - 2
src/docmanager/widgetmanager.ts

@@ -229,8 +229,7 @@ class DocumentWidgetManager {
     }
     }
     return showDialog({
     return showDialog({
       title: 'Close without saving?',
       title: 'Close without saving?',
-      body: `File "${widget.title.text}" has unsaved changes, close without saving?`,
-      host: widget.node
+      body: `File "${widget.title.text}" has unsaved changes, close without saving?`
     }).then(value => {
     }).then(value => {
       if (value && value.text === 'OK') {
       if (value && value.text === 'OK') {
         return true;
         return true;

+ 1 - 2
src/docregistry/kernelactions.ts

@@ -29,8 +29,7 @@ function restartKernel(kernel: IKernel, host?: HTMLElement): Promise<boolean> {
   }
   }
   return showDialog({
   return showDialog({
     title: 'Restart Kernel?',
     title: 'Restart Kernel?',
-    body: 'Do you want to restart the current kernel? All variables will be lost.',
-    host
+    body: 'Do you want to restart the current kernel? All variables will be lost.'
   }).then(result => {
   }).then(result => {
     if (result.text === 'OK') {
     if (result.text === 'OK') {
       return kernel.restart().then(() => { return true; });
       return kernel.restart().then(() => { return true; });

+ 0 - 1
src/docregistry/kernelselector.ts

@@ -79,7 +79,6 @@ function selectKernel(options: IKernelSelection): Promise<IKernel.IModel> {
   return showDialog({
   return showDialog({
     title: 'Select Kernel',
     title: 'Select Kernel',
     body,
     body,
-    host: options.host,
     okText: 'SELECT'
     okText: 'SELECT'
   }).then(result => {
   }).then(result => {
     // Change the kernel if a kernel was selected.
     // Change the kernel if a kernel was selected.

+ 0 - 1
src/filebrowser/buttons.ts

@@ -454,7 +454,6 @@ namespace Private {
   function uploadFileOverride(widget: FileButtons, file: File): Promise<any> {
   function uploadFileOverride(widget: FileButtons, file: File): Promise<any> {
     let options = {
     let options = {
       title: 'Overwrite File?',
       title: 'Overwrite File?',
-      host: widget.parent.node,
       body: `"${file.name}" already exists, overwrite?`
       body: `"${file.name}" already exists, overwrite?`
     };
     };
     return showDialog(options).then(button => {
     return showDialog(options).then(button => {

+ 0 - 1
src/filebrowser/crumbs.ts

@@ -235,7 +235,6 @@ class BreadCrumbs extends Widget {
         if (error.message.indexOf('409') !== -1) {
         if (error.message.indexOf('409') !== -1) {
           let options = {
           let options = {
             title: 'Overwrite file?',
             title: 'Overwrite file?',
-            host: this.parent.node,
             body: `"${newPath}" already exists, overwrite?`,
             body: `"${newPath}" already exists, overwrite?`,
             okText: 'OVERWRITE'
             okText: 'OVERWRITE'
           };
           };

+ 0 - 1
src/filebrowser/dialogs.ts

@@ -41,7 +41,6 @@ function openWithDialog(path: string, manager: DocumentManager, host?: HTMLEleme
     handler = new OpenWithHandler(path, manager, sessions);
     handler = new OpenWithHandler(path, manager, sessions);
     return showDialog({
     return showDialog({
       title: 'Open File',
       title: 'Open File',
-      host,
       body: handler.node,
       body: handler.node,
       okText: 'OPEN'
       okText: 'OPEN'
     });
     });

+ 0 - 3
src/filebrowser/listing.ts

@@ -371,7 +371,6 @@ class DirListing extends Widget {
       return showDialog({
       return showDialog({
         title: 'Delete file?',
         title: 'Delete file?',
         body: message,
         body: message,
-        host: this.node.parentElement,
         okText: 'DELETE'
         okText: 'DELETE'
       }).then(result => {
       }).then(result => {
         if (result.text === 'DELETE') {
         if (result.text === 'DELETE') {
@@ -943,7 +942,6 @@ class DirListing extends Widget {
         if (error.message.indexOf('409') !== -1) {
         if (error.message.indexOf('409') !== -1) {
           let options = {
           let options = {
             title: 'Overwrite file?',
             title: 'Overwrite file?',
-            host: this.parent.node,
             body: `"${newPath}" already exists, overwrite?`,
             body: `"${newPath}" already exists, overwrite?`,
             okText: 'OVERWRITE'
             okText: 'OVERWRITE'
           };
           };
@@ -1162,7 +1160,6 @@ class DirListing extends Widget {
             error.message.indexOf('already exists') !== -1) {
             error.message.indexOf('already exists') !== -1) {
           let options = {
           let options = {
             title: 'Overwrite file?',
             title: 'Overwrite file?',
-            host: this.parent.node,
             body: `"${newName}" already exists, overwrite?`,
             body: `"${newName}" already exists, overwrite?`,
             okText: 'OVERWRITE'
             okText: 'OVERWRITE'
           };
           };

+ 0 - 1
src/filebrowser/utils.ts

@@ -53,7 +53,6 @@ function showErrorMessage(host: Widget, title: string, error: Error): Promise<vo
   }
   }
   let options = {
   let options = {
     title: title,
     title: title,
-    host: node,
     body: error.message || `File ${title}`,
     body: error.message || `File ${title}`,
     buttons: [okButton],
     buttons: [okButton],
     okText: 'DISMISS'
     okText: 'DISMISS'

+ 0 - 1
src/notebook/notebook/trust.ts

@@ -44,7 +44,6 @@ function trustNotebook(model: INotebookModel, host?: HTMLElement): Promise<void>
     return Promise.resolve(void 0);
     return Promise.resolve(void 0);
   }
   }
   return showDialog({
   return showDialog({
-    host: host || document.body,
     body: TRUST_MESSAGE,
     body: TRUST_MESSAGE,
     title: 'Trust this notebook?'
     title: 'Trust this notebook?'
   }).then(result => {
   }).then(result => {