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

コントローラをunbindした時に、直接ターゲット指定したイベントハンドラがアンバインドされない場合がある #362

Closed
fukudayasuo opened this issue Jun 19, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@fukudayasuo
Copy link

グローバルセレクタでオブジェクトや要素を指定してバインドして、unbind時にバインド対象要素が参照できない時、正しくアンバインドできない。以下のようなコードで動作を確認した。

h5.core.controller('body', {
  __name:'controller',
  target: $('.target'),
  '{this.target} click': function(){
    console.log('binded!');
  }
}).readyPromise.done(function(){
  this.target = null;  // this.targetにnullを代入
  this.unbind();        // unbind
  $('.target').click(); // "binded!"
});
@simdy simdy added the bug label Jun 19, 2014
@simdy simdy added this to the v1.1.12 milestone Jun 19, 2014
@fukudayasuo
Copy link
Author

5652a29
対応しました。バインドした時のターゲットを覚えておいてunbindするようにしました。

@simdy
Copy link
Member

simdy commented Jun 27, 2014

c794b7f 変数名を修正。

@simdy simdy closed this as completed Jun 27, 2014
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

2 participants