LoginSignup
0
0

More than 5 years have passed since last update.

Bootstrap で Popover が bind されていたら、hide したかった

Posted at

popover を動的にセットすると、
popover がバインドされている要素と、バインドされていない要素ができる

リストをループして popover("hide") すると挙動が変だったので、
バインドされている時だけ hide にしたかった。

イベントが貼られているかを見る、という苦肉の策で乗り越えた。

  _($("li")).each (item) ->
     $(item).popover("hide") if $._data(item).data?["bs.popover"]

popover が発動していれば、$._data(item) は下記みたいになる。

image

他にやりかたはないのかしら?

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0