From b0ef3d60210e380d5dd8579903fca487ba9989e3 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 18 Jun 2019 14:23:48 +0200 Subject: [PATCH] Fix UI issues with the new share modal and notifications --- .../src/less2/include/notifications.less | 2 +- customize.dist/src/less2/include/share.less | 3 +++ www/common/common-ui-elements.js | 25 +++++++++++-------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/customize.dist/src/less2/include/notifications.less b/customize.dist/src/less2/include/notifications.less index 206a4ed71..4b37c14b4 100644 --- a/customize.dist/src/less2/include/notifications.less +++ b/customize.dist/src/less2/include/notifications.less @@ -10,7 +10,7 @@ display: flex; flex-flow: column; .cp-notification { - height: @notif-height; + min-height: @notif-height; display: flex; .cp-notification-content { flex: 1; diff --git a/customize.dist/src/less2/include/share.less b/customize.dist/src/less2/include/share.less index 27ac28046..98641a5f5 100644 --- a/customize.dist/src/less2/include/share.less +++ b/customize.dist/src/less2/include/share.less @@ -4,6 +4,7 @@ @import (reference) './avatar.less'; @import (reference) './checkmark.less'; @import (reference) './password-input.less'; +@import (reference) "./tools.less"; .share_main () { .alertify_main(); .checkmark_main(20px); @@ -41,6 +42,7 @@ display: flex; input { flex: 1; + min-width: 0; margin-bottom: 0 !important; &::placeholder { /* Chrome, Firefox, Opera, Safari 10.1+ */ color: @colortheme_alertify-primary-text; @@ -60,6 +62,7 @@ margin-bottom: 6px; cursor: default; transition: order 0.5s, background-color 0.5s; + .tools_unselectable(); &.cp-selected { background-color: @colortheme_alertify-primary; diff --git a/www/common/common-ui-elements.js b/www/common/common-ui-elements.js index 84c772531..d4a07c5a7 100644 --- a/www/common/common-ui-elements.js +++ b/www/common/common-ui-elements.js @@ -343,6 +343,7 @@ define([ 'data-curve': data.curvePublic, 'data-name': data.displayName, 'data-order': i, + title: data.displayName, style: 'order:'+i+';' },[ avatar, @@ -392,17 +393,6 @@ define([ }; $(inputFilter).on('keydown keyup change', redraw); - $(buttonSelect).click(function () { - $div.find('.cp-share-friend:not(.cp-selected):visible').addClass('cp-selected'); - }); - $(buttonDeselect).click(function () { - $div.find('.cp-share-friend.cp-selected').removeClass('cp-selected').each(function (i, el) { - var order = $(el).attr('data-order'); - if (!order) { return; } - $(el).attr('style', 'order:'+order); - }); - redraw(); - }); // Replace "copy link" by "share with friends" if at least one friedn is selected // Also create the "share with friends" button if it doesn't exist @@ -459,6 +449,19 @@ define([ } }; + $(buttonSelect).click(function () { + $div.find('.cp-share-friend:not(.cp-fake-friend):not(.cp-selected):visible').addClass('cp-selected'); + refreshButtons(); + }); + $(buttonDeselect).click(function () { + $div.find('.cp-share-friend.cp-selected').removeClass('cp-selected').each(function (i, el) { + var order = $(el).attr('data-order'); + if (!order) { return; } + $(el).attr('style', 'order:'+order); + }); + redraw(); + refreshButtons(); + }); common.getAttribute(['general', 'share-friends'], function (err, val) { order = val || [];