namespace the events for popover/tooltip #4104

Merged
merged 4 commits into from Jul 22, 2012

3 participants

@lookfirst

namespace the events for popover/tooltip so that they can be cleanly removed.

references issue #3880

@travisbot

This pull request passes (merged 2ee9b27 into 40ab928).

@lookfirst

I wasn't sure what you wanted for the config key name... ns seemed short and sweet, but i'm open to changing it however you want.

@travisbot

This pull request passes (merged 117f65d into 40ab928).

@fat
Bootstrap member

Hey @lookfirst,

Thanks for opening this pull-request! Unfotunately, it looks like it fails to pass the tests neccessary for submitting to bootstrap. The following tests are currently failing:

  • should always include a unit test if changing js files

For a full list of issue filing guidelines, please refer to the bootstrap issue filing guidelines.

thanks!

@fat fat closed this Jul 22, 2012
@lookfirst

@fat umm... I did include tests.

@fat fat reopened this Jul 22, 2012
@fat
Bootstrap member

weird, sorry about that

@travisbot

This pull request passes (merged 117f65d into 40ab928).

@lookfirst lookfirst and 1 other commented on an outdated diff Jul 22, 2012
js/bootstrap-popover.js
@@ -72,7 +72,8 @@
}
, destroy: function () {
- this.$element.off().removeData('popover')
+ this.hide()
+ this.$element.off(this.options.ns).removeData('popover')

just realized that this could be combined into this.hide().off(this.options.ns)... if you like.

@fat
Bootstrap member
fat added a note Jul 22, 2012

yes pls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@fat
Bootstrap member

any reason not to just always use the prefix .tooltip and .popover? Not super crazy about adding an option for that

@travisbot

This pull request passes (merged 393f4a7 into 40ab928).

@lookfirst

i'm not super crazy about the option either, but i could easily see a generic word like those being used by other plugins.

how about something a bit less generic like bs-popover/bs-tooltip?

@fat
Bootstrap member

well... everywhere else we just use "modal" or "button". I don't think it's too big of a deal. If you have two different tooltip plugins instantiated on the same element you probably have bigger problems ;)

In the future we'll probably namespace everything with bootstrap (data-attrs and events - but that will be a 3.0.0 thing, because it's breaks backwards compatibility)

@lookfirst

ok, i'll hardcode it then.

@fat
Bootstrap member

cool thanks :)

@lookfirst

Oh, looking at that more closely now, I know why I did that... popover extends tooltip and tooltip.init() is where the .on() is... I needed to define the name of the plugin somewhere...

@fat
Bootstrap member

this.type will equal 'popover' or 'tooltip' - it's assigned in the init method

@travisbot

This pull request passes (merged d76c899 into 40ab928).

@lookfirst

ah, missed that. should be good now. all tests pass.

@fat fat merged commit 48fc0ad into twbs:2.1.0-wip Jul 22, 2012
@fat
Bootstrap member

great - thanks man!

@cvrebert cvrebert locked and limited conversation to collaborators Jul 28, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.