Open the access modal in the secure iframe
parent
19a0dafbe1
commit
2aec7c2569
|
@ -196,6 +196,7 @@ define([
|
|||
]);
|
||||
var $frame = $(frame);
|
||||
frame.closeModal = function (cb) {
|
||||
frame.closeModal = function () {}; // Prevent further calls
|
||||
$frame.fadeOut(150, function () {
|
||||
$frame.detach();
|
||||
if (typeof(cb) === "function") { cb(); }
|
||||
|
|
|
@ -1592,11 +1592,7 @@ define([
|
|||
.text(Messages.accessButton))
|
||||
.click(common.prepareFeedback(type))
|
||||
.click(function () {
|
||||
require(['/common/inner/access.js'], function (Access) {
|
||||
Access.getAccessModal(common, {}, function (e) {
|
||||
if (e) { console.error(e); }
|
||||
});
|
||||
});
|
||||
sframeChan.event('EV_ACCESS_OPEN');
|
||||
});
|
||||
break;
|
||||
case 'properties':
|
||||
|
|
|
@ -129,7 +129,10 @@ define([
|
|||
tabs[i] = {
|
||||
content: c && UI.dialog.customModal(node, {
|
||||
buttons: obj.buttons || button,
|
||||
onClose: function () { blocked = false; }
|
||||
onClose: function () {
|
||||
blocked = false;
|
||||
if (typeof(opts.onClose) === "function") { opts.onClose(); }
|
||||
}
|
||||
}),
|
||||
disabled: !c,
|
||||
title: obj.title,
|
||||
|
|
|
@ -1020,6 +1020,10 @@ define([
|
|||
initSecureModal('filepicker', data || {}, cb);
|
||||
});
|
||||
|
||||
sframeChan.on('EV_ACCESS_OPEN', function (data) {
|
||||
initSecureModal('access', data || {}, null);
|
||||
});
|
||||
|
||||
sframeChan.on('EV_SHARE_OPEN', function (data) {
|
||||
initSecureModal('share', data || {}, null);
|
||||
});
|
||||
|
|
|
@ -40,6 +40,8 @@ define([
|
|||
|
||||
var displayed;
|
||||
var create = {};
|
||||
|
||||
// Share modal
|
||||
create['share'] = function (data) {
|
||||
var priv = metadataMgr.getPrivateData();
|
||||
var f = (data && data.file) ? UIElements.createFileShareModal
|
||||
|
@ -71,6 +73,20 @@ define([
|
|||
displayed = modal;
|
||||
};
|
||||
|
||||
// Access modal
|
||||
create['access'] = function (data) {
|
||||
require(['/common/inner/access.js'], function (Access) {
|
||||
Access.getAccessModal(common, {
|
||||
onClose: function () {
|
||||
hideIframe();
|
||||
}
|
||||
}, function (e, modal) {
|
||||
if (e) { console.error(e); }
|
||||
displayed = modal;
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
// File uploader
|
||||
var onFilePicked = function (data) {
|
||||
var privateData = metadataMgr.getPrivateData();
|
||||
|
|
|
@ -108,6 +108,10 @@ define([
|
|||
|
||||
config.addCommonRpc(sframeChan);
|
||||
|
||||
Cryptpad.padRpc.onMetadataEvent.reg(function (data) {
|
||||
sframeChan.event('EV_RT_METADATA', data);
|
||||
});
|
||||
|
||||
sframeChan.on('EV_CACHE_PUT', function (x) {
|
||||
Object.keys(x).forEach(function (k) {
|
||||
localStorage['CRYPTPAD_CACHE|' + k] = x[k];
|
||||
|
|
Loading…
Reference in New Issue