Merge pull request #860 from Alfresco/dev-mromano-631

Fix dialogs for firefox and safari
This commit is contained in:
Maurizio Vitale 2016-10-06 12:25:13 +01:00 committed by GitHub
commit c5466b3ac7
8 changed files with 61 additions and 2 deletions

View File

@ -9,4 +9,4 @@
} }
.user-profile{ .user-profile{
margin-right: 3px; margin-right: 3px;
} }

View File

@ -35,3 +35,7 @@ body, html {
text-align: center; text-align: center;
position: relative; position: relative;
} }
._dialog_overlay {
position: static !important;
}

View File

@ -35,6 +35,10 @@
<script src="node_modules/pdfjs-dist/build/pdf.worker.js"></script> <script src="node_modules/pdfjs-dist/build/pdf.worker.js"></script>
<script src="node_modules/pdfjs-dist/web/pdf_viewer.js"></script> <script src="node_modules/pdfjs-dist/web/pdf_viewer.js"></script>
<!-- Polyfill(s) for dialogs -->
<script src="node_modules/dialog-polyfill/dialog-polyfill.js"></script>
<link rel="stylesheet" type="text/css" href="node_modules/dialog-polyfill/dialog-polyfill.css" />
<!-- 2. Configure SystemJS --> <!-- 2. Configure SystemJS -->
<script src="systemjs.config.js"></script> <script src="systemjs.config.js"></script>
<script> <script>

View File

@ -87,7 +87,8 @@
"ng2-activiti-tasklist": "0.3.3", "ng2-activiti-tasklist": "0.3.3",
"ng2-activiti-processlist": "0.3.3", "ng2-activiti-processlist": "0.3.3",
"ng2-alfresco-webscript": "0.3.2", "ng2-alfresco-webscript": "0.3.2",
"ng2-alfresco-tag": "0.3.2" "ng2-alfresco-tag": "0.3.2",
"dialog-polyfill": "^0.4.3"
}, },
"devDependencies": { "devDependencies": {
"@types/core-js": "^0.9.32", "@types/core-js": "^0.9.32",

View File

@ -45,6 +45,26 @@ Also make sure you include these dependencies in your `index.html` file:
<script src="node_modules/material-design-lite/material.min.js"></script> <script src="node_modules/material-design-lite/material.min.js"></script>
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css"> <link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
``` ```
#### Dialogs Polyfill
To make the dialog working with all the browser you have to add the dialog polyfill to you project:
```sh
npm install --save dialog-polyfill
```
Also make sure you include these dependencies in your `index.html` file:
```html
<!-- Polyfill(s) for dialogs -->
<script src="node_modules/dialog-polyfill/dialog-polyfill.js"></script>
<link rel="stylesheet" type="text/css" href="node_modules/dialog-polyfill/dialog-polyfill.css" />
<style>
._dialog_overlay {
position: static !important;
}
</style>
```
## Basic usage examples ## Basic usage examples

View File

@ -24,6 +24,7 @@ import { FormFieldModel } from '../core/form-field.model';
declare let __moduleName: string; declare let __moduleName: string;
declare var componentHandler; declare var componentHandler;
declare let dialogPolyfill: any;
@Component({ @Component({
moduleId: __moduleName, moduleId: __moduleName,
@ -122,6 +123,11 @@ export class AttachWidget extends WidgetComponent implements OnInit {
public showDialog() { public showDialog() {
this.setupFileBrowser(); this.setupFileBrowser();
this.getExternalContentNodes(); this.getExternalContentNodes();
if (!this.dialog.nativeElement.showModal) {
dialogPolyfill.registerDialog(this.dialog.nativeElement);
}
if (this.dialog) { if (this.dialog) {
this.dialog.nativeElement.showModal(); this.dialog.nativeElement.showModal();
} }

View File

@ -47,6 +47,26 @@ Also make sure you include these dependencies in your `index.html` file:
<script src="node_modules/material-design-lite/material.min.js"></script> <script src="node_modules/material-design-lite/material.min.js"></script>
<link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css"> <link rel="stylesheet" href="node_modules/material-design-icons/iconfont/material-icons.css">
``` ```
#### Dialogs Polyfill
To make the dialog working with all the browser you have to add the dialog polyfill to you project:
```sh
npm install --save dialog-polyfill
```
Also make sure you include these dependencies in your `index.html` file:
```html
<!-- Polyfill(s) for dialogs -->
<script src="node_modules/dialog-polyfill/dialog-polyfill.js"></script>
<link rel="stylesheet" type="text/css" href="node_modules/dialog-polyfill/dialog-polyfill.css" />
<style>
._dialog_overlay {
position: static !important;
}
</style>
```
## Basic usage example Activiti Task List ## Basic usage example Activiti Task List
The component shows the list of all the tasks filter by the The component shows the list of all the tasks filter by the

View File

@ -21,6 +21,7 @@ import { TaskDetailsModel } from '../models/task-details.model';
import { ActivitiTaskListService } from './../services/activiti-tasklist.service'; import { ActivitiTaskListService } from './../services/activiti-tasklist.service';
declare let componentHandler: any; declare let componentHandler: any;
declare let dialogPolyfill: any;
@Component({ @Component({
selector: 'activiti-start-task', selector: 'activiti-start-task',
@ -85,6 +86,9 @@ export class ActivitiStartProcessButton implements OnInit {
} }
public showDialog() { public showDialog() {
if (!this.dialog.nativeElement.showModal) {
dialogPolyfill.registerDialog(this.dialog.nativeElement);
}
if (this.dialog) { if (this.dialog) {
this.dialog.nativeElement.showModal(); this.dialog.nativeElement.showModal();
} }