Skip to content
This repository was archived by the owner on May 29, 2019. It is now read-only.

typeahead improvement - çlear ('x') button which appears after some option selected from suggestions #4483

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

shootermv
Copy link

I'm newbie - so may be my code will have a lot of issues (for example may be it better to make this feature optional) , so please write me what to improve and will try my best.
Thanks

@wesleycho
Copy link
Contributor

I'm fine with this as is I think, but this needs some tests to ensure it is clearing.

If this gets rebased, I'd be willing to merge this for 3.0.0, only to mitigate risk of it being a breaking change for others.


scope.positionClearBtn = $position.position(element);
scope.positionClearBtn.top += element.prop('offsetHeight')/4;
scope.positionClearBtn.left += element.prop('offsetWidth')-20;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these two lines, add spacing for the math operations, i.e. foo / 4 and foo - 20.

@icfantv
Copy link
Contributor

icfantv commented Aug 18, 2016

@shootermv what's with all the indents? Can you please clean all that up? It makes it challenging to review this.

@shootermv
Copy link
Author

Hi Adam.
I think the indents removed, also i tried the best i can to add some tests
Hope they are ok,
Thanks

On Thu, Aug 18, 2016 at 11:23 PM, Adam Gordon [email protected]
wrote:

@shootermv https://github.com/shootermv what's with all the indents?
Can you please clean all that up? It makes it challenging to review this.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4483 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABRmHldTWS8hqs_SmSkWUM7tFAleRLp0ks5qhL9GgaJpZM4GEd5X
.

http://gs500coder.blogspot.com

return element.find('.glyphicon-remove');
};


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra space

@icfantv
Copy link
Contributor

icfantv commented Aug 19, 2016

@shootermv, You still have some spacing issues (auto formatter from your IDE?) around extra blank lines and trailing whitespace. Also, please squash your commits. In the future, you can avoid this by reusing your original commit via git commit --amend and then doing a force push.

@shootermv
Copy link
Author

Thanks a lot, removed some more spaces problem as much as i can see,
Hope this time it will be better
Thanks

On Fri, Aug 19, 2016 at 3:17 AM, Adam Gordon [email protected]
wrote:

@shootermv https://github.com/shootermv, You still have some spacing
issues (auto formatter from your IDE?) around extra blank lines and
trailing whitespace. Also, please squash your commits. In the future, you
can avoid this by reusing your original commit via git commit --amend and
then doing a force push.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4483 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABRmHhooHQFOUR0kUj1LNr5bggMbYalXks5qhPYqgaJpZM4GEd5X
.

http://gs500coder.blogspot.com

feat(typeahead): removed all extra indents and $scope.$digest

feat(typeahead): removed some extra spaces & indents

feat(typeahead): removed some extra spaces & indents 2
@shootermv
Copy link
Author

Also tried to squash some commits into recent
Hope my direction is right
Thanks

On Fri, Aug 19, 2016 at 12:29 PM, Moshe Vilner [email protected] wrote:

Thanks a lot, removed some more spaces problem as much as i can see,
Hope this time it will be better
Thanks

On Fri, Aug 19, 2016 at 3:17 AM, Adam Gordon [email protected]
wrote:

@shootermv https://github.com/shootermv, You still have some spacing
issues (auto formatter from your IDE?) around extra blank lines and
trailing whitespace. Also, please squash your commits. In the future, you
can avoid this by reusing your original commit via git commit --amend
and then doing a force push.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4483 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABRmHhooHQFOUR0kUj1LNr5bggMbYalXks5qhPYqgaJpZM4GEd5X
.

http://gs500coder.blogspot.com

http://gs500coder.blogspot.com

scope.positionClearBtn = $position.position(element);
scope.positionClearBtn.top += element.prop('offsetHeight') / 4;
scope.positionClearBtn.left += element.prop('offsetWidth') - 20;

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the extra blank lines here, please

@@ -351,6 +362,9 @@ angular.module('ui.bootstrap.typeahead', ['ui.bootstrap.debounce', 'ui.bootstrap
var model, item;

selected = true;
//indicator that some choise selected for clear button
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a couple things:

  • prefer end-of-line comments as opposed to comments that take their own line. especially when short
  • it should be "choice"
  • please put a space between the // and the first character of the comment
  • remove the blank line between this variable declaration and the line for locals[parserResult...
  • please pick a better variable name than selectedM - variable names should describe what it is.

@icfantv
Copy link
Contributor

icfantv commented Aug 19, 2016

@shootermv a bunch of little things i've commented on. you should google how to squash your commits. also, it doesn't look like you followed my instructions about how to reuse your existing commit and then do a force push?

@shootermv
Copy link
Author

Hi, in order to squash all my changes into one commit i deleted and
recreated the repo. I hope it will be fine now.
Thanks

On Fri, Aug 19, 2016 at 8:55 PM, Adam Gordon [email protected]
wrote:

@shootermv https://github.com/shootermv a bunch of little things i've
commented on. you should google how to squash your commits. also, it
doesn't look like you followed my instructions about how to reuse your
existing commit and then do a force push?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#4483 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABRmHmoQJr45fK-JdROGbuezrhgTpzpsks5qhe4QgaJpZM4GEd5X
.

http://gs500coder.blogspot.com

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants