我有一个按钮可以打开我的材质对话框。在打开的对话框中,后台页面滚动到顶部。关闭对话框时,页面滚动回原始位置。
谁可以阻止这个滚动?
const dialogRef = this.dialog.open(dialogComponent, {
panelClass: config.panelClass,
width: 1100px,
height: 800px,
closeOnNavigation: true,
maxHeight: '95%',
maxWidth: '95%',
data: {
someData...
},
});
Run Code Online (Sandbox Code Playgroud)
我的网页
<div class="dialog dialog__content">
<div>
<div *ngIf="title" class="dialog__header">
<h1 mat-dialog-title>{{title | translate}}</h1>
</div>
<div class="dialog__closing">
<button matDialogClose>
<i class="fal fa-times-circle"></i>
</button>
</div>
</div>
<mat-dialog-content>
...some content...
</mat-dialog-content>
<mat-dialog-actions *ngIf="buttons && buttons.length > 0">
<div class="buttons">
<button>...</button>
</div>
</mat-dialog-actions>
</div>
Run Code Online (Sandbox Code Playgroud) 我有一个错误代码1000,如果我从我的照片库中选择一个图像与cordova插件cordova-plugin-file 3.0.0(android).我不知道错误代码1000测量什么.如果我拍一张新照片,一切正常.
有人有想法吗?
function optionsForType(type) {
var source;
switch (type) {
case 0:
source = Camera.PictureSourceType.CAMERA;
break;
case 1:
source = Camera.PictureSourceType.PHOTOLIBRARY;
break;
}
return {
destinationType: Camera.DestinationType.FILE_URI,
sourceType: source,
allowEdit: false,
encodingType: Camera.EncodingType.JPEG,
popoverOptions: CameraPopoverOptions,
saveToPhotoAlbum: false
};
}
function saveMedia(type) {
var deferred = $q.defer();
var options = optionsForType(type);
$cordovaCamera.getPicture(options).then(function(imageUrl) {
var name = imageUrl.substr(imageUrl.lastIndexOf('/') + 1);
var namePath = imageUrl.substr(0, imageUrl.lastIndexOf('/') + 1);
var newName = makeid() + name;
console.log(newName, cordova.file.dataDirectory);
$cordovaFile.copyFile(namePath, name, cordova.file.dataDirectory, newName)
.then(function() { …Run Code Online (Sandbox Code Playgroud) android android-camera ionic-framework cordova-plugins ionic