Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

message boxes not working #18

Open
robertnicjoo opened this issue Jan 9, 2019 · 1 comment
Open

message boxes not working #18

robertnicjoo opened this issue Jan 9, 2019 · 1 comment

Comments

@robertnicjoo
Copy link

hi,
I'm using this template in dynamic application and message boxes wont open when i have errors, as the sample page works with id and buttons to open message boxes should i edit some file or codes in order to let them open without any click function? just like bootstrap alerts??

<div class="message-box message-box-danger animated fadeIn" id="message-box-danger">
            <div class="mb-container">
                <div class="mb-middle">
                    <div class="mb-title"><span class="fa fa-times"></span> Danger</div>
                    <div class="mb-content">
                        <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec at tellus sed mauris mollis pellentesque nec a ligula. Quisque ultricies eleifend lacinia. Nunc luctus quam pretium massa semper tincidunt. Praesent vel mollis eros. Fusce erat arcu, feugiat ac dignissim ac, aliquam sed urna. Maecenas scelerisque molestie justo, ut tempor nunc.</p>
                    </div>
                    <div class="mb-footer">
                        <button class="btn btn-default btn-lg pull-right mb-control-close">Close</button>
                    </div>
                </div>
            </div>
        </div>

thanks.

@angelhosuarezrucoba
Copy link

there is a method like this in /js/actions.js

/* MESSAGE BOX */
$(".mb-control").on("click", function () {
var box = $($(this).data("box"));
if (box.length > 0) {

        box.toggleClass("open");

        var sound = box.data("sound");

        if (sound === 'alert')
            playAudio('alert');

        if (sound === 'fail')
            playAudio('fail');

    } 
    return false;
});

that method just works on ready , you could paste the function inside and call it where do you want. thats all then it will work. you have to put data-box="#message-box-danger" as an attribute to some label or item that you want and this class mb-control .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants