update link preview in embed tab

pull/1/head
David Benqué 5 years ago
parent b8753f1fd7
commit 8d46bbf3b4

@ -1165,11 +1165,11 @@ define([
}); });
return '<iframe src="' + url + '"></iframe>'; return '<iframe src="' + url + '"></iframe>';
}; };
var embedContent = h('div.cp-share-modal', [ var embedContent = [
h('p', Messages.viewEmbedTag), h('p', Messages.viewEmbedTag),
h('br'), h('br'),
UI.dialog.selectable(getEmbedValue()) UI.dialog.selectable(getEmbedValue(), { id: 'cp-embed-link-preview', tabindex: 1 })
]); ];
var embedButtons = [ var embedButtons = [
makeCancelButton(), { makeCancelButton(), {
className: 'primary', className: 'primary',
@ -1181,7 +1181,16 @@ define([
}, },
keys: [13] keys: [13]
}]; }];
var frameEmbed = UI.dialog.customModal(embedContent, {
var embed = h('div.cp-share-modal', embedContent);
// update values for link preview when radio btns change
$(embed).find('#cp-embed-link-preview').val(getEmbedValue());
$(rights).find('input[type="radio"]').on('change', function () {
$(embed).find('#cp-embed-link-preview').val(getEmbedValue());
});
var frameEmbed = UI.dialog.customModal(embed, {
buttons: embedButtons, buttons: embedButtons,
onClose: config.onClose, onClose: config.onClose,
}); });

Loading…
Cancel
Save