align button to share with contacts
split the output of createShareWithFriends in content and button
This commit is contained in:
parent
96f82c8e7c
commit
ae6f5074a7
@ -932,7 +932,7 @@ define([
|
|||||||
}, refreshButtons);
|
}, refreshButtons);
|
||||||
$div.append(teamsList.div);
|
$div.append(teamsList.div);
|
||||||
|
|
||||||
var shareButtons = [{
|
var shareButton = {
|
||||||
className: 'primary cp-share-with-friends',
|
className: 'primary cp-share-with-friends',
|
||||||
name: Messages.share_withFriends,
|
name: Messages.share_withFriends,
|
||||||
onClick: function () {
|
onClick: function () {
|
||||||
@ -992,7 +992,7 @@ define([
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
keys: [13]
|
keys: [13]
|
||||||
}];
|
};
|
||||||
|
|
||||||
common.getAttribute(['general', 'share-friends'], function (err, val) {
|
common.getAttribute(['general', 'share-friends'], function (err, val) {
|
||||||
order = val || [];
|
order = val || [];
|
||||||
@ -1017,10 +1017,12 @@ define([
|
|||||||
// Display them
|
// Display them
|
||||||
$(friendDiv).find('.cp-usergrid-grid').detach();
|
$(friendDiv).find('.cp-usergrid-grid').detach();
|
||||||
$(friendDiv).append(h('div.cp-usergrid-grid', others));
|
$(friendDiv).append(h('div.cp-usergrid-grid', others));
|
||||||
$div.append(UI.dialog.getButtons(shareButtons, config.onClose));
|
|
||||||
refreshButtons();
|
refreshButtons();
|
||||||
});
|
});
|
||||||
return div;
|
return {
|
||||||
|
content: div,
|
||||||
|
button: shareButton
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Share Modal Creation
|
/// Share Modal Creation
|
||||||
@ -1146,11 +1148,16 @@ define([
|
|||||||
|
|
||||||
var hasFriends = Object.keys(config.friends || {}).length !== 0;
|
var hasFriends = Object.keys(config.friends || {}).length !== 0;
|
||||||
var onFriendShare = Util.mkEvent();
|
var onFriendShare = Util.mkEvent();
|
||||||
var friendsList = hasFriends ? createShareWithFriends(config, onFriendShare) : h('p', Messages.share_noContacts);
|
var friendsObject = hasFriends ? createShareWithFriends(config, onFriendShare) : {
|
||||||
// var friendsUIClass = hasFriends ? '.cp-share-columns' : '';
|
content: h('p', Messages.share_noContacts)
|
||||||
|
};
|
||||||
|
var friendsList = friendsObject.content;
|
||||||
|
|
||||||
|
|
||||||
onFriendShare.reg(saveValue);
|
onFriendShare.reg(saveValue);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// XXX Don't display access rights if no contacts
|
// XXX Don't display access rights if no contacts
|
||||||
/// var contactsAccessRights = hasFriends ? createAccessRights('contact-rights') : '';
|
/// var contactsAccessRights = hasFriends ? createAccessRights('contact-rights') : '';
|
||||||
var contacts = h('div.cp-share-modal');
|
var contacts = h('div.cp-share-modal');
|
||||||
@ -1158,7 +1165,8 @@ define([
|
|||||||
|
|
||||||
$(friendsList).appendTo($contacts);
|
$(friendsList).appendTo($contacts);
|
||||||
|
|
||||||
var contactButtons = [makeCancelButton()]
|
var contactButtons = [makeCancelButton(),
|
||||||
|
friendsObject.button];
|
||||||
|
|
||||||
var frameContacts = UI.dialog.customModal(contacts, {
|
var frameContacts = UI.dialog.customModal(contacts, {
|
||||||
buttons: contactButtons,
|
buttons: contactButtons,
|
||||||
@ -1240,6 +1248,7 @@ define([
|
|||||||
});
|
});
|
||||||
return tabs;
|
return tabs;
|
||||||
};
|
};
|
||||||
|
|
||||||
UIElements.createFileShareModal = function (config) {
|
UIElements.createFileShareModal = function (config) {
|
||||||
var origin = config.origin;
|
var origin = config.origin;
|
||||||
var pathname = config.pathname;
|
var pathname = config.pathname;
|
||||||
@ -1338,6 +1347,7 @@ define([
|
|||||||
return tabs;
|
return tabs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
UIElements.createInviteTeamModal = function (config) {
|
UIElements.createInviteTeamModal = function (config) {
|
||||||
var common = config.common;
|
var common = config.common;
|
||||||
var hasFriends = Object.keys(config.friends || {}).length !== 0;
|
var hasFriends = Object.keys(config.friends || {}).length !== 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user