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

fix: textarea #397

Merged
merged 2 commits into from
Nov 11, 2014
Merged

fix: textarea #397

merged 2 commits into from
Nov 11, 2014

Conversation

yhoonkim
Copy link
Contributor

@yhoonkim yhoonkim commented Nov 9, 2014

#394

입력시 개행이 되도록 javascript를 수정하였습니다.

@yhoonkim yhoonkim added the verify label Nov 9, 2014
@shaynekang
Copy link

음. 저라면 크게 두 가지 방법을 쓸 것 같습니다.

1번은

$("textarea#tags, textarea#user_filter_word, textarea#search_word").keydown(function(e){
  if (e.keyCode == 13 && !e.shiftKey)
  {
      if (this.form)
        this.form.submit();
      else
        e.preventDefault();
      return false;
  }
});

이런 방법이 있을 것 같구요.
(장점은 애매모호한 if문을 쓰지 않을 수 있죠. ㅎㅎ)

2번은

$("textarea.auto-search").keydown(function(e){
  if (e.keyCode == 13 && !e.shiftKey)
  {
      if (this.form)
        this.form.submit();
      else
        e.preventDefault();
      return false;
  }
});

로 적고, textarea에 auto-search라는 클래스를 넣을 것 같습니다.
2번은 처음에는 귀찮겠지만 코드가 더 간결하고, 다른 뷰에 비슷한 기능을 구현하고 싶을 경우 auto-search 클래스만 넣으면 자동으로 적용이 되겠죠. ㅎㅎ

@yhoonkim
Copy link
Contributor Author

jquery multi select 어제 찾을때는 안나와서 헐 이런거 없나하고 if문 쓴건뎈ㅋㅋ
역시 졸릴때 코딩하면 안되나봐요ㅎㅎ

@shaynekang
Copy link

ㅋㅋ 수고하셨습니다. 👍

yhoonkim added a commit that referenced this pull request Nov 11, 2014
@yhoonkim yhoonkim merged commit 6794b8d into develop Nov 11, 2014
@yhoonkim yhoonkim removed the verify label Nov 11, 2014
@yhoonkim yhoonkim deleted the feature/enabling_enter_in_textarea branch November 11, 2014 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants