address notes

This commit is contained in:
David Benqué 2019-11-20 09:47:57 +00:00
parent 718fdb556b
commit 33b16ffcdf
3 changed files with 25 additions and 28 deletions

View file

@ -877,7 +877,7 @@ define([
return friends[c].curvePublic.slice(0,8);
});
var div = h('div.cp-share-column.contains-nav');
var div = h('div.contains-nav');
var $div = $(div);
// Replace "copy link" by "share with friends" if at least one friend is selected
// Also create the "share with friends" button if it doesn't exist
@ -1067,6 +1067,7 @@ define([
// XXX remove LESS code for cp-share-columns if not using anymore
//var mainShareColumn = h('div.cp-share-column.contains-nav', content);
var link = h('div.cp-share-modal', content);
var saveValue = function () {
var edit = Util.isChecked($(link).find('#cp-share-editable-true'));
var embed = Util.isChecked($(link).find('#cp-share-embed'));
@ -1090,27 +1091,17 @@ define([
return origin + parsed.getUrl({embed: embed, present: present});
};
var cancelButton = {
className: 'cancel',
var makeCancelButton = function() {
return {className: 'cancel',
name: Messages.cancel,
onClick: function () {},
keys: [27]
keys: [27]};
};
var linkButtons = [cancelButton];
var shareButtons = [{
className: 'primary',
name: Messages.share_linkCopy,
onClick: function () {
saveValue();
var v = getLinkValue();
var success = Clipboard.copy(v);
if (success) { UI.log(Messages.shareSuccess); }
},
keys: [13]
}];
var linkButtons = [makeCancelButton()];
if (!config.sharedFolder) {
shareButtons.unshift({
linkButtons.push({
className: 'secondary', // XXX style this diferently than cancel
name: Messages.share_linkOpen,
onClick: function () {
@ -1120,7 +1111,19 @@ define([
},
keys: [[13, 'ctrl']]
});
}
};
linkButtons.push({
className: 'primary',
name: Messages.share_linkCopy,
onClick: function () {
saveValue();
var v = getLinkValue();
var success = Clipboard.copy(v);
if (success) { UI.log(Messages.shareSuccess); }
},
keys: [13]}
);
var $link = $(link);
@ -1138,10 +1141,6 @@ define([
});
// $link.append(UI.dialog.getButtons(shareButtons, config.onClose));
shareButtons.forEach(function(button){
linkButtons.push(button);
});
console.log(linkButtons);
var frameLink = UI.dialog.customModal(link, {
buttons: linkButtons,
@ -1163,7 +1162,7 @@ define([
$(friendsList).appendTo($contacts);
var contactButtons = [cancelButton]
var contactButtons = [makeCancelButton()]
var frameContacts = UI.dialog.customModal(contacts, {
buttons: contactButtons,
@ -1184,7 +1183,7 @@ define([
UI.dialog.selectable(getEmbedValue())
]);
var embedButtons = [
cancelButton, {
makeCancelButton(), {
className: 'primary',
name: Messages.share_linkCopy,
onClick: function () {

View file

@ -4120,9 +4120,7 @@ define([
modal = padType === 'file' ? UIElements.createFileShareModal(padData)
: UIElements.createShareModal(padData);
modal = UI.dialog.tabs(modal);
UI.openCustomModal(modal, {
wide: _wide
});
UI.openCustomModal(modal);
}
}
else if ($this.hasClass('cp-app-drive-context-savelocal')) {

View file

@ -533,7 +533,7 @@ MessengerUI, Messages) {
Common.getSframeChannel().event('EV_SHARE_OPEN', {
hidden: true
});
$shareBlock.ready(function () {
$shareBlock.ready(function () { // XXX put .click back when done
var title = (config.title && config.title.getTitle && config.title.getTitle())
|| (config.title && config.title.defaultName)
|| "";