saribe / eModal

Easy Modal for bootstrap, is a simple way to create modal dialogs using javascript.
http://saribe.github.io/eModal
271 stars 97 forks source link

Unknown module when trying to consume with RequireJS #25

Closed atcrawford closed 8 years ago

atcrawford commented 8 years ago

It looks like this plugin relies on two modules, 'jquery' and 'Q'. I've never seen the module 'Q' before. Can you explain why that module is required, and how I can change my requirejs configuration to take it into account?

For what it's worth, it looks like the variable for that module is only used in one place:

        function _createDeferred() {
            var dfd = q ? q.defer() : $.Deferred();
            if (!q) {
                dfd.catch = dfd.fail;
                dfd.promise = dfd.promise();
            }
            dfd.promise.element = $modal;
            return dfd;
        }
atcrawford commented 8 years ago

Ah, after a little more searching, I've found what looks like the project for the module that's being referenced (https://github.com/kriskowal/q). From the code snippet above it seems Q might actually be optional/unnecessary, but I get the following console error in my project when I don't have it:

Error: Script error for: Q
saribe commented 8 years ago

Hi Drew Crawford, sorry about the delay.

Thanks for the feedback. I've set the Q as optional on AMD.

Should you need any further information, please do not hesitate to contact me.

saribe commented 8 years ago

Hello, can you confirm that this issue is resolved?

atcrawford commented 8 years ago

Yes, I can confirm that I'm no longer getting the error when I reference this js module without having Q included as well. Thanks for fixing this!

saribe commented 8 years ago

Thank you for reporting!

Best!

Samuel Ribeiro Pinto

2016-01-25 17:15 GMT+00:00 Drew Crawford notifications@github.com:

Yes, I can confirm that I'm no longer getting the error when I reference this js module without having Q included as well. Thanks for fixing this!

— Reply to this email directly or view it on GitHub https://github.com/saribe/eModal/issues/25#issuecomment-174590233.