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

dropdown JS with Prototype 1.7.0 [BUG] #8379

Closed
c-schwan opened this issue Jul 3, 2013 · 12 comments
Closed

dropdown JS with Prototype 1.7.0 [BUG] #8379

c-schwan opened this issue Jul 3, 2013 · 12 comments
Labels

Comments

@c-schwan
Copy link

c-schwan commented Jul 3, 2013

hey guys,

I just tested bootstrap3.0 with Prototype 1.7. At the secound click the btn-group is setting to display none.

christian

@cvrebert
Copy link
Collaborator

cvrebert commented Jul 3, 2013

Using Prototype with Bootstrap is not officially supported. See the following part of v3's docs:
https://github.com/twitter/bootstrap/blob/3.0.0-wip/docs/javascript.html#L70

@c-schwan
Copy link
Author

c-schwan commented Jul 3, 2013

He Chris,

I found the same problem @issue #6921

"3.0 uses namespace

var e = $.Event('hide.bs.' + this.type)

That won't solve this issue with Prototype since jQuery will call the canonical event name 'hide' which will still conflict with the Prototype hide() method on the element.

The event name itself needs to change, eg, 'bs:hide.' + this.type (to use Backbone-inspired namespacing)."

why you don't use namespace like moos suggested (Backbone Namespacing)?

Am 03.07.2013 um 18:35 schrieb Chris Rebert notifications@github.com:

Usingg Prototype with Bootstrap is not officially supported. See the following part of v3's docs:
https://github.com/twitter/bootstrap/blob/3.0.0-wip/docs/javascript.html#L70


Reply to this email directly or view it on GitHub.

@mdo
Copy link
Member

mdo commented Jul 4, 2013

Ask on the mailing list for help with implementation details like this. If you find a particular bug, open a new issue for that. Thanks!

@mdo mdo closed this as completed Jul 4, 2013
@davidcmoody
Copy link

This makes it extremely hard for those of us trying to convert existing applications to Bootstrap and jQuery. Is there any hope of getting this fixed?

@krazyjakee
Copy link

just use a click event and add the "open" class to the dropdown container. Then you bypass all the trouble code.

@phaidon
Copy link

phaidon commented Sep 23, 2013

The event name itself needs to change, eg, 'bs:hide.' + this.type (to use Backbone-inspired namespacing)."

I can confirm that bs:hide would solve the issue.
@mdo: It would be great to get more details why you dont use the backbone-inspired namespacing. Thanks a lot.

just use a click event and add the "open" class to the dropdown container. Then you bypass all the trouble code.

@krazyjakee Can you explain this in more details. Thanks a lot.

@phaidon
Copy link

phaidon commented Sep 29, 2013

I found a work around to make it running without changing bootstrap: zikula/core@079df47

@ghost
Copy link

ghost commented Sep 29, 2013

@phaidon Genius 👍

@dgervalle
Copy link

You may found here a complete explanation of this issue and a workaround that do not require patching any framework bootstrap included.

@cvrebert cvrebert added the js label Mar 13, 2014
colllin added a commit to colllin/bootstrap that referenced this issue Jun 16, 2014
colllin added a commit to colllin/bootstrap that referenced this issue Jun 16, 2014
colllin added a commit to colllin/bootstrap that referenced this issue Jun 16, 2014
colllin added a commit to colllin/bootstrap that referenced this issue Jun 16, 2014
@patrickdavey
Copy link

Just a quick comment here - thanks to @dgervalle for his link which led me to the jsfiddle which worked up until bootstrap 3.1.1 (at least), but when I upgraded to 3.3 I needed to add tab into the list of plugins. Modified fiddle here and pasted below.

jQuery.noConflict();
if (Prototype.BrowserFeatures.ElementExtensions) {
  var pluginsToDisable = ['tab', 'collapse', 'dropdown', 'modal', 'tooltip', 'popover'];
  var disablePrototypeJS = function (method, pluginsToDisable) {
    var handler = function (event) {
      event.target[method] = undefined;
      setTimeout(function () {
        delete event.target[method];
      }, 0);
    };
    pluginsToDisable.each(function (plugin) {
      jQuery(window).on(method + '.bs.' + plugin, handler);
    });
  };


  disablePrototypeJS('show', pluginsToDisable);
  disablePrototypeJS('hide', pluginsToDisable);
}

@twbs-lmvtfy
Copy link

Hi @patrickdavey!

You appear to have posted a live example (http://fiddle.jshell.net/dgervalle/hhBc6/show/light/), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:

  • line 133, column 1: W007: Found one or more <button>s missing a type attribute.
  • line 24, column 7: W013: Bootstrap version might be outdated. Latest version is at least 3.3.5 ; saw what appears to be usage of Bootstrap 3.3.2
  • line 28, column 7: W013: Bootstrap version might be outdated. Latest version is at least 3.3.5 ; saw what appears to be usage of Bootstrap 3.3.2

You'll need to fix these errors and post a revised example before we can proceed further.
Thanks!

(Please note that this is a fully automated comment.)

@twbs-lmvtfy
Copy link

Hi @patrickdavey!

You appear to have posted a live example (https://fiddle.jshell.net/crwcbuuk/1/show/light/), which is always a good first step. However, according to Bootlint, your example has some Bootstrap usage errors, which might potentially be causing your issue:

  • line 133, column 1: W007: Found one or more <button>s missing a type attribute.
  • line 24, column 7: W013: Bootstrap version might be outdated. Latest version is at least 3.3.5 ; saw what appears to be usage of Bootstrap 3.3.2
  • line 28, column 7: W013: Bootstrap version might be outdated. Latest version is at least 3.3.5 ; saw what appears to be usage of Bootstrap 3.3.2

You'll need to fix these errors and post a revised example before we can proceed further.
Thanks!

(Please note that this is a fully automated comment.)

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

9 participants