Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Morten Skjoldager 440 posts 1499 karma points
    Mar 03, 2014 @ 15:58
    Morten Skjoldager
    0

    Set width of modal dialog in Umbraco 7

    Hello, 

    I want to open a modal dialog in umbraco 7 and set the width of that one. 

    However applying with as an argument  in UmbClientMgr.openModalWindow wont set the length of the dialog.

    How should i parse the width argument? Can you give me an example of this?

    Cheers.

     

  • Sören Deger 733 posts 2844 karma points c-trib
    Mar 05, 2015 @ 09:16
    Sören Deger
    0

    Hi Morten,

    have you found a solution to adjust the width of a single modal dialog? I have just the same requirement.

     

    Best,

    Sören

  • Sören Deger 733 posts 2844 karma points c-trib
    Mar 05, 2015 @ 09:53
    Sören Deger
    1

    Hi Morten,

    I have found it. You can use the modalClass option to remove the default umb-modal class and add your own css class.

    This works for me:

    $scope.openTest = function () {
            var dialog = dialogService.open({
                modalClass: 'cpewidth',
                template: '/App_Plugins/CPE/cpe.html',
                show: true
            });
        }

    CSS:

    .cpewidth {
        width: 1200px;
        left: 100% !important;
        top: 0px !important;
        height: 100% !important;
        margin-left: -1200px;
    }

     

    Hope this helps?
     

    Best,

    Sören

  • Daniel Bardi 927 posts 2562 karma points
    Jun 23, 2017 @ 02:49
    Daniel Bardi
    0

    This doesn't work anymore.

  • Daniel Bardi 927 posts 2562 karma points
    Jun 23, 2017 @ 02:35
    Daniel Bardi
    0

    This topic is old and is still an issue. But I have an updated solution.

    Wrap your dialog in a div and give it a custom css class.

    The css class should should look like this if you want 800px

    .my-dialog-wrapper {
        width: 800px !important;
        margin-left: -800px;
        top: 0 !important;
        left: 100% !important;
        display: block;
        height: 100% !important;
        box-shadow: 0 0 20px #000000, 0 0 6px #000000;
        box-shadow: 0 0 20px rgba(0,0,0,0.19), 0 0 6px rgba(0,0,0,0.23)
    }
    

    No need to doing anything else with dialog options.

    Hope this helps someone.

Please Sign in or register to post replies

Write your reply to:

Draft