Skip to content

Commit

Permalink
Merge branch 'dev' into hybrid
Browse files Browse the repository at this point in the history
  • Loading branch information
lipis authored Mar 14, 2017
2 parents ffe6fc9 + 0dd2718 commit bad57b4
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 122 deletions.
2 changes: 1 addition & 1 deletion app/page/template/list/start-ui.htm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<!-- ko if: show_suggestions() && suggestions().length -->
<div class="start-ui-list-suggestions">
<span class="start-ui-list-header" data-uie-name="status-connect" data-bind="l10n_text: z.string.search_connect"></span>
<user-list class="search-list-theme-black" params="user: suggestions, click: click_on_other, connect: click_on_connect, dismiss: click_on_dismiss, mode: z.components.UserListMode.INFO"></user-list>
<user-list class="search-list-theme-black" params="user: suggestions, click: click_on_other, mode: z.components.UserListMode.INFO"></user-list>
</div>
<!-- /ko -->
<!-- ko if: show_connections() && connections().length -->
Expand Down
8 changes: 0 additions & 8 deletions app/script/search/SearchRepository.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,6 @@ class z.search.SearchRepository
get_common_contacts: (user_id) =>
@search_service.get_common(user_id).then (response) -> response.returned

###
Ignore suggested user.
@param user_id [String] User ID
@return [Promise] Promise that resolves when a suggestion has been ignored
###
ignore_suggestion: (user_id) ->
@search_service.put_suggestions_ignore user_id

###
Search for users on the backend by name.
@param name [String] Search query
Expand Down
10 changes: 0 additions & 10 deletions app/script/search/SearchService.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,3 @@ class z.search.SearchService
@client.send_request
type: 'GET'
url: @client.create_url "/search/contacts?q=#{encodeURIComponent(query)}&size=#{size}&l=#{level}&d=#{directory}"

###
Ignore suggested user.
@param user_id [String] User ID
@return [Promise] Promise that resolves when a suggestion has been ignored
###
put_suggestions_ignore: (user_id) ->
@client.send_request
type: 'PUT'
url: @client.create_url "/search/suggestions/#{user_id}/ignore"
34 changes: 0 additions & 34 deletions app/script/view_model/list/StartUIViewModel.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -299,40 +299,6 @@ class z.ViewModel.list.StartUIViewModel
else
create_bubble(element[0].id)

_collapse_item: (search_list_item, callback) ->
search_list_item.find('.search-list-item-connect').remove()
window.requestAnimationFrame ->
search_list_item
.addClass 'search-list-item-collapse'
.on z.util.alias.animationend, (event) ->
if event.originalEvent.propertyName is 'height'
search_list_item
.remove()
.off z.util.alias.animationend
callback?()


click_on_dismiss: (user_et, event) =>
search_list_item = $(event.currentTarget.parentElement.parentElement)
@_collapse_item search_list_item, =>
@search_repository.ignore_suggestion user_et.id
.then =>
@suggestions.remove user_et
.catch (error) =>
@logger.error "Failed to ignore suggestions: '#{error.message}'", error

click_on_connect: (user_et, event) =>
search_list_item = $(event.currentTarget.parentElement.parentElement)
search_list_item
.addClass 'search-list-item-connect-anim'
.one z.util.alias.animationend, =>
window.setTimeout =>
@_collapse_item search_list_item, =>
@user_repository.create_connection user_et
.then =>
@suggestions.remove user_et
, 550

###############################################################################
# Data sources
###############################################################################
Expand Down
8 changes: 0 additions & 8 deletions app/style/common/animations.less
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,3 @@
opacity: 0;
pointer-events: none;
}

.list-item-collapse {
transition-duration: @animation-timing-fast, @animation-timing-slow;
transition-property: opacity, height;
transition-timing-function: @ease-out-quart, @ease-in-out-expo;
height: 0;
opacity: 0;
}
61 changes: 0 additions & 61 deletions app/style/components/search-list.less
Original file line number Diff line number Diff line change
Expand Up @@ -46,35 +46,6 @@
height: 56px;
margin: 0;
}

.search-list-lg &.hover,
.search-list-lg &:hover {
.search-list-item-connect {
// fade in
transition-property: opacity;
transition-duration: @animation-timing-slow;
transition-timing-function: @ease-out-quart;
transition-delay: @animation-timing-faster + 0.05;
opacity: 1;
width: 48px;
}
}
.search-list-lg &:not(.hover):not(:hover) {
.search-list-item-connect {
// fade out
transition-property: opacity, width;
transition-duration: @animation-timing-fast, 0s;
transition-delay: 0s, @animation-timing-fast;
transition-timing-function: @ease-out-quart, linear;
opacity: 0;
width: 0;
overflow: hidden;
}
}

&.search-list-item-collapse {
.list-item-collapse();
}
}

.search-list-item-image {
Expand Down Expand Up @@ -107,27 +78,6 @@
transform: scale(1.8);
opacity: 0;
}

.search-list-item-connect-anim & {

.background {
// fade int
transition-property: opacity;
transition-duration: @animation-timing-fast;
transition-timing-function: @ease-out-quart;
opacity: .64;
}

.checkmark {
transition-property: transform, opacity;
transition-delay: .1s;
transition-duration: @animation-timing-slow;
transition-timing-function: @ease-out-back;
transform: scale(1);
opacity: 1;
}

}
}

.search-list-item-content {
Expand Down Expand Up @@ -171,17 +121,6 @@
margin-right: 4px;
}

.search-list-item-connect {
align-items: center;
display: flex;
flex: 0 0 auto;
height: @avatar-diameter-sm;

> .icon-button {
margin-left: 8px;
}
}

.search-list-item-header {
.ellipsis;
height: @avatar-diameter-sm;
Expand Down

0 comments on commit bad57b4

Please sign in to comment.