Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set dialog width in ngDialog

I'm simply trying to set the width of the dialog box, and I haven't succeeded (yet). I have added a CSS class, but the width set is the one of the dialog shade.

.dialogwidth800 {
    width : 800px;
}
...
ngDialog.openConfirm({
    template: 'templateRemove',
    className: 'ngdialog-theme-default dialogwidth800',
    scope: $scope
}).then(

EDIT : fiddle corrected with working solution here : https://jsfiddle.net/jr626fww/8/

like image 246
GuillaumeS Avatar asked May 09 '15 06:05

GuillaumeS


1 Answers

It can easily achieved by using custom css like below :

.ngdialog.ngdialog-theme-default.custom-width-800 .ngdialog-content {
    width: 800px;
}
.ngdialog.ngdialog-theme-default.custom-width-900 .ngdialog-content {
    width: 900px;
}

Use these css class when you open ngDialog :

To use custom-width-900

ngDialog.openConfirm({
    template: 'templateRemove',
    className: 'ngdialog-theme-default custom-width-800',
    scope: $scope
});

To use custom-width-900

ngDialog.openConfirm({
    template: 'templateRemove',
    className: 'ngdialog-theme-default custom-width-900',
    scope: $scope
});
like image 82
Bhuwan Prasad Upadhyay Avatar answered Sep 22 '22 13:09

Bhuwan Prasad Upadhyay