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

controller.tirgger()がイベントオブジェクトを返すようにする #222

Closed
fukudayasuo opened this issue Jun 7, 2013 · 0 comments
Closed
Assignees
Labels
Milestone

Comments

@fukudayasuo
Copy link

@fukudayasuo fukudayasuo commented Jun 7, 2013

現在、コントローラのtriggerは何も返していない。jQueryのtriggerは呼び出したjQueryオブジェクトを返すが、コントローラのtriggerではイベントオブジェクトを返すようにする。

また、jsDocにはeventNameで文字列を受け取るように書いているが、実際はイベントオブジェクトを渡してもトリガされる。jsDocにjQueryEventオブジェクトを渡せることも記述する。

trigger: function(event, parameter) {
    // eventが文字列ならイベントを作って投げる
    // オブジェクトの場合はそのまま渡す。
    var ev = isString(event) ? $.Event(event): event;
    $(this.rootElement).trigger(ev, parameter);
    return ev;
}
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue Jun 7, 2013
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue Jun 7, 2013
fukudayasuo pushed a commit to hifive-labs/hifivemain that referenced this issue Jun 7, 2013
@ghost ghost assigned fukudayasuo Jun 25, 2013
@simdy simdy closed this Jun 25, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.