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

Testing compatibility with bootstrap #52

Closed
IngwiePhoenix opened this issue May 3, 2015 · 8 comments
Closed

Testing compatibility with bootstrap #52

IngwiePhoenix opened this issue May 3, 2015 · 8 comments
Labels

Comments

@IngwiePhoenix
Copy link

I just decided to silently replace jquery.js with cash.js...very sneakily. :)

It seems to actually run down pretty far - my jQuery modules check in properly. But at some point, I see this error:

Uncaught TypeError: this[0].getAttribute is not a function

Cause:

        attr: function (name, value) {
          if (!value) {
       ----> return this[0].getAttribute(name);
          } else {
            this.each(function (v) {
              return v.setAttribute(name, value);
            });

            return this;
          }
        },

I followed the stack trace, and this is the line that causes the error:

$(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)

That seems to resolve to bootstrap/src/js/alert.js.

What could the issue be?

@IngwiePhoenix
Copy link
Author

Full stacktrace:

Uncaught TypeError: this[0].getAttribute is not a function
    fn.extend.attr @ b69098715d71615baa6c-main.js:816
    fn.extend.data @ b69098715d71615baa6c-main.js:950
    registerEvent @ b69098715d71615baa6c-main.js:1030
    (anonymous function) @ b69098715d71615baa6c-main.js:1090
    cash.each @ b69098715d71615baa6c-main.js:733
    fn.extend.each @ b69098715d71615baa6c-main.js:885
    fn.extend.on @ b69098715d71615baa6c-main.js:1070
    (anonymous function) @ b69098715d71615baa6c-main.js:3920
    (anonymous function) @ b69098715d71615baa6c-main.js:3922
    (anonymous function) @ b69098715d71615baa6c-main.js:3924
    __webpack_require__ @ bootstrap b69098715d71615baa6c:50
    (anonymous function) @ b69098715d71615baa6c-main.js:81
    (anonymous function) @ b69098715d71615baa6c-main.js:108
    __webpack_require__ @ bootstrap b69098715d71615baa6c:50
    (anonymous function) @ b69098715d71615baa6c-main.js:17
    (anonymous function) @ b69098715d71615baa6c-main.js:68
    __webpack_require__ @ bootstrap b69098715d71615baa6c:50
    webpackJsonpCallback @ bootstrap b69098715d71615baa6c:21
    (anonymous function) @ b69098715d71615baa6c-main.js:1

You can see the contents of the entire file here: https://gist.github.com/IngwiePhoenix/1d9d49bb5b5e00ea3ec1

@kenwheeler
Copy link
Collaborator

I believe it's an issue related to getAttributes availability on window and document, working out a fix as we speak

@IngwiePhoenix
Copy link
Author

IngwiePhoenix commented May 4, 2015 via email

@shshaw shshaw added the bug label Apr 12, 2016
@simeydotme
Copy link
Collaborator

I think this might be working, now?

@shshaw shshaw mentioned this issue May 4, 2016
@shshaw
Copy link
Collaborator

shshaw commented May 4, 2016

This should be working with 1.3.0. Let us know if you find any other incompatibilities. Thanks!

@shshaw shshaw closed this as completed May 4, 2016
@noBlubb
Copy link

noBlubb commented Jun 21, 2016

Hey,
I'm about to drop cash.js into bootstrap v4 alpha 2. Other than v3 this time they seem to use special jQuery event handlers (?) https://github.com/twbs/bootstrap/blob/v4-dev/js/src/util.js#L88

Any ideas? Maybe as a plugin?

@shshaw
Copy link
Collaborator

shshaw commented Jun 21, 2016

Hm, it looks like they're using some very jQuery specific features. jQuery has the $.event.special object for mapping events that need special syntax or handling. #128 brought up where Cash may need something similar for handling focusin/out events in FireFox, but we haven't specifically made plans for jQuery special event compatibility.

I'd suggest adding $.event = { special: {} } after including jQuery but before including Bootstrap to see if that allows the transition end events to work in browsers you need to support. I'm sure there's some browser specific bug that the Bootstrap code is patching, but an event handler on transitionend (or the prefixed version) should work as expected.

@iantearle
Copy link

How do you get around the "Bootstrap's JavaScript requires jQuery" warning? Or just a case of ignoring it? Does anyone know if cash if fully compatible with Bootstrap 3.3.7?

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

No branches or pull requests

6 participants